Skip to content

Manage stickers over the API

This guide walks through two tasks: making a sticker and saving it, and sending one. Every path starts with /v1/accounts/{accountId}. The full list of routes and fields is in the HTTP API reference. Reads need the media scope. Changes and sends need send.

Prepare, review and save

  1. Upload the image, GIF or video to /uploads as multipart form data. The response has an id; pass it as sourceId in the next step. Images and GIFs can be up to 64 MiB. Videos can be up to 512 MiB.

  2. Prepare the sticker. Send the Idempotency-Key header with the request:

    {"sourceId": "SOURCE_ID", "maxEdge": 360, "fps": 12, "trim": {"startMs": 1000, "durationMs": 2000}}
    FieldUse it to
    trimKeep one segment, in milliseconds
    fitShrink a larger image or GIF to fit the 1024-pixel sticker limit
    maxEdgeSet the longest edge, from 16 to 1024 pixels. It never enlarges.
    fpsSet the frame rate for a video source, from 1 to 30

    The request returns 202 with a job. Poll GET /sticker-preparations/{id} until it completes. The result links to the original, a preview and sampled frames.

  3. Look at the preview and frames. If they are right, save the preparation:

    {"source": {"kind": "prepared", "preparationId": "PREPARATION_ID"}}

    Send this as POST /custom-stickers with an Idempotency-Key header. To save a sticker you received instead, use {"kind": "message", "messageId": "MESSAGE_ID", "assetId": "ASSET_ID"}. Its original must already be downloaded and verified.

  4. When you no longer need the upload, delete it with DELETE /uploads/{sourceId}. It returns {"released": true}. If a preparation or send still uses the upload, you get 409 upload_in_use instead.

Reorder and remove Saved stickers

PATCH /custom-stickers/{id} moves a sticker, and DELETE /custom-stickers/{id} removes it from Saved. Both need an Idempotency-Key and an If-Match header with the collection revision from your latest list read. Send {"position": {"afterId": "OTHER_ID"}} to move an item after another one. Use null to put it first.

A missing If-Match returns 428. A stale revision returns 412 with the current revision. Read the list again and retry.

Send a selection

Send a sticker with POST /sends, using the same Idempotency-Key pattern as other sends:

{
"kind": "sticker",
"threadId": "CHAT_ID",
"source": {"kind": "pack", "packId": "PACK_ID", "stickerId": "STICKER_ID"}
}

Use {"kind": "saved", "stickerId": "STICKER_ID"} to send from Saved, or {"kind": "prepared", "preparationId": "PREPARATION_ID"} to send a preparation directly. Sends revalidate the original first and keep GIF, PNG, JPEG and WXGF bytes in their original format. When a Saved sticker has no supported cached original, a send can fetch it from its CDN URL. A pack source must already be in the account’s added packs. Add a pack with PUT /sticker-packs/{id}/membership. A send does not add the sticker to Saved.

Listen to the event stream for sticker-collections.changed, and refresh the sticker picker when it arrives. You do not need to poll the lists.