Skip to main content

UploadMediaResponse

media_idstring<uuid>

Use this ID when calling POST /media/{id}/complete and when attaching to posts via media_ids

upload_urlstring

Presigned URL to upload your file to

upload_method object

How to upload the file to upload_url

methodstring

HTTP method to use

Possible values: [PUT, POST]

content_typestring

Content-Type header to set (for PUT) or multipart/form-data (for POST)

field_namestring

Form field name (only for POST/multipart uploads)

headers object

Headers to include with the upload request (for PUT uploads)

property name*string
providerstring

Storage provider used for this upload

Possible values: [cloudflare_images, r2]

expires_ininteger

Seconds until the upload URL expires

Example: 3600
max_sizeinteger

Maximum file size in bytes

next_stepstring

Instructions for what to do after uploading

Example: Upload your file to upload_url, then call POST /media/{media_id}/complete to finalize.
UploadMediaResponse
{
"media_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"upload_url": "string",
"upload_method": {
"method": "PUT",
"content_type": "string",
"field_name": "string",
"headers": {}
},
"provider": "cloudflare_images",
"expires_in": 3600,
"max_size": 0,
"next_step": "Upload your file to upload_url, then call POST /media/{media_id}/complete to finalize."
}