Media

Upload media assets and get back dp:// references.

Upload media

POST/mediaAuth: API key

Uploads one or more files and returns a dp:// reference per file for use in POST /jobs datapoints.

Request

Multipart form-data with one or more files fields:

Content-Type: multipart/form-data

--boundary
Content-Disposition: form-data; name="files"; filename="video_a.mp4"
Content-Type: video/mp4

<binary>
--boundary
Content-Disposition: form-data; name="files"; filename="video_b.mp4"
Content-Type: video/mp4

<binary>
--boundary--

Files in a batch are processed sequentially, and there is no partial rollback: if the third file in a batch fails, the first two are already stored and keep their references. The whole batch is handled within a single request, so keep batches modest rather than sending very large numbers of files at once.

Response (200 OK)

{
  "media": [
    {
      "filename": "video_a.mp4",
      "media_id": "b6a1cd3f-1234-4abc-9def-0123456789ab",
      "media_ref": "dp://b6a1cd3f1234/video_a.mp4",
      "type": "video",
      "size_bytes": 2457623,
      "url": "/media/v2/b6a1cd3f-1234-4abc-9def-0123456789ab?cid=...&exp=1753280000&sig=..."
    }
  ]
}
FieldTypeDescription
filenamestringThe original filename as uploaded.
media_idstringStable identifier for the uploaded file. You normally pass `media_ref` to job creation; `media_id` is exposed for tooling that needs the raw identifier.
media_refstringOpaque dp:// URI. Pass verbatim to POST /jobs datapoints.
type"video" | "image" | "audio"Determined from the file extension (see Supported formats).
size_bytesintSize of the stored file in bytes. Matches the bytes you sent, except for `.svg`, which is stored after sanitisation.
urlstringSigned, relative preview path for the uploaded file. Bound to your account and valid for roughly one hour, so you can render the asset immediately without a separate fetch. Not a permanent link — mint jobs from `media_ref`, not this URL.

Supported formats

TypeExtensions
Image.png, .jpg, .jpeg, .webp, .avif, .gif, .svg, .heic, .heif
Video.mp4, .webm, .mov
Audio.mp3, .wav, .ogg, .m4a, .flac

The media type is taken from the file extension. The request Content-Type is only a cross-check:

  • Extension not in the table above → 400 (unsupported_media_extension). Upload one of the supported formats.
  • Extension and Content-Type disagree (e.g. a .mp4 sent as image/png) → 400 (media_type_mismatch).
  • A Content-Type the platform doesn't recognise is ignored — the extension still governs.

.svg uploads are sanitised on the way in (script vectors and unsafe references are stripped). An SVG that can't be parsed is rejected with 400 (invalid_svg).

Preview frames are generated for video only, and not at upload time — the poster frame is produced the first time the video is used in a job. The upload response's url always serves the full object; poster frames are served by thumbnail_url in GET /media.

Example

curl -X POST https://api.trydatapoint.com/data-labelling/v1/media \
  -H "X-API-Key: $DATAPOINT_KEY" \
  -F "files=@video_a.mp4" \
  -F "files=@video_b.mp4"

Error cases

StatusError codeCause
400unsupported_media_extensionThe file extension isn't supported.
400media_type_mismatchThe extension and the declared Content-Type disagree.
400invalid_svgAn .svg upload couldn't be parsed.
400invalid_mediaThe file couldn't be processed (corrupt or unreadable).
401—Missing or invalid API key.
413media_too_largeA file exceeds the 20 MiB limit; the body carries max_bytes.
422content_blockedThe file didn't pass content review.
429—Rate limit exceeded.
503—Content review is temporarily unavailable; retry after Retry-After seconds.

List media

GET/mediaAuth: API key

Lists your account's media — both files you uploaded through POST /media and media the platform fetched from direct URLs in your jobs — newest first. Paginated.

Query parameters

FieldTypeDescription
pageint
default: 1
1-based page number.
per_pageint
default: 50
Items per page, between 1 and 100.

Response (200 OK)

{
  "media": [
    {
      "media_id": "b6a1cd3f-1234-4abc-9def-0123456789ab",
      "filename": "video_a.mp4",
      "media_ref": "dp://b6a1cd3f1234/video_a.mp4",
      "type": "video",
      "size_bytes": 2457623,
      "moderation_status": "allowed",
      "created_at": "2026-07-23T18:11:04Z",
      "url": "/media/v2/b6a1cd3f-1234-4abc-9def-0123456789ab?cid=...&exp=1753280000&sig=...",
      "thumbnail_url": "/media/v2/b6a1cd3f-1234-4abc-9def-0123456789ab?cid=...&exp=1753280000&sig=...&preview=1"
    }
  ],
  "total": 1,
  "page": 1,
  "per_page": 50
}
FieldTypeDescription
mediaarrayMedia items on this page, newest first.
totalintTotal number of media items across all pages.
pageintThe page you requested.
per_pageintThe page size in effect.

Each item in media:

FieldTypeDescription
media_idstringStable identifier for the file.
media_refstringThe dp:// reference to pass to POST /jobs. Null for media the platform fetched from a direct URL in a job — only files uploaded through POST /media carry a dp:// reference.
filenamestringThe original upload name, recovered from the reference. Falls back to the `media_id` when the row has no dp:// reference (media fetched from a direct URL).
type"video" | "image" | "audio"The media type.
size_bytesintStored size in bytes.
moderation_statusstringAvailability of the file: `allowed` means it's ready to serve and preview; while it is `pending` (still in review) or if it was not accepted, the preview URLs won't resolve.
created_atstringUpload timestamp (ISO 8601).
urlstringSigned, relative preview path, bound to your account and valid for roughly one hour. Only resolves once `moderation_status` is `allowed`.
thumbnail_urlstringSigned preview path for the poster frame (videos). Falls back to the full object when no thumbnail exists; same availability rules as `url`.

Next