Skip to main content

Upload a pet video

Videos are stored on a pet next to its photos. Today they're used for resting respiratory rate, which is in early access, so you can start collecting them now. The photo analysis endpoints don't use them.

Before you start

You need a pet to upload to. See Create a pet.

1. Upload​

One video per request, in the multipart field file:

curl -X POST -H "x-api-key: YOUR-API-KEY" \
-F "file=@/path/to/sleeping.MOV;type=video/quicktime" \
-F "description=Asleep on the sofa" \
https://api.thedogapi.com/v1/pets/{pet_id}/videos
Label the file type

Add ;type=… after the file name when you use curl. curl labels anything that isn't an image or text as application/octet-stream, including .MOV and .mp4 files, and an unlabelled video can be refused. Browsers and most HTTP libraries set the type from the file for you.

FormatType to send
MOV (iPhone default)video/quicktime
MP4video/mp4
WebMvideo/webm
3GPvideo/3gpp
AVIvideo/x-msvideo
MPEGvideo/mpeg

Optional fields: description, and age_years with age_months for the pet's age when the video was taken. Without them we work the age out from the pet's date of birth.

From a browser or Node, FormData carries the type for you:

const form = new FormData();
form.append('file', file); // a File from an <input type="file">, type included
form.append('description', 'Asleep on the sofa');

await fetch(`https://api.thedogapi.com/v1/pets/${petId}/videos`, {
method: 'POST',
headers: { 'x-api-key': apiKey },
body: form,
});

The response is the stored video, still being processed:

{
"id": "YSj3ZTI5Qv",
"pet_id": "UGqpzmlMbw",
"url": "https://storage.googleapis.com/…/raw-videos/….mp4",
"width": 0,
"height": 0,
"description": "Asleep on the sofa",
"mime_type": "video/mp4",
"review_status": "to_be_reviewed",
"upload_error": false,
"created_at": "2026-10-06T06:26:00.552Z"
}

2. Wait for processing​

Every video is converted to a 480p MP4. Anything longer than a minute is cut to the first minute, so film for about 30 seconds. Processing usually takes under a minute.

curl -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images/{video_id}/status
{ "id": "YSj3ZTI5Qv", "status": "clean", "updated_at": "2026-10-06T06:26:06.175Z" }
statusMeaning
to_be_reviewedStill processing.
cleanReady. The video's url now points at the converted MP4, with its width and height.
unsafeWe couldn't process it, and upload_error is true. Try a different file.

Rather than polling, subscribe to the image.uploaded webhook, which fires when the converted video is ready.

3. Find it again​

Videos come back with the pet's photos in GET /pets/{pet_id}. Tell them apart by mime_type, which starts with video/.

Limits​

  • 200 MB per video.
  • Videos count against your monthly upload quota, the same as photos. See Errors and limits.

What makes a good video​

For resting respiratory rate: the pet asleep, the chest or flank in view, the phone held still, about 30 seconds, good light.