Media

Create a media object

Creates the media object in the pending state and returns it with the upload instruction; URL, method, and headers; for putting its bytes into storage.

POST
/v1/media

Creates the media object in the pending state and returns it with the upload instruction — URL, method, and headers — for putting its bytes into storage.

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

filename*string
Length1 <= length <= 255
contentType*string
Length1 <= length <= 127
sizeBytes*integer
Range0 < value <= 26214400
purpose*string

Value in

  • "attachment"
  • "avatar"
  • "review_evidence"
checksumSha256?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/media" \  -H "Content-Type: application/json" \  -d '{    "filename": "string",    "contentType": "string",    "sizeBytes": 1,    "purpose": "attachment"  }'
{  "id": "string",  "organizationId": "string",  "status": "pending",  "filename": "string",  "contentType": "string",  "sizeBytes": 0,  "width": 1,  "height": 1,  "durationMs": 0,  "purpose": "attachment",  "checksumSha256": "string",  "expiresAt": "string",  "createdAt": "string",  "confirmedAt": "string",  "upload": {    "url": "string",    "method": "PUT",    "headers": {      "property1": "string",      "property2": "string"    },    "expiresAt": "string"  }}

Related documentation