Ricky logorickyDocs

Upload a header sample

POST
/templates/media

An image, video or document header needs a sample file Meta reviews. Uploading it takes three steps: this call answers an upload_url; PUT the bytes there; then POST /templates/media/complete answers the handle for header.handle.

Scope: templates:write.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An organization API key, rky_live_…, created in Settings → API. Send it only from a server.

Idempotency-Key?string

Optional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as order-10482-ready. Retrying with the same key and body replays the first response instead of repeating the write.

Length8 <= length <= 200

Request Body

application/json
  1. body

Begins the upload of a header sample. Ricky answers where to PUT the bytes.

channel_id*string

WhatsApp channel whose business account will use the sample.

Formatuuid
mime_type*string

JPEG or PNG up to 5 MB for an IMAGE header, MP4 or 3GPP up to 16 MB for VIDEO, PDF up to 100 MB for DOCUMENT.

Value in"image/jpeg""image/png""video/mp4""video/3gpp""application/pdf"
size_bytes*integer

Exact size of the file you will upload.

Range1 <= value <= 9007199254740991

Response Body

Success.

application/json
  1. response
data*

Where to put the bytes of a file Ricky forwards to Meta.

curl -X POST 'https://getricky.ai/api/v1/templates/media' \  -H 'Idempotency-Key: order-10482-ready' \  -H 'Content-Type: application/json' \  -d '{  "channel_id": "8f3c2a5e-6b1d-4c7a-9e2f-1a2b3c4d5e6f",  "mime_type": "image/jpeg",  "size_bytes": 182044}'
{  "data": {    "upload_path": "d9e0f1a2-b3c4-4d5e-8f6a-7b8c9d0e1f2a/template-samples/8f3c2a5e-6b1d-4c7a-9e2f-1a2b3c4d5e6f/2d4f6a8c-1b3d-4e5f-8a7b-9c0d1e2f3a4b/6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f.jpg",    "upload_url": "https://storage.example.com/upload/sign/media/…?token=…"  }}