{
"error": {
"type": "invalid_request",
"message": "limit must be between 1 and 100.",
"hint": "Pass limit between 1 and 100 (default 20), and page with after or before.",
"doc_url": "https://api.flow.engineer/docs/errors/invalid_request",
"param": "limit"
}
}
{
"error": {
"type": "authentication",
"message": "No valid API key was given.",
"hint": "Send the header Authorization: Bearer fk_test_... (or fk_live_...); no key yet? Get a test key with curl -X POST https://api.flow.engineer/v0/sandbox/keys",
"doc_url": "https://api.flow.engineer/docs/errors/authentication"
}
}
{
"error": {
"type": "permission",
"message": "This account handles health information under a business associate agreement, and Telegram is not a channel Flow holds such an agreement for, so it cannot be simulated here either.",
"hint": "Simulate an SMS conversation instead: POST /v0/test/conversations with {\"channel\":\"sms\"}.",
"doc_url": "https://api.flow.engineer/docs/errors/permission",
"param": "channel",
"channel_code": "hipaa_channel_not_covered"
}
}
{
"error": {
"type": "idempotency_conflict",
"message": "This Idempotency-Key was already used for a different request (another method, path or body).",
"hint": "Use a new Idempotency-Key for this request; reuse a key only to repeat the identical request.",
"doc_url": "https://api.flow.engineer/docs/errors/idempotency_conflict",
"param": "Idempotency-Key",
"channel_code": "body_mismatch"
}
}
{
"error": {
"type": "invalid_request",
"message": "The request body is larger than 33554432 bytes.",
"hint": "Send a smaller body; upload media with POST /v0/files and send its file_id instead of inlining it.",
"doc_url": "https://api.flow.engineer/docs/errors/invalid_request"
}
}
{
"error": {
"type": "new_contact_limit",
"message": "This sender has started its 15 new conversations for today.",
"hint": "Retry after 3600 seconds; replies into existing conversations still go.",
"doc_url": "https://api.flow.engineer/docs/errors/new_contact_limit",
"retry_after": 3600,
"sender": "snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"
}
}
Test keys only. Creates a conversation with a simulated contact, an end
user that exists only inside Flow, so an agent or a test suite can play the
person’s side with no phone and no real channel. Write as the contact with
POST /v0/test/conversations/{conversation_id}/inbound; your agent receives
each turn exactly like a real message.received and replies with its normal
send. Read both sides with GET /v0/test/conversations/{conversation_id}/transcript.
The conversation is on your app’s simulated sender for the channel
(kindsimulated), which Flow creates on first use. It never touches a
network: sends to the simulated contact pass the real send gate and end
sent. Simulated channels: telegram, whatsapp, imessage and sms.
The channel’s rules hold as on a real sender: a simulated iMessage line,
like Flow’s lines today, only replies, so the contact writes first; a
simulated Telegram bot, like a real one, cannot write to a contact who has
not written to it, so a send before the contact’s first turn is accepted
(202) and then fails as it does on real Telegram (message.failed,
channel_error, channel_code403); on SMS
and iMessage a buttons message answers 422 unsupported_content, as on a
real line.
On WhatsApp, the contact’s turns go through the real WhatsApp inbound path,
so each turn opens the 24-hour window. Outside it, including before the
contact’s first turn, only a template can be sent (409 outside_window).
Buttons take up to 3 reply buttons (a list up to 10 rows); reactions and
reply_to work; edits and unsends answer 422 unsupported_content.
On SMS, the rules that concern the contact hold too. Before the contact’s
first turn, a send to them is a start that needs their recorded consent:
without consent (on POST /v0/messages with to.contact), it answers
403 permission with channel_codeconsent_required, as a real SMS start
does. A turn with the text STOP opts the contact out and START lifts it (see
POST /v0/test/conversations/{conversation_id}/inbound). A simulated SMS
sender keeps no quiet hours, so a test’s outcome never depends on the time of
day, and it sends media and voice as MMS.
Creating the conversation sends no event. The conversation starts with its
first message: the contact’s first turn (viainbound), or your first send
to the contact, such as a WhatsApp template or an SMS send with consent
(viaoutbound). conversation.started comes before that message’s
message.received or message.sent.
On iMessage, group makes a simulated group conversation instead (typegroup, with the participants as simulated contacts), so you can test how
your agent handles groups: each turn names its writer in from, and the
gate applies the group rules (reactions refused with channel_codegroup_unsupported, as are typing and read receipts). Each call with
group makes a new group.
Give contact to choose the simulated contact’s address; giving an address
that already has a simulated conversation returns that conversation (200).
Without contact, Flow makes a new contact with a made-up address (phone
numbers start +1555), so each call is a fresh conversation, for example one
per test case. Simulated contacts never match real ones, even with the same
address.
Simulated traffic is free: it does not count against the sandbox allowance.
An app has at most 500 simulated conversations: past that, a new one answers
403 permission with channel_codesimulated_conversation_limit (an
address that has one still returns it with 200), so reuse conversations
across test runs. The /v0/test/ endpoints take at most 120 requests a
minute per key (429 rate_limited), on top of the plan’s request rate
limit. A live key answers 403 permission with channel_codetest_mode_only.
A HIPAA account (Account.hipaa) can simulate only the channels its
business associate agreement covers (SMS), as it can connect senders only
there: telegram, whatsapp or imessage answers 403 permission with
channel_codehipaa_channel_not_covered (paramchannel).
{
"error": {
"type": "invalid_request",
"message": "limit must be between 1 and 100.",
"hint": "Pass limit between 1 and 100 (default 20), and page with after or before.",
"doc_url": "https://api.flow.engineer/docs/errors/invalid_request",
"param": "limit"
}
}
{
"error": {
"type": "authentication",
"message": "No valid API key was given.",
"hint": "Send the header Authorization: Bearer fk_test_... (or fk_live_...); no key yet? Get a test key with curl -X POST https://api.flow.engineer/v0/sandbox/keys",
"doc_url": "https://api.flow.engineer/docs/errors/authentication"
}
}
{
"error": {
"type": "permission",
"message": "This account handles health information under a business associate agreement, and Telegram is not a channel Flow holds such an agreement for, so it cannot be simulated here either.",
"hint": "Simulate an SMS conversation instead: POST /v0/test/conversations with {\"channel\":\"sms\"}.",
"doc_url": "https://api.flow.engineer/docs/errors/permission",
"param": "channel",
"channel_code": "hipaa_channel_not_covered"
}
}
{
"error": {
"type": "idempotency_conflict",
"message": "This Idempotency-Key was already used for a different request (another method, path or body).",
"hint": "Use a new Idempotency-Key for this request; reuse a key only to repeat the identical request.",
"doc_url": "https://api.flow.engineer/docs/errors/idempotency_conflict",
"param": "Idempotency-Key",
"channel_code": "body_mismatch"
}
}
{
"error": {
"type": "invalid_request",
"message": "The request body is larger than 33554432 bytes.",
"hint": "Send a smaller body; upload media with POST /v0/files and send its file_id instead of inlining it.",
"doc_url": "https://api.flow.engineer/docs/errors/invalid_request"
}
}
{
"error": {
"type": "new_contact_limit",
"message": "This sender has started its 15 new conversations for today.",
"hint": "Retry after 3600 seconds; replies into existing conversations still go.",
"doc_url": "https://api.flow.engineer/docs/errors/new_contact_limit",
"retry_after": 3600,
"sender": "snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"
}
}
An API key of one app, sent as Authorization: Bearer <key>. Keys start with
fk_test_ (test mode: sandbox senders and test data only) or fk_live_
(live mode). Keep live keys on your server; never ship them in an app or page.
A unique string (up to 255 characters) that makes this request safe to retry.
A repeat with the same key within 24 hours returns the first answer instead of
acting again. See "Idempotency" in the introduction.
The simulated contact's address on the channel. Give one field that fits the
channel: phone on SMS, iMessage and WhatsApp, handle on iMessage,
telegram_user_id on Telegram. Omit contact to get a new contact with a made-up address.
imessage only: make a simulated group conversation (typegroup)
instead of a one-to-one one, with these participants. Not with contact
or name. Each turn names the participant who writes (from on
POST /v0/test/conversations/{conversation_id}/inbound). Another channel
answers 400 invalid_request with paramgroup.
Show child attributes
Response
The contact's simulated conversation already existed; it is returned as is.
One sender talking with one contact (typedirect), or with an iMessage
group chat (typegroup). Holds the window state and whether the contact
opted in.
Whether the contact has agreed to receive messages (wrote first, joined the sandbox, or you recorded consent). Always true on group conversations, which begin with the group writing.
Flow always sends it; read a missing one as direct (answers from
before groups existed). direct: one sender and one contact (every
channel). group: a group chat
one of your dedicated iMessage lines was added to; it has group and no
contact. Flow's shared iMessage line ignores group chats, so they never
reach your app from it.
Group conversations only (iMessage): the group chat as Flow saw it last.
People who join or leave change participants without an event; Flow
updates the list when the group next writes. The channel's own group ID is
never exposed: use the conversation's ID.
Up to 20 string pairs of your own, kept with the object and returned unchanged. Keys up to 40 characters, values up to 500.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Flow","description":"Build for every chat interface with Flow Framework, or connect your agent through the Unified Messaging API.","colors":{"primary":"#0b7a5a","light":"#3cc497","dark":"#0b7a5a"},"api":{"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","javascript","python","go"]}},"navbar":{"links":[{"href":"https://flow.engineer","label":"Website"},{"href":"https://github.com/flow-engineer/sdk","label":"Messaging SDKs"}],"primary":{"type":"button","label":"GitHub","href":"https://github.com/flow-engineer/flow"}},"footer":{"socials":{"github":"https://github.com/flow-engineer/flow","website":"https://flow.engineer"}},"search":{"prompt":"Search Flow docs"},"seo":{"indexing":"navigable"},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"flow-messaging","hasAudioNarration":false,"actualSubdomain":"flow-messaging","customDomains":["docs.flow.engineer"],"gitSource":{"type":"github","owner":"flow-engineer","repo":"docs","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6ada57ce640382e777556fe3"},"chroma":{"latestBuiltDeploymentHistoryId":"6adcda2f2673ac6bc7cb84b8","collectionId":"13fc76e6-8ba2-4c4a-a3f9-68b8b26261dc","liveDeploymentHistoryId":"6adcda2f2673ac6bc7cb84b8","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6addc044fbe3b121222676b9","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"Messaging API","count":100},{"language":"default","tag":"HTTP API","count":64},{"language":"default","tag":"Framework","count":27},{"language":"default","tag":"Messages","count":14},{"language":"default","tag":"Errors","count":14},{"language":"default","tag":"Ship to","count":13},{"language":"default","tag":"Concepts","count":11},{"language":"default","tag":"Get started","count":10},{"language":"default","tag":"Senders and templates","count":8},{"language":"default","tag":"Webhook endpoints","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/testing/create-a-simulated-conversation","slug":"/api-reference/testing/create-a-simulated-conversation","pageMetadata":{"openapi":"unified-messaging-api/openapi.yaml POST /v0/test/conversations","title":"Create a simulated conversation","description":"Test keys only. Creates a conversation with a **simulated contact**, an end\nuser that exists only inside Flow, so an agent or a test suite can play the\nperson's side with no phone and no real channel. Write as the contact with\n`POST /v0/test/conversations/{conversation_id}/inbound`; your agent receives\neach turn exactly like a real `message.received` and replies with its normal\nsend. Read both sides with `GET /v0/test/conversations/{conversation_id}/transcript`.\n\nThe conversation is on your app's **simulated sender** for the channel\n(`kind` `simulated`), which Flow creates on first use. It never touches a\nnetwork: sends to the simulated contact pass the real send gate and end\n`sent`. Simulated channels: `telegram`, `whatsapp`, `imessage` and `sms`.\nThe channel's rules hold as on a real sender: a simulated iMessage line,\nlike Flow's lines today, only replies, so the contact writes first; a\nsimulated Telegram bot, like a real one, cannot write to a contact who has\nnot written to it, so a send before the contact's first turn is accepted\n(`202`) and then fails as it does on real Telegram (`message.failed`,\n`channel_error`, `channel_code` `403`); on SMS\nand iMessage a buttons message answers `422 unsupported_content`, as on a\nreal line.\n\nOn WhatsApp, the contact's turns go through the real WhatsApp inbound path,\nso each turn opens the 24-hour window. Outside it, including before the\ncontact's first turn, only a `template` can be sent (`409 outside_window`).\nButtons take up to 3 reply buttons (a `list` up to 10 rows); reactions and\n`reply_to` work; edits and unsends answer `422 unsupported_content`.\n\nOn SMS, the rules that concern the contact hold too. Before the contact's\nfirst turn, a send to them is a start that needs their recorded consent:\nwithout `consent` (on `POST /v0/messages` with `to.contact`), it answers\n`403 permission` with `channel_code` `consent_required`, as a real SMS start\ndoes. A turn with the text STOP opts the contact out and START lifts it (see\n`POST /v0/test/conversations/{conversation_id}/inbound`). A simulated SMS\nsender keeps no quiet hours, so a test's outcome never depends on the time of\nday, and it sends media and voice as MMS.\n\nCreating the conversation sends no event. The conversation starts with its\nfirst message: the contact's first turn (`via` `inbound`), or your first send\nto the contact, such as a WhatsApp template or an SMS send with consent\n(`via` `outbound`). `conversation.started` comes before that message's\n`message.received` or `message.sent`.\n\nOn iMessage, `group` makes a simulated group conversation instead (`type`\n`group`, with the participants as simulated contacts), so you can test how\nyour agent handles groups: each turn names its writer in `from`, and the\ngate applies the group rules (reactions refused with `channel_code`\n`group_unsupported`, as are typing and read receipts). Each call with\n`group` makes a new group.\n\nGive `contact` to choose the simulated contact's address; giving an address\nthat already has a simulated conversation returns that conversation (`200`).\nWithout `contact`, Flow makes a new contact with a made-up address (phone\nnumbers start `+1555`), so each call is a fresh conversation, for example one\nper test case. Simulated contacts never match real ones, even with the same\naddress.\n\nSimulated traffic is free: it does not count against the sandbox allowance.\nAn app has at most 500 simulated conversations: past that, a new one answers\n`403 permission` with `channel_code` `simulated_conversation_limit` (an\naddress that has one still returns it with `200`), so reuse conversations\nacross test runs. The `/v0/test/` endpoints take at most 120 requests a\nminute per key (`429 rate_limited`), on top of the plan's request rate\nlimit. A live key answers `403 permission` with `channel_code`\n`test_mode_only`.\n\nA HIPAA account (`Account.hipaa`) can simulate only the channels its\nbusiness associate agreement covers (SMS), as it can connect senders only\nthere: `telegram`, `whatsapp` or `imessage` answers `403 permission` with\n`channel_code` `hipaa_channel_not_covered` (`param` `channel`).\n","href":"/api-reference/testing/create-a-simulated-conversation"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Test keys only. Creates a conversation with a \", _jsx(_components.strong, {\n children: \"simulated contact\"\n }), \", an end\\nuser that exists only inside Flow, so an agent or a test suite can play the\\nperson’s side with no phone and no real channel. Write as the contact with\\n\", _jsx(_components.code, {\n children: \"POST /v0/test/conversations/{conversation_id}/inbound\"\n }), \"; your agent receives\\neach turn exactly like a real \", _jsx(_components.code, {\n children: \"message.received\"\n }), \" and replies with its normal\\nsend. Read both sides with \", _jsx(_components.code, {\n children: \"GET /v0/test/conversations/{conversation_id}/transcript\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The conversation is on your app’s \", _jsx(_components.strong, {\n children: \"simulated sender\"\n }), \" for the channel\\n(\", _jsx(_components.code, {\n children: \"kind\"\n }), \" \", _jsx(_components.code, {\n children: \"simulated\"\n }), \"), which Flow creates on first use. It never touches a\\nnetwork: sends to the simulated contact pass the real send gate and end\\n\", _jsx(_components.code, {\n children: \"sent\"\n }), \". Simulated channels: \", _jsx(_components.code, {\n children: \"telegram\"\n }), \", \", _jsx(_components.code, {\n children: \"whatsapp\"\n }), \", \", _jsx(_components.code, {\n children: \"imessage\"\n }), \" and \", _jsx(_components.code, {\n children: \"sms\"\n }), \".\\nThe channel’s rules hold as on a real sender: a simulated iMessage line,\\nlike Flow’s lines today, only replies, so the contact writes first; a\\nsimulated Telegram bot, like a real one, cannot write to a contact who has\\nnot written to it, so a send before the contact’s first turn is accepted\\n(\", _jsx(_components.code, {\n children: \"202\"\n }), \") and then fails as it does on real Telegram (\", _jsx(_components.code, {\n children: \"message.failed\"\n }), \",\\n\", _jsx(_components.code, {\n children: \"channel_error\"\n }), \", \", _jsx(_components.code, {\n children: \"channel_code\"\n }), \" \", _jsx(_components.code, {\n children: \"403\"\n }), \"); on SMS\\nand iMessage a buttons message answers \", _jsx(_components.code, {\n children: \"422 unsupported_content\"\n }), \", as on a\\nreal line.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"On WhatsApp, the contact’s turns go through the real WhatsApp inbound path,\\nso each turn opens the 24-hour window. Outside it, including before the\\ncontact’s first turn, only a \", _jsx(_components.code, {\n children: \"template\"\n }), \" can be sent (\", _jsx(_components.code, {\n children: \"409 outside_window\"\n }), \").\\nButtons take up to 3 reply buttons (a \", _jsx(_components.code, {\n children: \"list\"\n }), \" up to 10 rows); reactions and\\n\", _jsx(_components.code, {\n children: \"reply_to\"\n }), \" work; edits and unsends answer \", _jsx(_components.code, {\n children: \"422 unsupported_content\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"On SMS, the rules that concern the contact hold too. Before the contact’s\\nfirst turn, a send to them is a start that needs their recorded consent:\\nwithout \", _jsx(_components.code, {\n children: \"consent\"\n }), \" (on \", _jsx(_components.code, {\n children: \"POST /v0/messages\"\n }), \" with \", _jsx(_components.code, {\n children: \"to.contact\"\n }), \"), it answers\\n\", _jsx(_components.code, {\n children: \"403 permission\"\n }), \" with \", _jsx(_components.code, {\n children: \"channel_code\"\n }), \" \", _jsx(_components.code, {\n children: \"consent_required\"\n }), \", as a real SMS start\\ndoes. A turn with the text STOP opts the contact out and START lifts it (see\\n\", _jsx(_components.code, {\n children: \"POST /v0/test/conversations/{conversation_id}/inbound\"\n }), \"). A simulated SMS\\nsender keeps no quiet hours, so a test’s outcome never depends on the time of\\nday, and it sends media and voice as MMS.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Creating the conversation sends no event. The conversation starts with its\\nfirst message: the contact’s first turn (\", _jsx(_components.code, {\n children: \"via\"\n }), \" \", _jsx(_components.code, {\n children: \"inbound\"\n }), \"), or your first send\\nto the contact, such as a WhatsApp template or an SMS send with consent\\n(\", _jsx(_components.code, {\n children: \"via\"\n }), \" \", _jsx(_components.code, {\n children: \"outbound\"\n }), \"). \", _jsx(_components.code, {\n children: \"conversation.started\"\n }), \" comes before that message’s\\n\", _jsx(_components.code, {\n children: \"message.received\"\n }), \" or \", _jsx(_components.code, {\n children: \"message.sent\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"On iMessage, \", _jsx(_components.code, {\n children: \"group\"\n }), \" makes a simulated group conversation instead (\", _jsx(_components.code, {\n children: \"type\"\n }), \"\\n\", _jsx(_components.code, {\n children: \"group\"\n }), \", with the participants as simulated contacts), so you can test how\\nyour agent handles groups: each turn names its writer in \", _jsx(_components.code, {\n children: \"from\"\n }), \", and the\\ngate applies the group rules (reactions refused with \", _jsx(_components.code, {\n children: \"channel_code\"\n }), \"\\n\", _jsx(_components.code, {\n children: \"group_unsupported\"\n }), \", as are typing and read receipts). Each call with\\n\", _jsx(_components.code, {\n children: \"group\"\n }), \" makes a new group.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Give \", _jsx(_components.code, {\n children: \"contact\"\n }), \" to choose the simulated contact’s address; giving an address\\nthat already has a simulated conversation returns that conversation (\", _jsx(_components.code, {\n children: \"200\"\n }), \").\\nWithout \", _jsx(_components.code, {\n children: \"contact\"\n }), \", Flow makes a new contact with a made-up address (phone\\nnumbers start \", _jsx(_components.code, {\n children: \"+1555\"\n }), \"), so each call is a fresh conversation, for example one\\nper test case. Simulated contacts never match real ones, even with the same\\naddress.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Simulated traffic is free: it does not count against the sandbox allowance.\\nAn app has at most 500 simulated conversations: past that, a new one answers\\n\", _jsx(_components.code, {\n children: \"403 permission\"\n }), \" with \", _jsx(_components.code, {\n children: \"channel_code\"\n }), \" \", _jsx(_components.code, {\n children: \"simulated_conversation_limit\"\n }), \" (an\\naddress that has one still returns it with \", _jsx(_components.code, {\n children: \"200\"\n }), \"), so reuse conversations\\nacross test runs. The \", _jsx(_components.code, {\n children: \"/v0/test/\"\n }), \" endpoints take at most 120 requests a\\nminute per key (\", _jsx(_components.code, {\n children: \"429 rate_limited\"\n }), \"), on top of the plan’s request rate\\nlimit. A live key answers \", _jsx(_components.code, {\n children: \"403 permission\"\n }), \" with \", _jsx(_components.code, {\n children: \"channel_code\"\n }), \"\\n\", _jsx(_components.code, {\n children: \"test_mode_only\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"A HIPAA account (\", _jsx(_components.code, {\n children: \"Account.hipaa\"\n }), \") can simulate only the channels its\\nbusiness associate agreement covers (SMS), as it can connect senders only\\nthere: \", _jsx(_components.code, {\n children: \"telegram\"\n }), \", \", _jsx(_components.code, {\n children: \"whatsapp\"\n }), \" or \", _jsx(_components.code, {\n children: \"imessage\"\n }), \" answers \", _jsx(_components.code, {\n children: \"403 permission\"\n }), \" with\\n\", _jsx(_components.code, {\n children: \"channel_code\"\n }), \" \", _jsx(_components.code, {\n children: \"hipaa_channel_not_covered\"\n }), \" (\", _jsx(_components.code, {\n children: \"param\"\n }), \" \", _jsx(_components.code, {\n children: \"channel\"\n }), \").\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"unified-messaging-api/openapi.yaml POST /v0/test/conversations","title":"Create a simulated conversation","description":"Test keys only. Creates a conversation with a **simulated contact**, an end\nuser that exists only inside Flow, so an agent or a test suite can play the\nperson's side with no phone and no real channel. Write as the contact with\n`POST /v0/test/conversations/{conversation_id}/inbound`; your agent receives\neach turn exactly like a real `message.received` and replies with its normal\nsend. Read both sides with `GET /v0/test/conversations/{conversation_id}/transcript`.\n\nThe conversation is on your app's **simulated sender** for the channel\n(`kind` `simulated`), which Flow creates on first use. It never touches a\nnetwork: sends to the simulated contact pass the real send gate and end\n`sent`. Simulated channels: `telegram`, `whatsapp`, `imessage` and `sms`.\nThe channel's rules hold as on a real sender: a simulated iMessage line,\nlike Flow's lines today, only replies, so the contact writes first; a\nsimulated Telegram bot, like a real one, cannot write to a contact who has\nnot written to it, so a send before the contact's first turn is accepted\n(`202`) and then fails as it does on real Telegram (`message.failed`,\n`channel_error`, `channel_code` `403`); on SMS\nand iMessage a buttons message answers `422 unsupported_content`, as on a\nreal line.\n\nOn WhatsApp, the contact's turns go through the real WhatsApp inbound path,\nso each turn opens the 24-hour window. Outside it, including before the\ncontact's first turn, only a `template` can be sent (`409 outside_window`).\nButtons take up to 3 reply buttons (a `list` up to 10 rows); reactions and\n`reply_to` work; edits and unsends answer `422 unsupported_content`.\n\nOn SMS, the rules that concern the contact hold too. Before the contact's\nfirst turn, a send to them is a start that needs their recorded consent:\nwithout `consent` (on `POST /v0/messages` with `to.contact`), it answers\n`403 permission` with `channel_code` `consent_required`, as a real SMS start\ndoes. A turn with the text STOP opts the contact out and START lifts it (see\n`POST /v0/test/conversations/{conversation_id}/inbound`). A simulated SMS\nsender keeps no quiet hours, so a test's outcome never depends on the time of\nday, and it sends media and voice as MMS.\n\nCreating the conversation sends no event. The conversation starts with its\nfirst message: the contact's first turn (`via` `inbound`), or your first send\nto the contact, such as a WhatsApp template or an SMS send with consent\n(`via` `outbound`). `conversation.started` comes before that message's\n`message.received` or `message.sent`.\n\nOn iMessage, `group` makes a simulated group conversation instead (`type`\n`group`, with the participants as simulated contacts), so you can test how\nyour agent handles groups: each turn names its writer in `from`, and the\ngate applies the group rules (reactions refused with `channel_code`\n`group_unsupported`, as are typing and read receipts). Each call with\n`group` makes a new group.\n\nGive `contact` to choose the simulated contact's address; giving an address\nthat already has a simulated conversation returns that conversation (`200`).\nWithout `contact`, Flow makes a new contact with a made-up address (phone\nnumbers start `+1555`), so each call is a fresh conversation, for example one\nper test case. Simulated contacts never match real ones, even with the same\naddress.\n\nSimulated traffic is free: it does not count against the sandbox allowance.\nAn app has at most 500 simulated conversations: past that, a new one answers\n`403 permission` with `channel_code` `simulated_conversation_limit` (an\naddress that has one still returns it with `200`), so reuse conversations\nacross test runs. The `/v0/test/` endpoints take at most 120 requests a\nminute per key (`429 rate_limited`), on top of the plan's request rate\nlimit. A live key answers `403 permission` with `channel_code`\n`test_mode_only`.\n\nA HIPAA account (`Account.hipaa`) can simulate only the channels its\nbusiness associate agreement covers (SMS), as it can connect senders only\nthere: `telegram`, `whatsapp` or `imessage` answers `403 permission` with\n`channel_code` `hipaa_channel_not_covered` (`param` `channel`).\n","href":"/api-reference/testing/create-a-simulated-conversation"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/flow-messaging/8b05b91b2b2979cc/default-host-redirect.js"],"openApiReferenceData":{"operation":{"operationId":"createTestConversation","tags":["Testing"],"summary":"Create a simulated conversation","description":"Test keys only. Creates a conversation with a **simulated contact**, an end\nuser that exists only inside Flow, so an agent or a test suite can play the\nperson's side with no phone and no real channel. Write as the contact with\n`POST /v0/test/conversations/{conversation_id}/inbound`; your agent receives\neach turn exactly like a real `message.received` and replies with its normal\nsend. Read both sides with `GET /v0/test/conversations/{conversation_id}/transcript`.\n\nThe conversation is on your app's **simulated sender** for the channel\n(`kind` `simulated`), which Flow creates on first use. It never touches a\nnetwork: sends to the simulated contact pass the real send gate and end\n`sent`. Simulated channels: `telegram`, `whatsapp`, `imessage` and `sms`.\nThe channel's rules hold as on a real sender: a simulated iMessage line,\nlike Flow's lines today, only replies, so the contact writes first; a\nsimulated Telegram bot, like a real one, cannot write to a contact who has\nnot written to it, so a send before the contact's first turn is accepted\n(`202`) and then fails as it does on real Telegram (`message.failed`,\n`channel_error`, `channel_code` `403`); on SMS\nand iMessage a buttons message answers `422 unsupported_content`, as on a\nreal line.\n\nOn WhatsApp, the contact's turns go through the real WhatsApp inbound path,\nso each turn opens the 24-hour window. Outside it, including before the\ncontact's first turn, only a `template` can be sent (`409 outside_window`).\nButtons take up to 3 reply buttons (a `list` up to 10 rows); reactions and\n`reply_to` work; edits and unsends answer `422 unsupported_content`.\n\nOn SMS, the rules that concern the contact hold too. Before the contact's\nfirst turn, a send to them is a start that needs their recorded consent:\nwithout `consent` (on `POST /v0/messages` with `to.contact`), it answers\n`403 permission` with `channel_code` `consent_required`, as a real SMS start\ndoes. A turn with the text STOP opts the contact out and START lifts it (see\n`POST /v0/test/conversations/{conversation_id}/inbound`). A simulated SMS\nsender keeps no quiet hours, so a test's outcome never depends on the time of\nday, and it sends media and voice as MMS.\n\nCreating the conversation sends no event. The conversation starts with its\nfirst message: the contact's first turn (`via` `inbound`), or your first send\nto the contact, such as a WhatsApp template or an SMS send with consent\n(`via` `outbound`). `conversation.started` comes before that message's\n`message.received` or `message.sent`.\n\nOn iMessage, `group` makes a simulated group conversation instead (`type`\n`group`, with the participants as simulated contacts), so you can test how\nyour agent handles groups: each turn names its writer in `from`, and the\ngate applies the group rules (reactions refused with `channel_code`\n`group_unsupported`, as are typing and read receipts). Each call with\n`group` makes a new group.\n\nGive `contact` to choose the simulated contact's address; giving an address\nthat already has a simulated conversation returns that conversation (`200`).\nWithout `contact`, Flow makes a new contact with a made-up address (phone\nnumbers start `+1555`), so each call is a fresh conversation, for example one\nper test case. Simulated contacts never match real ones, even with the same\naddress.\n\nSimulated traffic is free: it does not count against the sandbox allowance.\nAn app has at most 500 simulated conversations: past that, a new one answers\n`403 permission` with `channel_code` `simulated_conversation_limit` (an\naddress that has one still returns it with `200`), so reuse conversations\nacross test runs. The `/v0/test/` endpoints take at most 120 requests a\nminute per key (`429 rate_limited`), on top of the plan's request rate\nlimit. A live key answers `403 permission` with `channel_code`\n`test_mode_only`.\n\nA HIPAA account (`Account.hipaa`) can simulate only the channels its\nbusiness associate agreement covers (SMS), as it can connect senders only\nthere: `telegram`, `whatsapp` or `imessage` answers `403 permission` with\n`channel_code` `hipaa_channel_not_covered` (`param` `channel`).\n","parameters":["4b95c24c-28b3-459f-881e-aa1b60d266a6"],"requestBody":"ad142d01-c09e-4a03-a89c-21e686b2cd02","responses":{"200":"31455735-1b3c-4b31-86d0-b3745237c952","201":"8d51157b-648c-4a41-a72e-798a00c9da28","400":"650a3319-6b2e-4acf-b28b-fd0b9c269e7f","401":"07c6c492-700e-4288-8487-1ad93608296b","403":"f8a9f5a1-08ab-4291-8780-8e266a028ae5","409":"83cd817a-d6d2-4538-af63-72a84f554689","413":"b1631e27-d796-41c5-bbf8-63630da3e704","429":"40733c6c-eaa0-41f8-8ec2-28633b006749","default":"e921e3b5-acf3-4184-8782-a06f0759b3fa"},"method":"post","type":"path","servers":["90a9657d-20c1-4182-87ad-a4d557fcda08"],"security":["59c5f960-0d19-49e7-944f-bfe75a0ffe7d"],"path":"/v0/test/conversations","baseUrlOptions":["https://api.flow.engineer"],"title":"Create a simulated conversation","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","go"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"4b95c24c-28b3-459f-881e-aa1b60d266a6":{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique string (up to 255 characters) that makes this request safe to retry.\nA repeat with the same key within 24 hours returns the first answer instead of\nacting again. See \"Idempotency\" in the introduction.\n","schema":{"type":"string","minLength":1,"maxLength":255,"isRequired":false,"description":"A unique string (up to 255 characters) that makes this request safe to retry.\nA repeat with the same key within 24 hours returns the first answer instead of\nacting again. See \"Idempotency\" in the introduction.\n","uniqueKey":"","typeLabel":"string"}},"2c6813c7-0ea9-4c63-93a5-b0d4b61ccb8a":{"name":"Flow-Version","in":"header","required":false,"description":"The API version to use, as a date. Without it, the version pinned to your app when it was created is used.","schema":{"type":"string","format":"date","examples":["2026-11-01"],"isRequired":false,"description":"The API version to use, as a date. Without it, the version pinned to your app when it was created is used.","uniqueKey":"","typeLabel":"string\u003cdate>"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"A simulated conversation to create (test keys only).","required":["channel"],"properties":{"channel":{"type":"string","description":"The channel to simulate. `telegram`, `whatsapp`, `imessage` or `sms`.","enum":["telegram","whatsapp","imessage","sms"],"isRequired":true,"uniqueKey":"channel","typeLabel":"enum\u003cstring>"},"contact":{"type":"object","description":"The simulated contact's address on the channel. Give one field that fits the\nchannel: `phone` on SMS, iMessage and WhatsApp, `handle` on iMessage,\n`telegram_user_id` on Telegram. Omit `contact` to get a new contact with a made-up address.\n","minProperties":1,"maxProperties":1,"properties":{"phone":{"type":"string","description":"SMS, iMessage or WhatsApp. E.164 phone number; on SMS a US number (`+1` and ten digits).","pattern":"^\\+[1-9][0-9]{6,14}$","uniqueKey":"contact.phone","typeLabel":"string"},"handle":{"type":"string","minLength":3,"maxLength":254,"description":"iMessage. A phone number or an email address.","uniqueKey":"contact.handle","typeLabel":"string"},"telegram_user_id":{"type":"string","description":"Telegram. A numeric user ID.","pattern":"^[1-9][0-9]{0,15}$","uniqueKey":"contact.telegram_user_id","typeLabel":"string"}},"uniqueKey":"contact","typeLabel":"object"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The simulated contact's display name, as a channel would report it. Not with `group`.","uniqueKey":"name","typeLabel":"string"},"group":{"type":"object","description":"`imessage` only: make a simulated group conversation (`type` `group`)\ninstead of a one-to-one one, with these participants. Not with `contact`\nor `name`. Each turn names the participant who writes (`from` on\n`POST /v0/test/conversations/{conversation_id}/inbound`). Another channel\nanswers `400 invalid_request` with `param` `group`.\n","required":["participants"],"properties":{"participants":{"type":"array","minItems":2,"maxItems":32,"description":"The people in the group other than your line. Each becomes a simulated contact; a participant without `address` gets a made-up one.","items":{"type":"object","description":"One simulated person in a simulated group.","properties":{"address":{"type":"object","description":"The simulated contact's address on the channel. Give one field that fits the\nchannel: `phone` on SMS, iMessage and WhatsApp, `handle` on iMessage,\n`telegram_user_id` on Telegram. Omit `contact` to get a new contact with a made-up address.\n","minProperties":1,"maxProperties":1,"properties":{"phone":{"type":"string","description":"SMS, iMessage or WhatsApp. E.164 phone number; on SMS a US number (`+1` and ten digits).","pattern":"^\\+[1-9][0-9]{6,14}$","uniqueKey":"group.participants.items.[INDEX].address.phone","typeLabel":"string"},"handle":{"type":"string","minLength":3,"maxLength":254,"description":"iMessage. A phone number or an email address.","uniqueKey":"group.participants.items.[INDEX].address.handle","typeLabel":"string"},"telegram_user_id":{"type":"string","description":"Telegram. A numeric user ID.","pattern":"^[1-9][0-9]{0,15}$","uniqueKey":"group.participants.items.[INDEX].address.telegram_user_id","typeLabel":"string"}},"uniqueKey":"group.participants.items.[INDEX].address","typeLabel":"object"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The participant's display name.","uniqueKey":"group.participants.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"group.participants.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"group.participants","typeLabel":"object[]"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The group chat's name. Leave it out for an unnamed group.","uniqueKey":"group.name","typeLabel":"string"}},"uniqueKey":"group","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sms":{"title":"sms","value":{"channel":"sms","name":"Test contact"}},"telegram":{"title":"telegram","value":{"channel":"telegram","contact":{"telegram_user_id":"700100200"},"name":"Asha"}},"imessage_group":{"title":"imessage_group","value":{"channel":"imessage","group":{"name":"Weekend trip","participants":[{"name":"Asha"},{"name":"Ben","address":{"phone":"+15555550142"}}]}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"31455735-1b3c-4b31-86d0-b3745237c952":{"description":"The contact's simulated conversation already existed; it is returned as is.","content":{"application/json":{"schema":{"type":"object","description":"One sender talking with one contact (`type` `direct`), or with an iMessage\ngroup chat (`type` `group`). Holds the window state and whether the contact\nopted in.\n","required":["id","app","channel","sender","livemode","opted_in","created_at"],"properties":{"id":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"isRequired":true,"uniqueKey":"id","typeLabel":"string"},"app":{"type":"string","description":"An app ID, `app_` and a ULID.","pattern":"^app_[0-9A-HJKMNP-TV-Z]{26}$","examples":["app_01JB8Z0A1C3E5G7J9K1M3P5R7T"],"isRequired":true,"uniqueKey":"app","typeLabel":"string"},"channel":{"type":"string","description":"A messaging channel. `sms` is US SMS and MMS (in pilot), from dedicated numbers only.","enum":["telegram","whatsapp","imessage","sms"],"isRequired":true,"uniqueKey":"channel","typeLabel":"enum\u003cstring>"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"isRequired":true,"uniqueKey":"sender","typeLabel":"string"},"livemode":{"type":"boolean","description":"Whether the conversation belongs to live mode.","isRequired":true,"uniqueKey":"livemode","typeLabel":"boolean"},"opted_in":{"type":"boolean","description":"Whether the contact has agreed to receive messages (wrote first, joined the sandbox, or you recorded consent). Always `true` on group conversations, which begin with the group writing.","isRequired":true,"uniqueKey":"opted_in","typeLabel":"boolean"},"created_at":{"type":"string","format":"date-time","description":"When the conversation began.","isRequired":true,"uniqueKey":"created_at","typeLabel":"string\u003cdate-time>"},"type":{"type":"string","description":"Flow always sends it; read a missing one as `direct` (answers from\nbefore groups existed). `direct`: one sender and one contact (every\nchannel). `group`: a group chat\none of your dedicated iMessage lines was added to; it has `group` and no\n`contact`. Flow's shared iMessage line ignores group chats, so they never\nreach your app from it.\n","enum":["direct","group"],"default":"direct","x-enum-varnames":["ConversationDirect","ConversationGroup"],"uniqueKey":"type","typeLabel":"enum\u003cstring>"},"contact":{"type":"string","description":"The contact the conversation is with. Always set when `type` is `direct`; absent on group conversations (each message's `from` says who wrote).","pattern":"^ct_[0-9A-HJKMNP-TV-Z]{26}$","examples":["ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0"],"uniqueKey":"contact","typeLabel":"string"},"group":{"type":"object","readOnly":true,"description":"Group conversations only (iMessage): the group chat as Flow saw it last.\nPeople who join or leave change `participants` without an event; Flow\nupdates the list when the group next writes. The channel's own group ID is\nnever exposed: use the conversation's ID.\n","required":["participants"],"properties":{"participants":{"type":"array","description":"The people in the group other than your line, each a contact on the channel (made the first time Flow sees them, like a one-to-one contact).","items":{"type":"object","description":"One person in a group chat.","required":["contact","address"],"properties":{"contact":{"type":"string","description":"A contact ID, `ct_` and a ULID.","pattern":"^ct_[0-9A-HJKMNP-TV-Z]{26}$","examples":["ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0"],"isRequired":true,"uniqueKey":"group.participants.items.[INDEX].contact","typeLabel":"string"},"address":{"type":"object","description":"How the contact is reached on their channel. Which fields are set depends on the channel; do not assume `phone`.","properties":{"phone":{"type":"string","description":"E.164 phone number (WhatsApp and SMS; iMessage when the handle is a number).","uniqueKey":"group.participants.items.[INDEX].address.phone","typeLabel":"string"},"username":{"type":"string","description":"A username without `@` (Telegram, WhatsApp usernames).","uniqueKey":"group.participants.items.[INDEX].address.username","typeLabel":"string"},"telegram_user_id":{"type":"string","description":"Telegram's numeric user ID, as a string.","uniqueKey":"group.participants.items.[INDEX].address.telegram_user_id","typeLabel":"string"},"handle":{"type":"string","description":"iMessage handle (a phone number or an email address).","uniqueKey":"group.participants.items.[INDEX].address.handle","typeLabel":"string"}},"isRequired":true,"uniqueKey":"group.participants.items.[INDEX].address","typeLabel":"object"},"name":{"type":"string","description":"The person's display name, as the channel reports it. May be missing.","uniqueKey":"group.participants.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"group.participants.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"group.participants","typeLabel":"object[]"},"name":{"type":"string","description":"The group chat's name, when it has one.","uniqueKey":"group.name","typeLabel":"string"}},"uniqueKey":"group","typeLabel":"object"},"last_inbound_at":{"type":"string","format":"date-time","description":"When the contact last wrote. Absent if they never have.","uniqueKey":"last_inbound_at","typeLabel":"string\u003cdate-time>"},"window_open_until":{"type":"string","format":"date-time","description":"WhatsApp only. Until when free-form messages may be sent; after it, only templates. Absent when the window is closed or the channel has none.","uniqueKey":"window_open_until","typeLabel":"string\u003cdate-time>"},"simulated":{"type":"boolean","readOnly":true,"description":"`true` for a simulated conversation, whose contact exists only inside Flow (test mode only, from `POST /v0/test/conversations`); absent otherwise.","uniqueKey":"simulated","typeLabel":"boolean"},"metadata":{"type":"object","description":"Up to 20 string pairs of your own, kept with the object and returned unchanged. Keys up to 40 characters, values up to 500.","maxProperties":20,"additionalProperties":{"type":"string","maxLength":500,"uniqueKey":"metadata.additionalProperties","typeLabel":"string"},"uniqueKey":"metadata","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1","app":"app_01JB8Z0A1C3E5G7J9K1M3P5R7T","channel":"telegram","sender":"snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T","livemode":true,"opted_in":true,"created_at":"2023-11-07T05:31:56Z","type":"direct","contact":"ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0","group":{"participants":[{"contact":"ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0","address":{"phone":"\u003cstring>","username":"\u003cstring>","telegram_user_id":"\u003cstring>","handle":"\u003cstring>"},"name":"\u003cstring>"}],"name":"\u003cstring>"},"last_inbound_at":"2023-11-07T05:31:56Z","window_open_until":"2023-11-07T05:31:56Z","simulated":true,"metadata":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"8d51157b-648c-4a41-a72e-798a00c9da28":{"description":"The simulated conversation was created.","content":{"application/json":{"schema":{"type":"object","description":"One sender talking with one contact (`type` `direct`), or with an iMessage\ngroup chat (`type` `group`). Holds the window state and whether the contact\nopted in.\n","required":["id","app","channel","sender","livemode","opted_in","created_at"],"properties":{"id":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"isRequired":true,"uniqueKey":"id","typeLabel":"string"},"app":{"type":"string","description":"An app ID, `app_` and a ULID.","pattern":"^app_[0-9A-HJKMNP-TV-Z]{26}$","examples":["app_01JB8Z0A1C3E5G7J9K1M3P5R7T"],"isRequired":true,"uniqueKey":"app","typeLabel":"string"},"channel":{"type":"string","description":"A messaging channel. `sms` is US SMS and MMS (in pilot), from dedicated numbers only.","enum":["telegram","whatsapp","imessage","sms"],"isRequired":true,"uniqueKey":"channel","typeLabel":"enum\u003cstring>"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"isRequired":true,"uniqueKey":"sender","typeLabel":"string"},"livemode":{"type":"boolean","description":"Whether the conversation belongs to live mode.","isRequired":true,"uniqueKey":"livemode","typeLabel":"boolean"},"opted_in":{"type":"boolean","description":"Whether the contact has agreed to receive messages (wrote first, joined the sandbox, or you recorded consent). Always `true` on group conversations, which begin with the group writing.","isRequired":true,"uniqueKey":"opted_in","typeLabel":"boolean"},"created_at":{"type":"string","format":"date-time","description":"When the conversation began.","isRequired":true,"uniqueKey":"created_at","typeLabel":"string\u003cdate-time>"},"type":{"type":"string","description":"Flow always sends it; read a missing one as `direct` (answers from\nbefore groups existed). `direct`: one sender and one contact (every\nchannel). `group`: a group chat\none of your dedicated iMessage lines was added to; it has `group` and no\n`contact`. Flow's shared iMessage line ignores group chats, so they never\nreach your app from it.\n","enum":["direct","group"],"default":"direct","x-enum-varnames":["ConversationDirect","ConversationGroup"],"uniqueKey":"type","typeLabel":"enum\u003cstring>"},"contact":{"type":"string","description":"The contact the conversation is with. Always set when `type` is `direct`; absent on group conversations (each message's `from` says who wrote).","pattern":"^ct_[0-9A-HJKMNP-TV-Z]{26}$","examples":["ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0"],"uniqueKey":"contact","typeLabel":"string"},"group":{"type":"object","readOnly":true,"description":"Group conversations only (iMessage): the group chat as Flow saw it last.\nPeople who join or leave change `participants` without an event; Flow\nupdates the list when the group next writes. The channel's own group ID is\nnever exposed: use the conversation's ID.\n","required":["participants"],"properties":{"participants":{"type":"array","description":"The people in the group other than your line, each a contact on the channel (made the first time Flow sees them, like a one-to-one contact).","items":{"type":"object","description":"One person in a group chat.","required":["contact","address"],"properties":{"contact":{"type":"string","description":"A contact ID, `ct_` and a ULID.","pattern":"^ct_[0-9A-HJKMNP-TV-Z]{26}$","examples":["ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0"],"isRequired":true,"uniqueKey":"group.participants.items.[INDEX].contact","typeLabel":"string"},"address":{"type":"object","description":"How the contact is reached on their channel. Which fields are set depends on the channel; do not assume `phone`.","properties":{"phone":{"type":"string","description":"E.164 phone number (WhatsApp and SMS; iMessage when the handle is a number).","uniqueKey":"group.participants.items.[INDEX].address.phone","typeLabel":"string"},"username":{"type":"string","description":"A username without `@` (Telegram, WhatsApp usernames).","uniqueKey":"group.participants.items.[INDEX].address.username","typeLabel":"string"},"telegram_user_id":{"type":"string","description":"Telegram's numeric user ID, as a string.","uniqueKey":"group.participants.items.[INDEX].address.telegram_user_id","typeLabel":"string"},"handle":{"type":"string","description":"iMessage handle (a phone number or an email address).","uniqueKey":"group.participants.items.[INDEX].address.handle","typeLabel":"string"}},"isRequired":true,"uniqueKey":"group.participants.items.[INDEX].address","typeLabel":"object"},"name":{"type":"string","description":"The person's display name, as the channel reports it. May be missing.","uniqueKey":"group.participants.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"group.participants.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"group.participants","typeLabel":"object[]"},"name":{"type":"string","description":"The group chat's name, when it has one.","uniqueKey":"group.name","typeLabel":"string"}},"uniqueKey":"group","typeLabel":"object"},"last_inbound_at":{"type":"string","format":"date-time","description":"When the contact last wrote. Absent if they never have.","uniqueKey":"last_inbound_at","typeLabel":"string\u003cdate-time>"},"window_open_until":{"type":"string","format":"date-time","description":"WhatsApp only. Until when free-form messages may be sent; after it, only templates. Absent when the window is closed or the channel has none.","uniqueKey":"window_open_until","typeLabel":"string\u003cdate-time>"},"simulated":{"type":"boolean","readOnly":true,"description":"`true` for a simulated conversation, whose contact exists only inside Flow (test mode only, from `POST /v0/test/conversations`); absent otherwise.","uniqueKey":"simulated","typeLabel":"boolean"},"metadata":{"type":"object","description":"Up to 20 string pairs of your own, kept with the object and returned unchanged. Keys up to 40 characters, values up to 500.","maxProperties":20,"additionalProperties":{"type":"string","maxLength":500,"uniqueKey":"metadata.additionalProperties","typeLabel":"string"},"uniqueKey":"metadata","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1","app":"app_01JB8Z0A1C3E5G7J9K1M3P5R7T","channel":"telegram","sender":"snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T","livemode":true,"opted_in":true,"created_at":"2023-11-07T05:31:56Z","type":"direct","contact":"ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0","group":{"participants":[{"contact":"ct_01JB8ZB2J4K6N8Q0S2V4W6Y8A0","address":{"phone":"\u003cstring>","username":"\u003cstring>","telegram_user_id":"\u003cstring>","handle":"\u003cstring>"},"name":"\u003cstring>"}],"name":"\u003cstring>"},"last_inbound_at":"2023-11-07T05:31:56Z","window_open_until":"2023-11-07T05:31:56Z","simulated":true,"metadata":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"650a3319-6b2e-4acf-b28b-fd0b9c269e7f":{"description":"The request is malformed or a parameter is invalid (`invalid_request`).\n`error.param` names the parameter. Every endpoint answers this for a\n`Flow-Version` header that is not a date this API serves (`param`\n`Flow-Version`), and every `POST` that takes an `Idempotency-Key` for a key\nover 255 characters (`param` `Idempotency-Key`).\n","content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"invalid_request","message":"limit must be between 1 and 100.","hint":"Pass limit between 1 and 100 (default 20), and page with after or before.","doc_url":"https://api.flow.engineer/docs/errors/invalid_request","param":"limit"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request","message":"limit must be between 1 and 100.","hint":"Pass limit between 1 and 100 (default 20), and page with after or before.","doc_url":"https://api.flow.engineer/docs/errors/invalid_request","param":"limit"}}}},"exampleType":"examples"}},"exampleType":"examples"},"07c6c492-700e-4288-8487-1ad93608296b":{"description":"The API key is missing, malformed, unknown, revoked or expired (`authentication`).","headers":{"WWW-Authenticate":{"description":"The authentication scheme, `Bearer realm=\"api.flow.engineer\"`. When the\nrequest carried a key that is well formed but unknown, revoked or\nexpired, it also says `error=\"invalid_token\"`:\n`Bearer realm=\"api.flow.engineer\", error=\"invalid_token\"`. A missing or\nmalformed key gets the scheme alone.\n","schema":{"type":"string","examples":["Bearer realm=\"api.flow.engineer\", error=\"invalid_token\""]}}},"content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"authentication","message":"No valid API key was given.","hint":"Send the header Authorization: Bearer fk_test_... (or fk_live_...); no key yet? Get a test key with curl -X POST https://api.flow.engineer/v0/sandbox/keys","doc_url":"https://api.flow.engineer/docs/errors/authentication"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication","message":"No valid API key was given.","hint":"Send the header Authorization: Bearer fk_test_... (or fk_live_...); no key yet? Get a test key with curl -X POST https://api.flow.engineer/v0/sandbox/keys","doc_url":"https://api.flow.engineer/docs/errors/authentication"}}}},"exampleType":"examples"}},"exampleType":"examples"},"f8a9f5a1-08ab-4291-8780-8e266a028ae5":{"description":"`permission`: a live key (`channel_code` `test_mode_only`), the app's\n500 simulated conversations reached (`simulated_conversation_limit`), or\na HIPAA account asking for a channel its business associate agreement\ndoes not cover (`hipaa_channel_not_covered`; only `sms` can be simulated).\n","content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"permission","message":"This account handles health information under a business associate agreement, and Telegram is not a channel Flow holds such an agreement for, so it cannot be simulated here either.","hint":"Simulate an SMS conversation instead: POST /v0/test/conversations with {\"channel\":\"sms\"}.","doc_url":"https://api.flow.engineer/docs/errors/permission","param":"channel","channel_code":"hipaa_channel_not_covered"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"permission","message":"This account handles health information under a business associate agreement, and Telegram is not a channel Flow holds such an agreement for, so it cannot be simulated here either.","hint":"Simulate an SMS conversation instead: POST /v0/test/conversations with {\"channel\":\"sms\"}.","doc_url":"https://api.flow.engineer/docs/errors/permission","param":"channel","channel_code":"hipaa_channel_not_covered"}}}},"exampleType":"examples"}},"exampleType":"examples"},"83cd817a-d6d2-4538-af63-72a84f554689":{"description":"The `Idempotency-Key` was already used (`idempotency_conflict`):\n`channel_code` `body_mismatch` (a different method, path or body; use a new\nkey), `in_progress` (the first request with the key is still running; repeat\nit after `retry_after` seconds), or `secret_not_kept` (the first request went\nthrough and its answer carried a secret shown only once). See \"Idempotency\"\nin the introduction.\n","content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"idempotency_conflict","message":"This Idempotency-Key was already used for a different request (another method, path or body).","hint":"Use a new Idempotency-Key for this request; reuse a key only to repeat the identical request.","doc_url":"https://api.flow.engineer/docs/errors/idempotency_conflict","param":"Idempotency-Key","channel_code":"body_mismatch"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"idempotency_conflict","message":"This Idempotency-Key was already used for a different request (another method, path or body).","hint":"Use a new Idempotency-Key for this request; reuse a key only to repeat the identical request.","doc_url":"https://api.flow.engineer/docs/errors/idempotency_conflict","param":"Idempotency-Key","channel_code":"body_mismatch"}}}},"exampleType":"examples"}},"exampleType":"examples"},"b1631e27-d796-41c5-bbf8-63630da3e704":{"description":"The request body is larger than Flow takes (`invalid_request`): 32 MB, or\n101 MB for `POST /v0/files` (a 100 MB file and its multipart framing). A body\nthat declares a larger `Content-Length` is refused before it is read. Send\nmedia as a `file_id` from `POST /v0/files` or by `url` instead of inlining it.\n","content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"invalid_request","message":"The request body is larger than 33554432 bytes.","hint":"Send a smaller body; upload media with POST /v0/files and send its file_id instead of inlining it.","doc_url":"https://api.flow.engineer/docs/errors/invalid_request"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request","message":"The request body is larger than 33554432 bytes.","hint":"Send a smaller body; upload media with POST /v0/files and send its file_id instead of inlining it.","doc_url":"https://api.flow.engineer/docs/errors/invalid_request"}}}},"exampleType":"examples"}},"exampleType":"examples"},"40733c6c-eaa0-41f8-8ec2-28633b006749":{"description":"Too many requests (`rate_limited`): either this key's request limit (see the\n`RateLimit-*` headers) or the sender's sending rate (pacing) was exceeded;\nretry after `Retry-After` seconds (also `error.retry_after`) with the same\n`Idempotency-Key`. Or the sender has used its budget for starting\nconversations (`new_contact_limit`), or the sender is throttled after abuse\nsignals (`sender_throttled`); wait `retry_after` seconds.\n","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"RateLimit-Limit":{"description":"Requests allowed in the current window for this key.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window for this key.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"type":"new_contact_limit","message":"This sender has started its 15 new conversations for today.","hint":"Retry after 3600 seconds; replies into existing conversations still go.","doc_url":"https://api.flow.engineer/docs/errors/new_contact_limit","retry_after":3600,"sender":"snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"}},"examples":{"Example":{"title":"Example","value":{"error":{"type":"new_contact_limit","message":"This sender has started its 15 new conversations for today.","hint":"Retry after 3600 seconds; replies into existing conversations still go.","doc_url":"https://api.flow.engineer/docs/errors/new_contact_limit","retry_after":3600,"sender":"snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"}}}},"exampleType":"examples"}},"exampleType":"examples"},"e921e3b5-acf3-4184-8782-a06f0759b3fa":{"description":"An error. `error.type` says which (see `ErrorType`).","content":{"application/json":{"schema":{"type":"object","description":"The body of every error answer.","required":["error"],"properties":{"error":{"type":"object","description":"The details of an error.","required":["type","message","hint","doc_url"],"properties":{"type":{"type":"string","description":"What went wrong. A closed list: new types arrive only with a new API version.\nEach type has a page at `https://api.flow.engineer/docs/errors/\u003ctype>`, given in\nthe error's `doc_url`; the error's `hint` says what to change for the case.\n\n- `invalid_request` (400, or 413 for a request body over the size limit): the request is malformed or a parameter is invalid. Fix the parameter named in `param`; the `hint` says what it must look like. Every endpoint answers it for a `Flow-Version` header that is not a version this API serves.\n- `authentication` (401): the API key is missing, malformed, unknown, revoked or expired. An `Authorization: Bearer` header with nothing after it usually means the environment variable holding the key was empty when the header was built (for an MCP client, when the server was added): the `hint` says so. Send `Authorization: Bearer fk_test_...` or `fk_live_...` with a current key; with no key at all, get a test key with `POST /v0/sandbox/keys`. A sandbox key past its `expires_at` has `channel_code` `sandbox_key_expired`: sign in to claim the app, or get a new key.\n- `permission` (403): the key may not do this, for example a test key using a live sender, a sandbox contact who joined another app, a new conversation from an iMessage line that may only reply, or a send past the app's sandbox allowance (`channel_code` `sandbox_allowance_used`, `sandbox_contact_limit` or `sandbox_channel_not_included`). Use the key of the right mode, have the contact send your join message, wait for the contact to message the line first, or sign in through the device flow to lift the allowance. On SMS: `contact_opted_out` (the contact texted STOP; nothing more goes to them until they text START), `consent_required` (a start to someone who never texted your numbers: record their consent with `consent` on the start). In a HIPAA account: `hipaa_channel_not_covered` (the channel has no business associate agreement; use SMS). Simulated conversations: `simulated_contact` (a real sender was pointed at a simulated contact; reply in the contact's simulated conversation), `not_simulated` (a simulated sender or test endpoint was pointed at a real contact), `test_mode_only`, `simulated_conversation_limit`. In `message.failed`: `sandbox_contact_left` (the contact joined another app on the sandbox sender while the message was queued; have them send your join message again).\n- `not_found` (404): no such object for this app and mode. Check the ID's prefix and that it was made with a key of the same mode (test and live data are separate).\n- `idempotency_conflict` (409): the idempotency key was used for a different request (`channel_code` `body_mismatch`: use a new key), or that request is still running (`in_progress`: wait `retry_after` seconds and repeat it with the same key), or it already created a secret that is shown only once (`secret_not_kept`: creating a webhook endpoint, rotating its secret, connecting a WhatsApp number; a secret that was lost must be rotated again, and a WhatsApp number connected again to see its verify token).\n- `outside_window` (409, or in `message.failed`): the channel will not deliver outside its conversation window. On WhatsApp the 24-hour window is closed: send a template (`POST /v0/conversations/{conversation_id}/template`, or `POST /v0/messages` with `kind` `template` to start), or wait for the contact to write. On iMessage the contact has not messaged the line (or opted in) yet, or not recently, so the failure arrives as a `message.failed` event: wait for the contact to write, then reply in that conversation. Typing and read receipts answer `409 outside_window` directly when the channel's window for them is closed (iMessage typing works only within 5 minutes of the contact's last message; WhatsApp read receipts go at any time); ignore it and send your reply. On SMS, `channel_code` `quiet_hours`: the contact has not texted in the last hour and it is inside the sender's quiet hours in their time zone; retry after `retry_after` seconds, or wait for them to text. In `message.failed`: `window_closed` (WhatsApp's 24-hour window closed while the message was queued; send a template) and `queued_too_long` (the message waited in the queue longer than its sender allows, for example while the sender was paused; send it again if it still applies).\n- `unsupported_content` (422): the conversation's channel does not take this kind, field, block or value, and nothing was sent; Flow never converts a message. `param` names what was refused: `kind` (the endpoint's kind is not on this channel, such as a carousel on Telegram), a field or block (`reply_to` on SMS, `telegram` on WhatsApp, `telegram.is_big`), or the field whose value is not taken (`emoji` outside Telegram's reaction emoji, `buttons` for more than 3 WhatsApp buttons). `channel` is the conversation's channel and `hint` says what to send instead over plain HTTP; each endpoint's page lists its channels. In an iMessage group conversation, a reaction, typing or a read receipt answers it with `param` `kind` and `channel_code` `group_unsupported`: leave it out. Media to an SMS number without MMS answers it with `param` `media` and `channel_code` `no_mms`. An edit or unsend of an iMessage message that went by SMS or RCS (its `network`) answers it with `channel_code` `not_on_sms`: send a new message instead. An edit or unsend past the channel's time limit answers it with `channel_code` `edit_window_closed` or `unsend_window_closed` (iMessage: edits within 15 minutes of sending, unsends within 2 minutes; Telegram: unsends within 48 hours), and an iMessage edit of the message that started the conversation with `first_message_not_editable`; `message` states the limit and how long ago the message was sent. Send a new message instead. `POST /v0/files` answers it for a type Flow does not take (programs, web pages, unknown types). A send by `file_id` of a document a contact sent before Flow malware-scanned documents answers it too: Flow sends only documents it scanned.\n- `new_contact_limit` (429): the sender has used its budget for starting conversations. Wait `retry_after` seconds; replies into existing conversations still go.\n- `sender_throttled` (429): abuse signals tripped (the same text to many new contacts, many starts with no reply, blocks), so the sender may not start conversations until `retry_after`; replies into existing conversations still go. Personalise first messages and start only conversations people expect.\n- `file_blocked` (422): the file failed the malware scan and was not stored. Send a different file. (When the scan cannot run at all, the upload answers a retryable `500 api_error` with `Retry-After` instead.)\n- `rate_limited` (429): either too many requests for this key (the per-key request limit, reported in the `RateLimit-*` headers) or sends faster than the sender's sending rate (pacing). Wait `Retry-After` (`retry_after`) seconds and retry with the same `Idempotency-Key`.\n- `channel_error` (502, or in `message.failed`): the channel refused or failed the message, or timed out; `channel_code` carries its own code. Read `message`, change what the channel objected to, and send again. From typing and read receipts, which call the channel at once, it is safe to ignore. SMS codes are Flow's, the same whichever carrier network carries the message: `carrier_filtered` (a carrier's spam filter blocked it: make it read like a person's message, no shortened links), `unreachable`, `invalid_number`, `landline`, `registration_required` (the number's 10DLC or toll-free registration is not approved yet), `carrier_error`, and `provider_not_configured` (the SMS sender is not fully set up on Flow's side, so nothing was sent; contact the Flow team). Flow's own codes on every channel: `channel_timeout_unknown_outcome` (in `message.failed`: the channel did not answer after the message was sent, and the resends its policy allows did not settle it, so the message may have arrived or not; check with the contact before sending it again) and `unknown_outcome` (from typing and read receipts: the call timed out after it was sent).\n- `not_implemented` (501): this endpoint or channel is not live yet during the beta. Use a channel that is live (Telegram, iMessage), or check the changelog.\n- `api_error` (500, 503): something went wrong on Flow's side. Retry with the same idempotency key after `retry_after` seconds, and quote `request_id` if it persists.\n","enum":["invalid_request","authentication","permission","not_found","idempotency_conflict","outside_window","unsupported_content","new_contact_limit","sender_throttled","file_blocked","rate_limited","channel_error","not_implemented","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A sentence for a developer saying what went wrong. Do not parse it; switch on `type`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"hint":{"type":"string","description":"One sentence saying what to change to make the request succeed, specific\nto this case, for example \"Send a template instead: POST\n/v0/conversations/{conversation_id}/template.\" For `unsupported_content`\nit says what to send instead over plain HTTP. Written for developers and\ncoding agents alike. Do not parse it; it may be reworded at any time.\n","examples":["Send a template instead: POST /v0/conversations/{conversation_id}/template."],"isRequired":true,"uniqueKey":"error.hint","typeLabel":"string"},"doc_url":{"type":"string","format":"uri","description":"The documentation page for this error's type, `https://api.flow.engineer/docs/errors/\u003ctype>`. It says what the error means, why it happens and how to fix it, with code.","examples":["https://api.flow.engineer/docs/errors/outside_window"],"isRequired":true,"uniqueKey":"error.doc_url","typeLabel":"string\u003curi>"},"param":{"type":"string","description":"The request parameter the error is about, as a dotted path (`kind`, `telegram.is_big`, `buttons`, `cards[1].header.type`, `limit`).","uniqueKey":"error.param","typeLabel":"string"},"retry_after":{"type":"integer","minimum":0,"description":"Seconds to wait before retrying, for errors that clear by themselves.","uniqueKey":"error.retry_after","typeLabel":"integer"},"channel":{"type":"string","description":"The conversation's channel, on errors about what it takes (`unsupported_content`) and its windows (`outside_window`).","enum":["telegram","whatsapp","imessage","sms"],"uniqueKey":"error.channel","typeLabel":"enum\u003cstring>"},"conversation":{"type":"string","description":"A conversation ID, `conv_` and a ULID.","pattern":"^conv_[0-9A-HJKMNP-TV-Z]{26}$","examples":["conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1"],"uniqueKey":"error.conversation","typeLabel":"string"},"sender":{"type":"string","description":"A sender ID, `snd_` and a ULID.","pattern":"^snd_[0-9A-HJKMNP-TV-Z]{26}$","examples":["snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T"],"uniqueKey":"error.sender","typeLabel":"string"},"channel_code":{"type":"string","description":"For `channel_error`, the channel's own error code, as given by the\nchannel. For some other errors, Flow's own code naming the case, for\nexample `sandbox_allowance_used` (`permission`: the sandbox allowance is\nused up), `sandbox_contact_limit` (`permission`: the allowance has no\nroom for another contact), `sandbox_channel_not_included` (`permission`:\nthe allowance does not cover this sandbox channel), `sign_in_required`\n(`permission`: an app made without an account cannot do this) or\n`sandbox_key_expired` (`authentication`: a key from `POST\n/v0/sandbox/keys` passed its `expires_at`; `permission`, for a send\nthat carries no key, such as a reply in a webhook answer, from such an\napp). For `idempotency_conflict`, always one of `body_mismatch` (the\nkey was used for a different request), `in_progress` (the first\nrequest is still running; `retry_after` says when to repeat it) or\n`secret_not_kept` (its answer carried a secret shown only once).\nSMS: `contact_opted_out` and `consent_required` (`permission`),\n`quiet_hours` (`outside_window`, with `retry_after`), and\n`carrier_filtered`, `unreachable`, `invalid_number`, `landline`,\n`registration_required`, `carrier_error` and `provider_not_configured`\n(`channel_error`). HIPAA accounts: `hipaa_channel_not_covered`\n(`permission`). Connecting your own WhatsApp number (`POST\n/v0/senders`): `whatsapp_token_malformed`, `whatsapp_token_rejected`,\n`whatsapp_app_secret_malformed` and `whatsapp_number_not_in_account`\n(`invalid_request`), and `whatsapp_number_taken`,\n`whatsapp_account_taken` and `whatsapp_number_managed` (`permission`).\nSimulated conversations (`permission`): `test_mode_only`,\n`not_simulated`, `simulated_contact` and `simulated_conversation_limit`.\nFor a message that failed after it was queued (`message.failed`):\n`sandbox_contact_left` (`permission`), `window_closed` and\n`queued_too_long` (`outside_window`), and\n`channel_timeout_unknown_outcome` (`channel_error`: the channel never\nconfirmed the send, so it may or may not have arrived). iMessage\n(`unsupported_content`): `group_unsupported` (a reaction, typing or a\nread receipt in a group conversation; `param` `kind`) and\n`not_on_sms` (an edit or unsend of a message that went by SMS or RCS;\n`param` `kind`). SMS (`unsupported_content`): `no_mms` (media to a\nnumber without MMS; `param` `media`).\nEdits and unsends (`unsupported_content`): `edit_window_closed` and\n`unsend_window_closed` (the message is older than the channel allows\nfor the change) and `first_message_not_editable` (iMessage: the message\nthat started the conversation). From typing and\nread receipts, `unknown_outcome` (`channel_error`: the call timed out after\nit was sent).\n","uniqueKey":"error.channel_code","typeLabel":"string"},"request_id":{"type":"string","description":"Flow's ID for this request. Quote it when asking for help.","uniqueKey":"error.request_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request","message":"\u003cstring>","hint":"Send a template instead: POST /v0/conversations/{conversation_id}/template.","doc_url":"https://api.flow.engineer/docs/errors/outside_window","param":"\u003cstring>","retry_after":1,"channel":"telegram","conversation":"conv_01JB8ZC3K5M7P9R1T3V5X7Z9B1","sender":"snd_01JB8Z4Q3V6W0R2N7C5H1M9K4T","channel_code":"\u003cstring>","request_id":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"59c5f960-0d19-49e7-944f-bfe75a0ffe7d":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"fk_test_... or fk_live_...","description":"An API key of one app, sent as `Authorization: Bearer \u003ckey>`. Keys start with\n`fk_test_` (test mode: sandbox senders and test data only) or `fk_live_`\n(live mode). Keep live keys on your server; never ship them in an app or page.\n","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"90a9657d-20c1-4182-87ad-a4d557fcda08":{"url":"https://api.flow.engineer","description":"Production. Test and live mode are chosen by the API key."}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"fk_test_... or fk_live_...","description":"An API key of one app, sent as `Authorization: Bearer \u003ckey>`. Keys start with\n`fk_test_` (test mode: sandbox senders and test data only) or `fk_live_`\n(live mode). Keep live keys on your server; never ship them in an app or page.\n","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An API key of one app, sent as `Authorization: Bearer \u003ckey>`. Keys start with\n`fk_test_` (test mode: sandbox senders and test data only) or `fk_live_`\n(live mode). Keep live keys on your server; never ship them in an app or page.\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"unified-messaging-api/openapi.yaml"},"subdomain":"flow-messaging","siteName":"Flow","title":"Create a simulated conversation - Flow","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-24T16:17:30.743Z","originalFileLocation":"api-reference/testing/create-a-simulated-conversation.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Test keys only. Creates a conversation with a simulated contact, an end user that exists only inside Flow, so an agent or a test suite can play the person\u0026#x27;s side with no phone and no real channel. Write as the contact with POST /v0/test/conversations/{conversation_id}/inbound; your agent receives each turn exactly like a real message.received and replies with its normal send. Read both sides with GET /v0/test/conversations/{conversation_id}/transcript. The conversation is on your app\u0026#x27;s simulated sender for the channel (kind simulated), which Flow creates on first use. It never touches a network: sends to the simulated contact pass the real send gate and end sent. Simulated channels: telegram, whatsapp, imessage and sms. The channel\u0026#x27;s rules hold as on a real sender: a simulated iMessage line, like Flow\u0026#x27;s lines today, only replies, so the contact writes first; a simulated Telegram bot, like a real one, cannot write to a contact who has not written to it, so a send before the contact\u0026#x27;s first turn is accepted (202) and then fails as it does on real Telegram (message.failed, channel_error, channel_code 403); on SMS and iMessage a buttons message answers 422 unsupported_content, as on a real line. On WhatsApp, the contact\u0026#x27;s turns go through the real WhatsApp inbound path, so each turn opens the 24-hour window. Outside it, including before the contact\u0026#x27;s first turn, only a template can be sent (409 outside_window). Buttons take up to 3 reply buttons (a list up to 10 rows); reactions and reply_to work; edits and unsends answer 422 unsupported_content. On SMS, the rules that concern the contact hold too. Before the contact\u0026#x27;s first turn, a send to them is a start that needs their recorded consent: without consent (on POST /v0/messages with to.contact), it answers 403 permission with channel_code consent_required, as a real SMS start does. A turn with the text STOP opts the contact out and START lifts it (see POST /v0/test/conversations/{conversation_id}/inbound). A simulated SMS sender keeps no quiet hours, so a test\u0026#x27;s outcome never depends on the time of day, and it sends media and voice as MMS. Creating the conversation sends no event. The conversation starts with its first message: the contact\u0026#x27;s first turn (via inbound), or your first send to the contact, such as a WhatsApp template or an SMS send with consent (via outbound). conversation.started comes before that message\u0026#x27;s message.received or message.sent. On iMessage, group makes a simulated group conversation instead (type group, with the participants as simulated contacts), so you can test how your agent handles groups: each turn names its writer in from, and the gate applies the group rules (reactions refused with channel_code group_unsupported, as are typing and read receipts). Each call with group makes a new group. Give contact to choose the simulated contact\u0026#x27;s address; giving an address that already has a simulated conversation returns that conversation (200). Without contact, Flow makes a new contact with a made-up address (phone numbers start +1555), so each call is a fresh conversation, for example one per test case. Simulated contacts never match real ones, even with the same address. Simulated traffic is free: it does not count against the sandbox allowance. An app has at most 500 simulated conversations: past that, a new one answers 403 permission with channel_code simulated_conversation_limit (an address that has one still returns it with 200), so reuse conversations across test runs. The /v0/test/ endpoints take at most 120 requests a minute per key (429 rate_limited), on top of the plan\u0026#x27;s request rate limit. A live key answers 403 permission with channel_code test_mode_only. A HIPAA account (Account.hipaa) can simulate only the channels its business associate agreement covers (SMS), as it can connect senders only there: telegram, whatsapp or imessage answers 403 permission with channel_code hipaa_channel_not_covered (param channel).\">\u003cmeta data-mint-head name=\"application-name\" content=\"Flow\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/flow-messaging/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/flow-messaging/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/flow-messaging/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/flow-messaging/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a simulated conversation - Flow\">\u003cmeta data-mint-head property=\"og:description\" content=\"Test keys only. Creates a conversation with a simulated contact, an end user that exists only inside Flow, so an agent or a test suite can play the person\u0026#x27;s side with no phone and no real channel. Write as the contact with POST /v0/test/conversations/{conversation_id}/inbound; your agent receives each turn exactly like a real message.received and replies with its normal send. Read both sides with GET /v0/test/conversations/{conversation_id}/transcript. The conversation is on your app\u0026#x27;s simulated sender for the channel (kind simulated), which Flow creates on first use. It never touches a network: sends to the simulated contact pass the real send gate and end sent. Simulated channels: telegram, whatsapp, imessage and sms. The channel\u0026#x27;s rules hold as on a real sender: a simulated iMessage line, like Flow\u0026#x27;s lines today, only replies, so the contact writes first; a simulated Telegram bot, like a real one, cannot write to a contact who has not written to it, so a send before the contact\u0026#x27;s first turn is accepted (202) and then fails as it does on real Telegram (message.failed, channel_error, channel_code 403); on SMS and iMessage a buttons message answers 422 unsupported_content, as on a real line. On WhatsApp, the contact\u0026#x27;s turns go through the real WhatsApp inbound path, so each turn opens the 24-hour window. Outside it, including before the contact\u0026#x27;s first turn, only a template can be sent (409 outside_window). Buttons take up to 3 reply buttons (a list up to 10 rows); reactions and reply_to work; edits and unsends answer 422 unsupported_content. On SMS, the rules that concern the contact hold too. Before the contact\u0026#x27;s first turn, a send to them is a start that needs their recorded consent: without consent (on POST /v0/messages with to.contact), it answers 403 permission with channel_code consent_required, as a real SMS start does. A turn with the text STOP opts the contact out and START lifts it (see POST /v0/test/conversations/{conversation_id}/inbound). A simulated SMS sender keeps no quiet hours, so a test\u0026#x27;s outcome never depends on the time of day, and it sends media and voice as MMS. Creating the conversation sends no event. The conversation starts with its first message: the contact\u0026#x27;s first turn (via inbound), or your first send to the contact, such as a WhatsApp template or an SMS send with consent (via outbound). conversation.started comes before that message\u0026#x27;s message.received or message.sent. On iMessage, group makes a simulated group conversation instead (type group, with the participants as simulated contacts), so you can test how your agent handles groups: each turn names its writer in from, and the gate applies the group rules (reactions refused with channel_code group_unsupported, as are typing and read receipts). Each call with group makes a new group. Give contact to choose the simulated contact\u0026#x27;s address; giving an address that already has a simulated conversation returns that conversation (200). Without contact, Flow makes a new contact with a made-up address (phone numbers start +1555), so each call is a fresh conversation, for example one per test case. Simulated contacts never match real ones, even with the same address. Simulated traffic is free: it does not count against the sandbox allowance. An app has at most 500 simulated conversations: past that, a new one answers 403 permission with channel_code simulated_conversation_limit (an address that has one still returns it with 200), so reuse conversations across test runs. The /v0/test/ endpoints take at most 120 requests a minute per key (429 rate_limited), on top of the plan\u0026#x27;s request rate limit. A live key answers 403 permission with channel_code test_mode_only. A HIPAA account (Account.hipaa) can simulate only the channels its business associate agreement covers (SMS), as it can connect senders only there: telegram, whatsapp or imessage answers 403 permission with channel_code hipaa_channel_not_covered (param channel).\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Flow\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://flow-messaging.mintlify.app/_mintlify/api/og/v2?division=Simulated+conversations\u0026amp;title=Create+a+simulated+conversation\u0026amp;description=Test+keys+only.+Creates+a+conversation+with+a+**simulated+contact**%2C+an+end%0Auser+that+exists+only+inside+Flow%2C+so+an+agent+or+a+test+suite+can+play+the%0Aperson%27s\u0026amp;theme=052dec2df14a3094abf38032\u0026amp;signature=e81e59b0aec49c2e7a6cb84d24a8222fccc65ad87ef1ed34c36f34a40fe5685f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a simulated conversation - Flow\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Test keys only. Creates a conversation with a simulated contact, an end user that exists only inside Flow, so an agent or a test suite can play the person\u0026#x27;s side with no phone and no real channel. Write as the contact with POST /v0/test/conversations/{conversation_id}/inbound; your agent receives each turn exactly like a real message.received and replies with its normal send. Read both sides with GET /v0/test/conversations/{conversation_id}/transcript. The conversation is on your app\u0026#x27;s simulated sender for the channel (kind simulated), which Flow creates on first use. It never touches a network: sends to the simulated contact pass the real send gate and end sent. Simulated channels: telegram, whatsapp, imessage and sms. The channel\u0026#x27;s rules hold as on a real sender: a simulated iMessage line, like Flow\u0026#x27;s lines today, only replies, so the contact writes first; a simulated Telegram bot, like a real one, cannot write to a contact who has not written to it, so a send before the contact\u0026#x27;s first turn is accepted (202) and then fails as it does on real Telegram (message.failed, channel_error, channel_code 403); on SMS and iMessage a buttons message answers 422 unsupported_content, as on a real line. On WhatsApp, the contact\u0026#x27;s turns go through the real WhatsApp inbound path, so each turn opens the 24-hour window. Outside it, including before the contact\u0026#x27;s first turn, only a template can be sent (409 outside_window). Buttons take up to 3 reply buttons (a list up to 10 rows); reactions and reply_to work; edits and unsends answer 422 unsupported_content. On SMS, the rules that concern the contact hold too. Before the contact\u0026#x27;s first turn, a send to them is a start that needs their recorded consent: without consent (on POST /v0/messages with to.contact), it answers 403 permission with channel_code consent_required, as a real SMS start does. A turn with the text STOP opts the contact out and START lifts it (see POST /v0/test/conversations/{conversation_id}/inbound). A simulated SMS sender keeps no quiet hours, so a test\u0026#x27;s outcome never depends on the time of day, and it sends media and voice as MMS. Creating the conversation sends no event. The conversation starts with its first message: the contact\u0026#x27;s first turn (via inbound), or your first send to the contact, such as a WhatsApp template or an SMS send with consent (via outbound). conversation.started comes before that message\u0026#x27;s message.received or message.sent. On iMessage, group makes a simulated group conversation instead (type group, with the participants as simulated contacts), so you can test how your agent handles groups: each turn names its writer in from, and the gate applies the group rules (reactions refused with channel_code group_unsupported, as are typing and read receipts). Each call with group makes a new group. Give contact to choose the simulated contact\u0026#x27;s address; giving an address that already has a simulated conversation returns that conversation (200). Without contact, Flow makes a new contact with a made-up address (phone numbers start +1555), so each call is a fresh conversation, for example one per test case. Simulated contacts never match real ones, even with the same address. Simulated traffic is free: it does not count against the sandbox allowance. An app has at most 500 simulated conversations: past that, a new one answers 403 permission with channel_code simulated_conversation_limit (an address that has one still returns it with 200), so reuse conversations across test runs. The /v0/test/ endpoints take at most 120 requests a minute per key (429 rate_limited), on top of the plan\u0026#x27;s request rate limit. A live key answers 403 permission with channel_code test_mode_only. A HIPAA account (Account.hipaa) can simulate only the channels its business associate agreement covers (SMS), as it can connect senders only there: telegram, whatsapp or imessage answers 403 permission with channel_code hipaa_channel_not_covered (param channel).\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://flow-messaging.mintlify.app/_mintlify/api/og/v2?division=Simulated+conversations\u0026amp;title=Create+a+simulated+conversation\u0026amp;description=Test+keys+only.+Creates+a+conversation+with+a+**simulated+contact**%2C+an+end%0Auser+that+exists+only+inside+Flow%2C+so+an+agent+or+a+test+suite+can+play+the%0Aperson%27s\u0026amp;theme=052dec2df14a3094abf38032\u0026amp;signature=e81e59b0aec49c2e7a6cb84d24a8222fccc65ad87ef1ed34c36f34a40fe5685f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/flow-messaging/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Flow\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0b7a5a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/testing/create-a-simulated-conversation.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.flow.engineer/#organization\",\"name\":\"Flow\",\"url\":\"https://docs.flow.engineer\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.flow.engineer#website\",\"name\":\"Flow\",\"url\":\"https://docs.flow.engineer\",\"publisher\":{\"@id\":\"https://docs.flow.engineer/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation#webpage\",\"url\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation\",\"name\":\"Create a simulated conversation\",\"description\":\"Test keys only. Creates a conversation with a simulated contact, an end user that exists only inside Flow, so an agent or a test suite can play the person's side with no phone and no real channel. Write as the contact with POST /v0/test/conversations/{conversation_id}/inbound; your agent receives each turn exactly like a real message.received and replies with its normal send. Read both sides with GET /v0/test/conversations/{conversation_id}/transcript. The conversation is on your app's simulated sender for the channel (kind simulated), which Flow creates on first use. It never touches a network: sends to the simulated contact pass the real send gate and end sent. Simulated channels: telegram, whatsapp, imessage and sms. The channel's rules hold as on a real sender: a simulated iMessage line, like Flow's lines today, only replies, so the contact writes first; a simulated Telegram bot, like a real one, cannot write to a contact who has not written to it, so a send before the contact's first turn is accepted (202) and then fails as it does on real Telegram (message.failed, channel_error, channel_code 403); on SMS and iMessage a buttons message answers 422 unsupported_content, as on a real line. On WhatsApp, the contact's turns go through the real WhatsApp inbound path, so each turn opens the 24-hour window. Outside it, including before the contact's first turn, only a template can be sent (409 outside_window). Buttons take up to 3 reply buttons (a list up to 10 rows); reactions and reply_to work; edits and unsends answer 422 unsupported_content. On SMS, the rules that concern the contact hold too. Before the contact's first turn, a send to them is a start that needs their recorded consent: without consent (on POST /v0/messages with to.contact), it answers 403 permission with channel_code consent_required, as a real SMS start does. A turn with the text STOP opts the contact out and START lifts it (see POST /v0/test/conversations/{conversation_id}/inbound). A simulated SMS sender keeps no quiet hours, so a test's outcome never depends on the time of day, and it sends media and voice as MMS. Creating the conversation sends no event. The conversation starts with its first message: the contact's first turn (via inbound), or your first send to the contact, such as a WhatsApp template or an SMS send with consent (via outbound). conversation.started comes before that message's message.received or message.sent. On iMessage, group makes a simulated group conversation instead (type group, with the participants as simulated contacts), so you can test how your agent handles groups: each turn names its writer in from, and the gate applies the group rules (reactions refused with channel_code group_unsupported, as are typing and read receipts). Each call with group makes a new group. Give contact to choose the simulated contact's address; giving an address that already has a simulated conversation returns that conversation (200). Without contact, Flow makes a new contact with a made-up address (phone numbers start +1555), so each call is a fresh conversation, for example one per test case. Simulated contacts never match real ones, even with the same address. Simulated traffic is free: it does not count against the sandbox allowance. An app has at most 500 simulated conversations: past that, a new one answers 403 permission with channel_code simulated_conversation_limit (an address that has one still returns it with 200), so reuse conversations across test runs. The /v0/test/ endpoints take at most 120 requests a minute per key (429 rate_limited), on top of the plan's request rate limit. A live key answers 403 permission with channel_code test_mode_only. A HIPAA account (Account.hipaa) can simulate only the channels its business associate agreement covers (SMS), as it can connect senders only there: telegram, whatsapp or imessage answers 403 permission with channel_code hipaa_channel_not_covered (param channel).\",\"dateModified\":\"2026-10-24T16:17:30.743Z\",\"isPartOf\":{\"@id\":\"https://docs.flow.engineer#website\"},\"breadcrumb\":{\"@id\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HTTP API\",\"item\":\"https://docs.flow.engineer/unified-messaging-api/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a simulated conversation\",\"item\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation#apireference\",\"headline\":\"Create a simulated conversation\",\"name\":\"Create a simulated conversation\",\"description\":\"Test keys only. Creates a conversation with a simulated contact, an end user that exists only inside Flow, so an agent or a test suite can play the person's side with no phone and no real channel. Write as the contact with POST /v0/test/conversations/{conversation_id}/inbound; your agent receives each turn exactly like a real message.received and replies with its normal send. Read both sides with GET /v0/test/conversations/{conversation_id}/transcript. The conversation is on your app's simulated sender for the channel (kind simulated), which Flow creates on first use. It never touches a network: sends to the simulated contact pass the real send gate and end sent. Simulated channels: telegram, whatsapp, imessage and sms. The channel's rules hold as on a real sender: a simulated iMessage line, like Flow's lines today, only replies, so the contact writes first; a simulated Telegram bot, like a real one, cannot write to a contact who has not written to it, so a send before the contact's first turn is accepted (202) and then fails as it does on real Telegram (message.failed, channel_error, channel_code 403); on SMS and iMessage a buttons message answers 422 unsupported_content, as on a real line. On WhatsApp, the contact's turns go through the real WhatsApp inbound path, so each turn opens the 24-hour window. Outside it, including before the contact's first turn, only a template can be sent (409 outside_window). Buttons take up to 3 reply buttons (a list up to 10 rows); reactions and reply_to work; edits and unsends answer 422 unsupported_content. On SMS, the rules that concern the contact hold too. Before the contact's first turn, a send to them is a start that needs their recorded consent: without consent (on POST /v0/messages with to.contact), it answers 403 permission with channel_code consent_required, as a real SMS start does. A turn with the text STOP opts the contact out and START lifts it (see POST /v0/test/conversations/{conversation_id}/inbound). A simulated SMS sender keeps no quiet hours, so a test's outcome never depends on the time of day, and it sends media and voice as MMS. Creating the conversation sends no event. The conversation starts with its first message: the contact's first turn (via inbound), or your first send to the contact, such as a WhatsApp template or an SMS send with consent (via outbound). conversation.started comes before that message's message.received or message.sent. On iMessage, group makes a simulated group conversation instead (type group, with the participants as simulated contacts), so you can test how your agent handles groups: each turn names its writer in from, and the gate applies the group rules (reactions refused with channel_code group_unsupported, as are typing and read receipts). Each call with group makes a new group. Give contact to choose the simulated contact's address; giving an address that already has a simulated conversation returns that conversation (200). Without contact, Flow makes a new contact with a made-up address (phone numbers start +1555), so each call is a fresh conversation, for example one per test case. Simulated contacts never match real ones, even with the same address. Simulated traffic is free: it does not count against the sandbox allowance. An app has at most 500 simulated conversations: past that, a new one answers 403 permission with channel_code simulated_conversation_limit (an address that has one still returns it with 200), so reuse conversations across test runs. The /v0/test/ endpoints take at most 120 requests a minute per key (429 rate_limited), on top of the plan's request rate limit. A live key answers 403 permission with channel_code test_mode_only. A HIPAA account (Account.hipaa) can simulate only the channels its business associate agreement covers (SMS), as it can connect senders only there: telegram, whatsapp or imessage answers 403 permission with channel_code hipaa_channel_not_covered (param channel).\",\"url\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation\",\"mainEntityOfPage\":{\"@id\":\"https://docs.flow.engineer/api-reference/testing/create-a-simulated-conversation#webpage\"},\"dateModified\":\"2026-10-24T16:17:30.743Z\",\"publisher\":{\"@id\":\"https://docs.flow.engineer/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.flow.engineer#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Flow\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Flow","nav":{"global":null,"tabs":[{"tab":"Framework","pages":[{"title":"Framework","href":"/framework"}]},{"tab":"Messaging API","groups":[{"group":"Get started","pages":[{"title":"Unified Messaging API","sidebarTitle":"Introduction","icon":"comments","href":"/unified-messaging-api"},{"title":"Send your first reply","sidebarTitle":"Quickstart","icon":"rocket","href":"/unified-messaging-api/quickstart"},{"title":"Keys and sign-in","sidebarTitle":"Keys \u0026 sign-in","icon":"key","href":"/unified-messaging-api/get-a-key"},{"title":"Build with a coding agent","sidebarTitle":"For coding agents","icon":"robot","href":"/unified-messaging-api/coding-agents"},{"title":"Build for real conversations","sidebarTitle":"Real conversations","icon":"users","href":"/unified-messaging-api/guides/real-people"},{"title":"Messaging MCP server","sidebarTitle":"Development MCP","icon":"plug","href":"/unified-messaging-api/mcp"},{"title":"Pricing and allowances","sidebarTitle":"Pricing","icon":"credit-card","href":"/unified-messaging-api/pricing"}]},{"group":"Observe","pages":[{"title":"Observe conversations","sidebarTitle":"Overview","icon":"eye","href":"/unified-messaging-api/observe/index"},{"title":"Connect Messaging to Observe","sidebarTitle":"Messaging integration","icon":"comments","href":"/unified-messaging-api/observe/flow-messaging"},{"title":"Send traces to Observe","sidebarTitle":"Traces","icon":"chart-line","href":"/unified-messaging-api/observe/traces"},{"title":"Trace your agent framework","sidebarTitle":"Framework integrations","icon":"diagram-project","href":"/unified-messaging-api/observe/frameworks"}]},{"group":"Test before you ship","pages":[{"title":"Test your integration","sidebarTitle":"Testing","icon":"flask","href":"/unified-messaging-api/trust"}]},{"group":"Concepts","pages":[{"title":"Connect a sender","sidebarTitle":"Senders","icon":"phone","href":"/unified-messaging-api/concepts/senders"},{"title":"Conversations and contacts","sidebarTitle":"Conversations","icon":"comments","href":"/unified-messaging-api/concepts/conversations"},{"title":"Send text, media and buttons","sidebarTitle":"Message kinds","icon":"shapes","href":"/unified-messaging-api/concepts/content-types"},{"title":"Receive events","sidebarTitle":"Events \u0026 webhooks","icon":"webhook","href":"/unified-messaging-api/concepts/events-and-webhooks"},{"title":"Stream replies","sidebarTitle":"Streaming replies","icon":"water","href":"/unified-messaging-api/concepts/streaming-replies"},{"title":"Sending rules","sidebarTitle":"Sending rules","icon":"shield-check","href":"/unified-messaging-api/concepts/send-gate"},{"title":"Test and live mode","sidebarTitle":"Test \u0026 live mode","icon":"toggle-on","href":"/unified-messaging-api/concepts/test-and-live-mode"},{"title":"Retry without duplicate sends","sidebarTitle":"Idempotency","icon":"repeat","href":"/unified-messaging-api/concepts/idempotency"},{"title":"Retention and deletion","sidebarTitle":"Retention \u0026 deletion","icon":"database","href":"/unified-messaging-api/concepts/data-retention"},{"title":"API versions","sidebarTitle":"Versioning","icon":"code-branch","href":"/unified-messaging-api/concepts/versioning"},{"title":"Rate limits","sidebarTitle":"Rate limits","icon":"gauge","href":"/unified-messaging-api/concepts/rate-limits"}]},{"group":"Channel guides","pages":[{"title":"Telegram","sidebarTitle":"Telegram","icon":"telegram","href":"/unified-messaging-api/guides/telegram-agent"},{"title":"iMessage","sidebarTitle":"iMessage","icon":"message","href":"/unified-messaging-api/guides/imessage-agent"},{"title":"WhatsApp","sidebarTitle":"WhatsApp","icon":"whatsapp","href":"/unified-messaging-api/guides/whatsapp-agent"},{"title":"Local development","sidebarTitle":"Local development","icon":"laptop-code","href":"/unified-messaging-api/guides/local-development"},{"title":"Go live","sidebarTitle":"Going live","icon":"flag-checkered","href":"/unified-messaging-api/guides/going-live"},{"title":"Messaging recipes","sidebarTitle":"Recipes","icon":"book-open","href":"/unified-messaging-api/guides/recipes"}]},{"group":"Agent frameworks","pages":[{"title":"Vercel AI SDK","sidebarTitle":"Vercel AI SDK","icon":"code","href":"/unified-messaging-api/frameworks/vercel-ai-sdk"},{"title":"OpenAI Agents SDK","sidebarTitle":"OpenAI Agents SDK","icon":"code","href":"/unified-messaging-api/frameworks/openai-agents-sdk"},{"title":"Claude Agent SDK","sidebarTitle":"Claude Agent SDK","icon":"code","href":"/unified-messaging-api/frameworks/claude-agent-sdk"},{"title":"LangChain","sidebarTitle":"LangChain","icon":"link","href":"/unified-messaging-api/frameworks/langchain"},{"title":"Mastra","sidebarTitle":"Mastra","icon":"code","href":"/unified-messaging-api/frameworks/mastra"}]},{"group":"Compare","pages":[{"title":"Choose a messaging API","sidebarTitle":"Choose an API","icon":"scale-balanced","href":"/unified-messaging-api/compare/choosing-a-messaging-api"},{"title":"Flow and Photon","sidebarTitle":"Flow vs Photon","icon":"scale-balanced","href":"/unified-messaging-api/compare/flow-vs-photon"}]},{"group":"HTTP API","pages":[{"group":"Overview","expanded":false,"pages":[{"title":"HTTP API","sidebarTitle":"API overview","icon":"code","href":"/unified-messaging-api/api-reference/introduction"}]},{"group":"Messages","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/basic","title":"Send a basic message (text, or media with a caption)","href":"/api-reference/messages/send-a-basic-message-text-or-media-with-a-caption"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/voice","title":"Send a voice note","href":"/api-reference/messages/send-a-voice-note"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/buttons","title":"Send text with buttons","href":"/api-reference/messages/send-text-with-buttons"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/list","title":"Send a list to pick one option from","href":"/api-reference/messages/send-a-list-to-pick-one-option-from"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/carousel","title":"Send a carousel of cards","href":"/api-reference/messages/send-a-carousel-of-cards"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/template","title":"Send a WhatsApp template","href":"/api-reference/messages/send-a-whatsapp-template"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/contact-card","title":"Send a contact card","href":"/api-reference/messages/send-a-contact-card"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/location","title":"Send a place","href":"/api-reference/messages/send-a-place"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/effect","title":"Send text with an iMessage effect","href":"/api-reference/messages/send-text-with-an-imessage-effect"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/reaction","title":"React to a message","href":"/api-reference/messages/react-to-a-message"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/messages","title":"Start a conversation","href":"/api-reference/messages/start-a-conversation"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/messages/{message_id}","title":"Get a message","href":"/api-reference/messages/get-a-message"},{"openapi":"unified-messaging-api/openapi.yaml PATCH /v0/messages/{message_id}","title":"Edit a sent message","href":"/api-reference/messages/edit-a-sent-message"},{"openapi":"unified-messaging-api/openapi.yaml DELETE /v0/messages/{message_id}","title":"Unsend a message","href":"/api-reference/messages/unsend-a-message"}]},{"group":"Conversations","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml GET /v0/conversations","title":"List conversations","href":"/api-reference/conversations/list-conversations"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/conversations/{conversation_id}","title":"Get a conversation","href":"/api-reference/conversations/get-a-conversation"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/conversations/{conversation_id}/messages","title":"List a conversation's messages","href":"/api-reference/conversations/list-a-conversations-messages"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/typing","title":"Show the typing indicator","href":"/api-reference/conversations/show-the-typing-indicator"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/conversations/{conversation_id}/read","title":"Mark messages as read","href":"/api-reference/conversations/mark-messages-as-read"}]},{"group":"Events","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml GET /v0/events","title":"List events","href":"/api-reference/events/list-events"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/events/{event_id}","title":"Get an event","href":"/api-reference/events/get-an-event"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/stream","title":"Open the live event stream (WebSocket)","href":"/api-reference/stream/open-the-live-event-stream-websocket"},{"openapi":"unified-messaging-api/openapi.yaml webhook event","title":"An event delivered to your endpoint","href":"/api-reference/webhook-endpoints/an-event-delivered-to-your-endpoint"}]},{"group":"Webhook endpoints","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml GET /v0/webhook_endpoints","title":"List webhook endpoints","href":"/api-reference/webhook-endpoints/list-webhook-endpoints"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/webhook_endpoints","title":"Create a webhook endpoint","href":"/api-reference/webhook-endpoints/create-a-webhook-endpoint"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/webhook_endpoints/{webhook_endpoint_id}","title":"Get a webhook endpoint","href":"/api-reference/webhook-endpoints/get-a-webhook-endpoint"},{"openapi":"unified-messaging-api/openapi.yaml PATCH /v0/webhook_endpoints/{webhook_endpoint_id}","title":"Update a webhook endpoint","href":"/api-reference/webhook-endpoints/update-a-webhook-endpoint"},{"openapi":"unified-messaging-api/openapi.yaml DELETE /v0/webhook_endpoints/{webhook_endpoint_id}","title":"Delete a webhook endpoint","href":"/api-reference/webhook-endpoints/delete-a-webhook-endpoint"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/webhook_endpoints/{webhook_endpoint_id}/rotate_secret","title":"Rotate a webhook endpoint's signing secret","href":"/api-reference/webhook-endpoints/rotate-a-webhook-endpoints-signing-secret"}]},{"group":"Files","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml POST /v0/files","title":"Upload a file","href":"/api-reference/files/upload-a-file"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/files/{file_id}","title":"Download a file","href":"/api-reference/files/download-a-file"}]},{"group":"Senders and templates","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml GET /v0/senders","title":"List senders","href":"/api-reference/senders/list-senders"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/senders","title":"Request a dedicated sender","href":"/api-reference/senders/request-a-dedicated-sender"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/senders/{sender_id}","title":"Get a sender","href":"/api-reference/senders/get-a-sender"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/templates","title":"List templates","href":"/api-reference/templates/list-templates"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/templates","title":"Create a template","href":"/api-reference/templates/create-a-template"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/templates/{template_id}","title":"Get a template","href":"/api-reference/templates/get-a-template"},{"openapi":"unified-messaging-api/openapi.yaml DELETE /v0/templates/{template_id}","title":"Delete a template","href":"/api-reference/templates/delete-a-template"},{"openapi":"unified-messaging-api/openapi.yaml DELETE /v0/senders/{sender_id}","title":"Disconnect a sender","href":"/api-reference/senders/disconnect-a-sender"}]},{"group":"Contacts and app","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml GET /v0/contacts","title":"List contacts","href":"/api-reference/contacts/list-contacts"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/contacts/{contact_id}","title":"Get a contact","href":"/api-reference/contacts/get-a-contact"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/app","title":"Get the calling app","href":"/api-reference/app/get-the-calling-app"},{"openapi":"unified-messaging-api/openapi.yaml DELETE /v0/contacts/{contact_id}","title":"Delete a contact and their data","href":"/api-reference/contacts/delete-a-contact-and-their-data"}]},{"group":"Onboarding","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml POST /v0/sandbox/keys","title":"Get a test key without an account","href":"/api-reference/onboarding/get-a-test-key-without-an-account"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/device/authorizations","title":"Start a sign-in from an agent or CLI (device flow)","href":"/api-reference/onboarding/start-a-sign-in-from-an-agent-or-cli-device-flow"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/device/token","title":"Poll a device sign-in for its key","description":"Answers the state of a sign-in started with `POST /v0/device/authorizations`.\nWhile the person has not finished, `status` is `pending`: wait `interval`\nseconds and poll again. Polling faster answers `429 rate_limited` with\n`retry_after`. Once they approve, `status` is `approved` and the answer\nholds a new `fk_test_` key, shown once; the device code is then used up,\nand later polls answer `expired`. If the sign-in claimed a sandbox app,\nthat app's sandbox keys stop working when this key is handed out: replace\n`FLOW_MESSAGING_KEY` with it. (A claim through `claim_url` in a browser\nhands out no key, and revokes the sandbox key unless the person chooses to\nkeep their agent's key working.) `denied` means the person refused, and\n`expired` that the code ran out (after `expires_in` seconds): start again.\nPolls are also limited per client network, unknown codes included.\n","href":"/api-reference/onboarding/poll-a-device-sign-in-for-its-key"}]},{"group":"Simulated conversations","expanded":false,"pages":[{"openapi":"unified-messaging-api/openapi.yaml POST /v0/test/conversations","title":"Create a simulated conversation","href":"/api-reference/testing/create-a-simulated-conversation"},{"openapi":"unified-messaging-api/openapi.yaml POST /v0/test/conversations/{conversation_id}/inbound","title":"Write as the simulated contact","description":"Test keys only. Posts one inbound turn from the simulated contact of a\nsimulated conversation. It goes through the same inbound path as a real\nchannel's message: Flow stores it, then delivers it as a `message.received`\nevent by webhook, on the stream and in the event log, in order with the\nconversation's other events. A webhook answer's `reply` works as usual. The\nanswer comes before delivery; the `message.received` event carries the\n`message` ID given here.\n\n`content` is what the contact sends, as a kind object with `kind`: `basic`\n(`text` and/or `media`), `voice`, `location`, `contact_card` or\n`button_reply` (a tap on a reply button of a buttons or carousel message\nyour agent sent, or on a row of a list, given as its `message_id` and\n`button_id`: Flow fills in the `label`). Media and voice take the\n`file_id` of a file uploaded with `POST /v0/files` (no `url`); the contact's\nmessage refers to that same file (its `file_id`, `url`, `mime_type` and\n`size_bytes`): Flow does not copy it again. The channel's rules apply:\nwhat it cannot carry from a person (a document over SMS, a location over\nSMS, a file larger than the channel fetches from a person) answers\n`422 unsupported_content`, and text over the channel's limit answers\n`400 invalid_request`.\n\nOn SMS, the keywords work as from a real phone, matched against the whole\ntext. STOP (or STOPALL, UNSUBSCRIBE, CANCEL, END, QUIT, REVOKE, OPT OUT,\nOPTOUT) opts the simulated contact out against the simulated sender: the\ncontact's `opted_out_at` is set and `opted_out_via` is `keyword`, and sends\nto them answer `403 permission` with `channel_code` `contact_opted_out`.\nSTART (or UNSTOP, YES) lifts it. The turn is still delivered as\n`message.received`. A keyword reply is never recorded as a message, so the\ntranscript shows no automatic reply to STOP, START or HELP.\n\nOn WhatsApp, each turn opens the conversation's 24-hour window, as a real\ncontact's message does.\n\nA conversation that is not simulated answers `403 permission` with\n`channel_code` `not_simulated`; a live key answers `403 permission` with\n`channel_code` `test_mode_only`. In a HIPAA account (`Account.hipaa`), a\nturn on a simulated `telegram`, `whatsapp` or `imessage` conversation (one made before\nthe flag was set) answers `403 permission` with `channel_code`\n`hipaa_channel_not_covered` (`param` `conversation_id`).\n","href":"/api-reference/testing/write-as-the-simulated-contact"},{"openapi":"unified-messaging-api/openapi.yaml GET /v0/test/conversations/{conversation_id}/transcript","title":"Read a simulated conversation, both ways","href":"/api-reference/testing/read-a-simulated-conversation-both-ways"}]},{"group":"Errors","expanded":false,"pages":[{"title":"invalid_request","href":"/unified-messaging-api/errors/invalid_request"},{"title":"authentication","href":"/unified-messaging-api/errors/authentication"},{"title":"permission","href":"/unified-messaging-api/errors/permission"},{"title":"not_found","href":"/unified-messaging-api/errors/not_found"},{"title":"idempotency_conflict","href":"/unified-messaging-api/errors/idempotency_conflict"},{"title":"outside_window","href":"/unified-messaging-api/errors/outside_window"},{"title":"unsupported_content","href":"/unified-messaging-api/errors/unsupported_content"},{"title":"new_contact_limit","href":"/unified-messaging-api/errors/new_contact_limit"},{"title":"sender_throttled","href":"/unified-messaging-api/errors/sender_throttled"},{"title":"file_blocked","href":"/unified-messaging-api/errors/file_blocked"},{"title":"rate_limited","href":"/unified-messaging-api/errors/rate_limited"},{"title":"channel_error","href":"/unified-messaging-api/errors/channel_error"},{"title":"not_implemented","href":"/unified-messaging-api/errors/not_implemented"},{"title":"api_error","href":"/unified-messaging-api/errors/api_error"}]}]}]}]},"title":"Create a simulated conversation - Flow","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Markdown--GF7ZIpf.js","clsx-DZLdJUrt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-2LoAhjKH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Zwc0ZncM.js"]}