Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Transform Media Item

POST/api/v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Initiates a transformation on a media item. Returns a job ID that can be used to check the status and retrieve the result of the transformation.

Transforming a media item requires that you are able to read the media item, either via api:mediasets-read or via a MediaItemReadToken

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:mediasets-transform.

Path parameters

mediaSetRid
string

The RID of the media set.

mediaItemRid
string

The RID of the media item.

Query parameters

preview
boolean
optional

A boolean flag that, when set to true, enables the use of beta features in preview mode.

Request body

TransformMediaItemRequest
object

Request to transform a media item.

Hide child attributes

Hide child attributes

transformation
union

A transformation to apply to a media item. Each variant specifies the type of transformation and any parameters required for the operation.

Show child attributes

Show child attributes

Response body

TransformMediaItemResponse
object

The transformation was initiated successfully.

Hide child attributes

Hide child attributes

status
string (enum)

The status of a transformation job.

Enum values: PENDING, FAILED, SUCCESSFUL

jobId
string

An identifier for a media item transformation job.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform?preview=true" \ -d '{"transformation":{"type":"image","encoding":{"type":"webp"},"operations":[{"type":"resize","width":800,"height":600}]}}'