Skip to main content
The Media API converts images on demand. You upload an original, ask for a conversion, and download the result. Save the settings you use often as conversion presets.

Conversion flow

1

Request a conversion

Call POST /v1/image-conversions with the original’s filename. The response returns an id and a signed uploadUrl.
2

Upload the original

Send the file with PUT to uploadUrl and the header x-ms-blob-type: BlockBlob. The file goes straight to Azure Blob Storage.
3

Queue the conversion

Call POST /v1/image-conversions/{id}/convert with parameters, or with the id of a preset as preset. The response returns a job, and the Location header holds its URL.
4

Read the result

Call GET /v1/image-conversions/jobs/{jobId} every 1–2 seconds. When status is Completed, download the image from result.url. When it is Failed, error says why.
Upload links and download links are valid for 1 hour. Occtoo deletes originals and converted images after one day.

Conversion parameters

Conversion presets

A preset saves parameters under an id, so you can convert with preset instead of sending the parameters each time. Manage presets under /v1/conversion-presets.
  • id starts with a lowercase letter and can contain lowercase letters, digits, _, and -, up to 64 characters. You cannot change it.
  • version starts at 1 and goes up by one when parameters change.
  • You cannot delete a preset that a card definition uses. The request returns 409.

Authentication

The tenant comes from the credential. Send an Application access token as Authorization: Bearer <token>, or an organization API key as x-api-key.

Errors

A failed conversion is not an error response. Reading its job returns 200 with status set to Failed. Errors use Problem Details (application/problem+json). Retry 500 with exponential backoff. A convert call that returned 500 may still have queued the conversion.