This guide explains how to use the Idempotency-Key header on the Create Bot endpoint to safely retry requests without creating duplicate bots.
Scope: This feature is currently supported only on
POST /api/v1/bots/create_bot(bot creation). Other write endpoints (PATCH scheduled bots, remove bot, etc.) do not honorIdempotency-Keyyet.
When you call the Create Bot API, several real-world conditions can cause your client to retry the same request:
Without idempotency, every one of these retries would create a new bot — and you’d end up with two, three, or more bots in the same meeting, each consuming credits.
Idempotency-Key solves this: MeetStream remembers the key you sent, ties it to the bot that got created, and replays the original bot’s details on every subsequent retry — never creating a duplicate.
You generate a unique string per logical bot creation (a UUID is ideal) and pass it in the Idempotency-Key HTTP header. The first request with that key creates a bot normally and returns HTTP 201. Every subsequent request that sends the same key from the same API key/user returns HTTP 507 with the original bot’s details — the request body is ignored, no new bot is created, no credits are charged again.
Keys are scoped per user (the API key owner). The same key value sent by two different MeetStream accounts will not collide.
Response (HTTP 201):
Response (HTTP 507):
The bot ID and meeting URL match the original. No new bot was created. No credits were charged. The status field reflects the bot’s status at the time of the replay — so if the bot has progressed from Joining to Active between calls, you’ll see the latest state.
Header rules:
Idempotency-Key and idempotency-key are accepted. (REST API Gateway preserves casing, HTTP API lowercases — MeetStream handles both.)9b1c3f4a-7e2b-4d8f-9a1c-2e6f4b8a0c11) is the canonical choice.If you omit the header, the endpoint behaves exactly as before — every call creates a new bot.
Why
transcript_idisnullon replay: the transcript ID is generated and returned only at original creation time. If you need it later, fetch it from the bot detail endpoint using thebot_id.
(user_id, idempotency_key) pair is bound to a bot, every future request with that pair replays the original bot — forever.meeting_link, bot_name, or any other field but send the same key, you still get the original bot back. To create a different bot, use a different key.uuid.uuid4() (Python), crypto.randomUUID() (Node), UUID.randomUUID() (Java), etc.507 as success. Parse the body and proceed as if you’d just created the bot.bot_id returned by MeetStream for tracking and lookups.requests and tenacity)Key points:
idempotency_key is generated once, outside the retry decorator, so all retries share the same key.201 and 507 are treated as success.5xx triggers a retry; 4xx errors fail fast (no point retrying a validation error).axios and axios-retry)If you’re creating bots in response to a queue message (SQS, Kafka, BullMQ, Sidekiq, etc.), generate and persist the idempotency key when the message is first written, not when the worker picks it up:
If the worker crashes after the HTTP call but before acking the message, the queue redelivers the same job — but the same key replays the original bot. No duplicate.
Q: Does the idempotency key work for scheduled bots (join_at in the future)?
A: Yes. Idempotency-Key is honored on every call to POST /api/v1/bots/create_bot, including scheduled-bot creations. A retry returns the same scheduled bot’s details.
Q: What happens if I send Idempotency-Key but no Authorization header?
A: The request is rejected at the auth layer before idempotency is evaluated. No key is bound.
Q: Can I look up a bot by its idempotency key later?
A: Not via a dedicated endpoint. The intended use is retry safety, not as a public lookup key. Use the bot_id returned in the response to fetch bot details.
Q: Are keys deleted when a bot is deleted? A: The key lives on the bot record. If the bot record is deleted, the key is gone with it and the same key could be reused. Best practice is still to never reuse keys — always generate a fresh UUID.
Q: Does idempotency-key affect billing?
A: A 507 replay does not charge credits — only the original 201 creation did. Failed creates (4xx/5xx) also don’t charge.
Q: What if my client sends the header with a value of null or an empty string?
A: That’s treated as if the header was absent. Every call creates a new bot.
Q: Is there a maximum number of bots I can bind to one key? A: One. A key maps to exactly one bot. After that, every future request with that key replays that one bot.
POST /api/v1/bots/create_bot.