Bulk queue idempotency: header or body key, and the header wins
A Sume bulk queue takes an Idempotency-Key as a header or as a body idempotency_key. If you send both, the header wins. Replays return 202 with the old queue.

On a Sume bulk queue you can send the idempotency key as the Idempotency-Key header or as idempotency_key in the body. If you send both, the header wins and the body value is ignored. The key is scoped to one Format, so the same string on a different Format makes a different queue.
This is read from the idempotency section of Bulk runs (read 2026-10-06). It matters in a Black Friday week because a batch script that retries on a timeout must never create a second queue of paid videos.
What happens when I send the same key twice?
A replay of the same key with the same { concurrency, items } returns 202 and the queue that already exists. A bulk replay stays 202, unlike a single run, and the queue object has no idempotency_hit field, so you tell a replay from a new queue by comparing the queue id you stored.
| You send | Result |
|---|---|
| Same key, same concurrency and items | 202 and the existing queue |
| Same key, different concurrency or items | 409 idempotency_conflict, details.queue_id names the original |
| New key, same items | A new queue, and new billable runs |
Which one should a script use?
Use the header. It is the form every other Sume write uses, and it wins in a conflict, so a body field left over from a template can never override it.
- Mint one key per batch, not one per retry, and store it with the queue id.
- Do not reuse a key after you change an item. Change the key with the batch, or you get the
409. - There is no queue-level idempotency lock beyond the stored key, and no queue-level webhook.
curl -sS -X POST "https://api.sume.com/v1/formats/yourhandle/gift-guide/bulk-runs" \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: gift-guide-nov-batch-1" \
-d '{
"idempotency_key": "this-body-value-is-ignored",
"concurrency": 2,
"items": [
{ "instruction": "Gifts under 25 dollars" },
{ "instruction": "Gifts for a host" }
]
}'What do I do after a 409?
Read details.queue_id from the error. It names the queue that first used that key, so you can poll it instead of creating a new one. If you really meant a different batch, send a new key.
Sources
Related posts
More in Use cases
- Insert a sponsor read into a podcast: TTS plus one audio concat
Generate the ad read with Sume TTS, then join it into the episode at the second you choose with one Timeline audio concat: sample-exact, $0.01 per join.
- Instagram Live ad clip: burn an offer line with caption cues
Add a timed offer line to a Live replay clip with POST /v1/video-captions and cues, no speech needed. Sume bills $0.20 per clip up to 60 seconds.
- Instagram Live Ads promo: make a 9:16 teaser clip with Sume
Instagram Live Ads started a general rollout on 2026-09-29. Make the 9:16 teaser that sends people to the stream with POST /v1/videos, 3 to 10 seconds.
- Is a 4:5 or 3:4 video a YouTube Short? Render 1080x1350 or 1080x1440
YouTube says Shorts are square or vertical, up to 3 minutes. 4:5 and 3:4 are taller than wide; render them as 1080x1350 or 1080x1440 with Sume Timeline.
Written by Sume