{"openapi":"3.1.0","info":{"title":"bubblr API","version":"1.0.0","summary":"iMessage and SMS phone lines with calling, for teams and their AI agents.","description":"Send and receive iMessage and SMS from a real US or Canadian number, get signed webhooks for every event, place and route calls, and connect voice agents. Authenticate with an API key: `Authorization: Bearer sk_live_…`. Errors are always `{ \"error\": { \"code\", \"message\" } }`. Docs: https://bubblr.io/docs/","contact":{"name":"bubblr","url":"https://bubblr.io/docs/","email":"hello@bubblr.io"}},"servers":[{"url":"https://api.bubblr.io"}],"security":[{"apiKey":[]}],"tags":[{"name":"Lines","description":"Your phone lines (called profiles in the API, `prf_…`), whether each one works, and its activity."},{"name":"Messages","description":"Send iMessage and SMS, read and search messages, react, and upload files to send."},{"name":"Chats","description":"Conversations on a line, their messages and files, typing indicators and read receipts."},{"name":"Drafts","description":"Messages that draft-only keys write and a person approves before they go out."},{"name":"Events","description":"The live event stream (Server-Sent Events)."},{"name":"Webhooks","description":"Endpoints that receive signed events, their deliveries and retries."},{"name":"Contacts","description":"Names, companies, tags and notes your team keeps on the people it talks to."},{"name":"Calls","description":"The call log, placing calls, transfers, hang-ups and voicemail."},{"name":"Voice agents","description":"Connect your voice AI over SIP or a stream, and choose who answers the line's calls."},{"name":"Account","description":"The calling key, and prices."}],"paths":{"/v1/profiles":{"get":{"operationId":"listProfiles","summary":"List lines","description":"The lines this key can use, oldest first. A key limited to some lines sees only those.","tags":["Lines"],"responses":{"200":{"description":"The lines.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Profile"}},"has_more":{"type":"boolean","description":"More items exist after this page."}},"required":["data","has_more"]},"example":{"data":[{"id":"prf_2Wq8nT4kLm","object":"profile","slug":"front-desk","label":"Front desk","status":"active","state":"working","phone_number":"+14155550123","calling_on_plan":true,"call_forwarding":{"forward_to":null,"status":"off"},"sending_paused":false,"created_at":"2026-11-01T15:00:00.000Z"}],"has_more":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":null,"x-bubblr-sdk":"profiles.list"}},"/v1/profiles/{profile_id}":{"get":{"operationId":"getProfile","summary":"Get a line","description":"One line: its name, number and `state`. A line the key can't use answers 404.","tags":["Lines"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"The line.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"},"example":{"id":"prf_2Wq8nT4kLm","object":"profile","slug":"front-desk","label":"Front desk","status":"active","state":"working","phone_number":"+14155550123","calling_on_plan":true,"call_forwarding":{"forward_to":null,"status":"off"},"sending_paused":false,"created_at":"2026-11-01T15:00:00.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":null,"x-bubblr-sdk":"profiles.get"}},"/v1/profiles/{profile_id}/status":{"get":{"operationId":"getProfileStatus","summary":"Get a line's status","description":"Whether the line works right now, how many sends are waiting in its queue, and how many drafts wait for approval.","tags":["Lines"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"The status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileStatus"},"example":{"object":"profile_status","profile_id":"prf_2Wq8nT4kLm","status":"active","state":"working","message":null,"queued_messages":0,"oldest_queued_at":null,"pending_drafts":2,"sending_paused":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"profiles.getStatus"}},"/v1/profiles/{profile_id}/stats":{"get":{"operationId":"getProfileStats","summary":"Get a line's activity","description":"Messages sent, delivered, read, received and failed over the last `days` days, the average reply time, the busiest hour and messages per day, in `time_zone`.","tags":["Lines"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"days","in":"query","required":false,"description":"How many days back, 1–90 (default 30), ending today.","schema":{"default":30,"type":"integer","minimum":1,"maximum":90}},{"name":"time_zone","in":"query","required":false,"description":"An IANA time zone for days and hours (default `UTC`), such as `America/New_York`.","schema":{"default":"UTC","type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"The activity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineStats"},"example":{"object":"line_stats","profile_id":"prf_2Wq8nT4kLm","from":"2026-11-18T05:00:00.000Z","to":"2026-11-20T16:04:05.000Z","time_zone":"America/New_York","days":3,"sent":41,"delivered":39,"read":27,"received":52,"failed":1,"avg_reply_seconds":312,"busiest_hour":{"start":"2026-11-19T11:00","messages":14},"avg_per_hour":2.6,"daily":[{"date":"2026-11-18","sent":12,"received":15},{"date":"2026-11-19","sent":18,"received":22},{"date":"2026-11-20","sent":11,"received":15}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"profiles.getStats","x-bubblr-example-query":{"days":3,"time_zone":"America/New_York"}}},"/v1/profiles/{profile_id}/name-photo":{"get":{"operationId":"getNamePhoto","summary":"Get a line's name and photo","description":"The name and photo the line shares with each new iMessage contact, so people see who is texting instead of a bare number. Asks the line, so it needs the line working. Team admins change them in the app.","tags":["Lines"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"The name and photo.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamePhoto"},"example":{"object":"name_photo","profile_id":"prf_2Wq8nT4kLm","first_name":"Parkside Dental","last_name":null,"has_photo":true,"photo_url":"https://files.bubblr.io/name-photos/…","shared_with_new_contacts":true}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"profiles.getNamePhoto","x-bubblr-errors":["line_unavailable","line_timeout"]}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Get message usage","description":"Inbound, outbound and failed outbound message counts per line for a period. Defaults to this calendar month (UTC).","tags":["Lines"],"parameters":[{"name":"from","in":"query","required":false,"description":"Start, ISO 8601 with an offset (default: the 1st of this month, UTC).","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"to","in":"query","required":false,"description":"End, ISO 8601 with an offset (default: now).","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}],"responses":{"200":{"description":"Counts per line.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"},"example":{"object":"usage","from":"2026-11-01T00:00:00.000Z","to":"2026-11-20T16:04:05.000Z","data":[{"profile_id":"prf_2Wq8nT4kLm","inbound":812,"outbound":640,"outbound_failed":3}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"usage.get"}},"/v1/profiles/{profile_id}/messages":{"post":{"operationId":"sendMessage","summary":"Send a message","description":"Queues a message and answers `202` at once with it (`status: queued`); follow it with webhooks, the event stream or `GET …/messages/{message_id}`. The line sends iMessage when the person has it and falls back to a text otherwise.\n\n**Idempotency:** the `Idempotency-Key` header is required. The same key with the same body returns the same message (`Idempotent-Replayed: true`) and never sends twice; the same key with a different body is `409 idempotency_key_reused`.\n\n**Draft-only keys** get a `draft` back instead (`object: \"draft\"`): nothing is sent until a person approves it.\n\n**Mass texting** isn't allowed: write to people who expect to hear from you. If we pause sending on your account or a line while we review its activity, every send answers `403 sending_paused` (incoming messages still arrive), and a line may have a daily limit on new conversations (`429 new_conversation_limit`); replies are never limited.","tags":["Messages"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"Idempotency-Key","in":"header","required":true,"description":"Any unique string up to 255 characters, such as a UUID. Retrying with the same key never sends twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":1,"maxLength":320,"description":"A phone number, email or group chat id. US and Canadian numbers need no +1: `(415) 555-0142` and `+14155550142` are the same person. Other countries need their `+` code."},"text":{"type":"string","minLength":1,"maxLength":20000,"description":"The message, up to 20,000 characters. Needs `text` or `attachments`, or both."},"service":{"type":"string","enum":["iMessage","RCS","SMS"],"description":"`iMessage`, `RCS` or `SMS`. Leave it out to let the line choose: iMessage when the person has it, else a text."},"attachments":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"},"file_name":{"type":"string","maxLength":255}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"upload_id":{"type":"string","minLength":1,"maxLength":100},"file_name":{"type":"string","maxLength":255}},"required":["upload_id"],"additionalProperties":false}]},"description":"Up to 10 files: `{ url, file_name? }` with a public https URL, or `{ upload_id, file_name? }` for a file uploaded with `POST /v1/profiles/{profile_id}/uploads`."},"reply_to":{"type":"string","minLength":1,"maxLength":100,"description":"A `msg_…` to reply to (an inline reply)."},"effect":{"type":"string","minLength":1,"maxLength":30,"description":"An iMessage effect: `slam`, `loud`, `gentle`, `invisible-ink`, `confetti`, `echo`, `fireworks`, `balloons`, `love`, `lasers`, `celebration`, `shooting-star` or `spotlight`."},"display_name":{"type":"string","maxLength":200,"description":"A name for a new group chat."},"queue":{"default":true,"type":"boolean","description":"While the line has trouble, wait and send once it's back (default `true`). `false` fails at once with `503 line_unavailable` instead."},"queue_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"How long a queued send may wait, 1–1440 minutes (default 15). After that it fails with `line_unavailable`."}},"required":["to"],"additionalProperties":false},"example":{"to":"+14155550142","text":"Hi Hannah, your table for 4 is confirmed for 7 PM."}}}},"responses":{"202":{"description":"The queued message, or a draft for a draft-only key.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"$ref":"#/components/schemas/Draft"}]},"example":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":null,"requested_service":null,"fallback_from":null,"reactions":[],"status":"queued","error":null,"guid":null,"created_at":"2026-11-20T16:04:05.000Z","sent_at":null,"delivered_at":null,"read_at":null,"queue_until":"2026-11-20T16:19:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"messages.send","x-bubblr-errors":["idempotency_key_required","idempotency_key_reused","recipient_not_allowed","rate_limited","new_conversation_limit","sending_paused","payment_required","profile_not_ready","line_unavailable","not_sent_yet"]},"get":{"operationId":"listMessages","summary":"List and search messages","description":"Messages across all of the line's chats, newest first. `q` searches the text (case-insensitive, literal: `%` and `_` aren't wildcards).","tags":["Messages"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Text to search for.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"chat_id","in":"query","required":false,"description":"Only this chat.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`inbound` or `outbound`.","schema":{"type":"string","enum":["inbound","outbound"]}}],"responses":{"200":{"description":"A page of messages.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["data","has_more","next_before"]},"example":{"data":[{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":"iMessage","requested_service":null,"fallback_from":null,"reactions":[{"kind":"love","emoji":null,"from":"+14155550142","at":"2026-11-20T16:04:09.000Z"}],"status":"delivered","error":null,"guid":"6F1C2A9E-0B7D-4E43-9A58-1D2C3B4A5F60","created_at":"2026-11-20T16:04:05.000Z","sent_at":"2026-11-20T16:04:07.000Z","delivered_at":"2026-11-20T16:04:09.000Z","read_at":null,"queue_until":null}],"has_more":false,"next_before":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"messages.list","x-bubblr-pagination":"cursor","x-bubblr-example-query":{"q":"table","limit":20}}},"/v1/messages":{"post":{"operationId":"sendMessageFromOnlyLine","summary":"Send a message (key with one line)","description":"The same as sending from a line, for a key that covers exactly one line: no `profile_id` needed. The SDK's `messages.send` uses it when you leave `profile_id` out.","tags":["Messages"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Any unique string up to 255 characters, such as a UUID. Retrying with the same key never sends twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":1,"maxLength":320,"description":"A phone number, email or group chat id. US and Canadian numbers need no +1: `(415) 555-0142` and `+14155550142` are the same person. Other countries need their `+` code."},"text":{"type":"string","minLength":1,"maxLength":20000,"description":"The message, up to 20,000 characters. Needs `text` or `attachments`, or both."},"service":{"type":"string","enum":["iMessage","RCS","SMS"],"description":"`iMessage`, `RCS` or `SMS`. Leave it out to let the line choose: iMessage when the person has it, else a text."},"attachments":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"},"file_name":{"type":"string","maxLength":255}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"upload_id":{"type":"string","minLength":1,"maxLength":100},"file_name":{"type":"string","maxLength":255}},"required":["upload_id"],"additionalProperties":false}]},"description":"Up to 10 files: `{ url, file_name? }` with a public https URL, or `{ upload_id, file_name? }` for a file uploaded with `POST /v1/profiles/{profile_id}/uploads`."},"reply_to":{"type":"string","minLength":1,"maxLength":100,"description":"A `msg_…` to reply to (an inline reply)."},"effect":{"type":"string","minLength":1,"maxLength":30,"description":"An iMessage effect: `slam`, `loud`, `gentle`, `invisible-ink`, `confetti`, `echo`, `fireworks`, `balloons`, `love`, `lasers`, `celebration`, `shooting-star` or `spotlight`."},"display_name":{"type":"string","maxLength":200,"description":"A name for a new group chat."},"queue":{"default":true,"type":"boolean","description":"While the line has trouble, wait and send once it's back (default `true`). `false` fails at once with `503 line_unavailable` instead."},"queue_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"How long a queued send may wait, 1–1440 minutes (default 15). After that it fails with `line_unavailable`."}},"required":["to"],"additionalProperties":false},"example":{"to":"+14155550142","text":"Hi Hannah, your table for 4 is confirmed for 7 PM."}}}},"responses":{"202":{"description":"The queued message, or a draft for a draft-only key.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"$ref":"#/components/schemas/Draft"}]},"example":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":null,"requested_service":null,"fallback_from":null,"reactions":[],"status":"queued","error":null,"guid":null,"created_at":"2026-11-20T16:04:05.000Z","sent_at":null,"delivered_at":null,"read_at":null,"queue_until":"2026-11-20T16:19:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":null,"x-bubblr-sdk-fallback-for":"sendMessage","x-bubblr-errors":["idempotency_key_required","idempotency_key_reused","recipient_not_allowed","rate_limited","new_conversation_limit","sending_paused","payment_required","line_unavailable"]}},"/v1/profiles/{profile_id}/messages/{message_id}":{"get":{"operationId":"getMessage","summary":"Get a message","description":"One message, with its current `status` and reactions.","tags":["Messages"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"message_id","in":"path","required":true,"description":"The message (`msg_…`).","schema":{"type":"string"},"example":"msg_9KxT3vQ7Pa"}],"responses":{"200":{"description":"The message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":"iMessage","requested_service":null,"fallback_from":null,"reactions":[{"kind":"love","emoji":null,"from":"+14155550142","at":"2026-11-20T16:04:09.000Z"}],"status":"delivered","error":null,"guid":"6F1C2A9E-0B7D-4E43-9A58-1D2C3B4A5F60","created_at":"2026-11-20T16:04:05.000Z","sent_at":"2026-11-20T16:04:07.000Z","delivered_at":"2026-11-20T16:04:09.000Z","read_at":null,"queue_until":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"messages.get"}},"/v1/profiles/{profile_id}/messages/{message_id}/reactions":{"post":{"operationId":"reactToMessage","summary":"React to a message","description":"Adds a tapback (`love`, `like`, `dislike`, `laugh`, `emphasize`, `question`), or takes it back with `remove: true`. iMessage only. Happens at once, so it needs the line working.","tags":["Messages"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"message_id","in":"path","required":true,"description":"The message (`msg_…`).","schema":{"type":"string"},"example":"msg_9KxT3vQ7Pa"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reaction":{"type":"string","enum":["love","like","dislike","laugh","emphasize","question"],"description":"`love`, `like`, `dislike`, `laugh`, `emphasize` or `question`."},"remove":{"type":"boolean","description":"`true` takes the reaction back."}},"required":["reaction"],"additionalProperties":false},"example":{"reaction":"love"}}}},"responses":{"200":{"description":"The message's reactions now.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"message_id":{"type":"string"},"reaction":{"type":"string","enum":["love","like","dislike","laugh","emphasize","question"]},"removed":{"type":"boolean"},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/Reaction"}}},"required":["ok","message_id","reaction","removed","reactions"]},"example":{"ok":true,"message_id":"msg_9KxT3vQ7Pa","reaction":"love","removed":false,"reactions":[{"kind":"love","emoji":null,"from":"me","at":"2026-11-20T16:05:00.000Z"}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"messages.react","x-bubblr-errors":["imessage_only","not_sent_yet","draft_only_key","recipient_not_allowed","sending_paused","line_unavailable"]}},"/v1/profiles/{profile_id}/uploads":{"post":{"operationId":"createUpload","summary":"Upload a file to send","description":"For files that aren't at a public URL: this answers an `upload_url`; `PUT` the bytes there within 15 minutes, then send with `attachments: [{ upload_id }]`. Uploads can be sent for 7 days.","tags":["Messages"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name."},"mime_type":{"type":"string","maxLength":200,"description":"Its type, such as `image/jpeg`."},"size_bytes":{"type":"integer","minimum":1,"maximum":104857600,"description":"Its exact size in bytes."}},"required":["file_name","size_bytes"],"additionalProperties":false},"example":{"file_name":"menu.jpg","mime_type":"image/jpeg","size_bytes":284112}}}},"responses":{"201":{"description":"Where to upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"},"example":{"id":"upl_2Ck8tF6yRm","object":"upload","profile_id":"prf_2Wq8nT4kLm","file_name":"menu.jpg","size_bytes":284112,"method":"PUT","upload_url":"https://files.bubblr.io/uploads/…?X-Amz-Signature=…","upload_expires_at":"2026-11-20T16:19:05.000Z","expires_at":"2026-11-27T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"uploads.create","x-bubblr-errors":["storage_disabled"]}},"/v1/attachments/{attachment_id}":{"get":{"operationId":"getAttachment","summary":"Download an attachment","description":"Answers `302` to a short-lived download link for a photo or file on a message. Ask again for a new link; don't store it. The first download of a file can take a few seconds.","tags":["Messages"],"parameters":[{"name":"attachment_id","in":"path","required":true,"description":"The attachment (`att_…`), from a message's `attachments`.","schema":{"type":"string"},"example":"att_3Hn6vB1kYt"}],"responses":{"302":{"description":"`Location` is the download link.","headers":{"Location":{"description":"The short-lived link.","schema":{"type":"string","format":"uri"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"attachments.getDownloadUrl","x-bubblr-errors":["attachment_missing","attachment_too_large","line_unavailable","upload_mismatch"]}},"/v1/profiles/{profile_id}/chats":{"get":{"operationId":"listChats","summary":"List chats","description":"The line's chats, most recent first, each with its newest message and unread count. Works while the line has trouble.","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}},{"name":"handle","in":"query","required":false,"description":"The chat with this person (any phone format) or group id.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"assigned_to","in":"query","required":false,"description":"`agent`, `human` or `none`.","schema":{"type":"string","enum":["agent","human","none"]}},{"name":"tag","in":"query","required":false,"description":"Only chats with people your team tagged this way (any case).","schema":{"type":"string","minLength":1,"maxLength":40}}],"responses":{"200":{"description":"A page of chats.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatSummary"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["data","has_more","next_before"]},"example":{"data":[{"id":"cht_5Rf1sD8hJw","object":"chat","profile_id":"prf_2Wq8nT4kLm","handle":"+14155550142","kind":"dm","title":null,"contact":{"name":"Hannah Lee","tags":["VIP"]},"last_message_at":"2026-11-20T16:04:07.000Z","assigned_to":"agent","last_read_at":"2026-11-20T16:04:07.000Z","created_at":"2026-11-02T09:12:44.000Z","unread_count":1,"last_message":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":"iMessage","requested_service":null,"fallback_from":null,"reactions":[{"kind":"love","emoji":null,"from":"+14155550142","at":"2026-11-20T16:04:09.000Z"}],"status":"delivered","error":null,"guid":"6F1C2A9E-0B7D-4E43-9A58-1D2C3B4A5F60","created_at":"2026-11-20T16:04:05.000Z","sent_at":"2026-11-20T16:04:07.000Z","delivered_at":"2026-11-20T16:04:09.000Z","read_at":null,"queue_until":null}}],"has_more":false,"next_before":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"chats.list","x-bubblr-pagination":"cursor","x-bubblr-example-query":{"limit":20}}},"/v1/profiles/{profile_id}/chats/{chat_id}":{"get":{"operationId":"getChat","summary":"Get a chat","description":"One chat, with the name your team gave the person (`contact`).","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"chat_id","in":"path","required":true,"description":"The chat (`cht_…`).","schema":{"type":"string"},"example":"cht_5Rf1sD8hJw"}],"responses":{"200":{"description":"The chat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"},"example":{"id":"cht_5Rf1sD8hJw","object":"chat","profile_id":"prf_2Wq8nT4kLm","handle":"+14155550142","kind":"dm","title":null,"contact":{"name":"Hannah Lee","tags":["VIP"]},"last_message_at":"2026-11-20T16:04:07.000Z","assigned_to":"agent","last_read_at":"2026-11-20T16:04:07.000Z","created_at":"2026-11-02T09:12:44.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"chats.get"},"patch":{"operationId":"updateChat","summary":"Assign a chat or mark it seen","description":"`assigned_to` says who handles the chat (`agent`, `human` or null) and sends `chat.updated`. `seen: true` marks it read in the app (unread count 0) without a read receipt to the other side.","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"chat_id","in":"path","required":true,"description":"The chat (`cht_…`).","schema":{"type":"string"},"example":"cht_5Rf1sD8hJw"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assigned_to":{"anyOf":[{"type":"string","enum":["agent","human"]},{"type":"null"}],"description":"`agent`, `human`, or null for nobody."},"seen":{"type":"boolean","const":true,"description":"`true` sets the unread count to 0 without a read receipt."}},"additionalProperties":false},"example":{"assigned_to":"human"}}}},"responses":{"200":{"description":"The chat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSummary"},"example":{"id":"cht_5Rf1sD8hJw","object":"chat","profile_id":"prf_2Wq8nT4kLm","handle":"+14155550142","kind":"dm","title":null,"contact":{"name":"Hannah Lee","tags":["VIP"]},"last_message_at":"2026-11-20T16:04:07.000Z","assigned_to":"agent","last_read_at":"2026-11-20T16:04:07.000Z","created_at":"2026-11-02T09:12:44.000Z","unread_count":1,"last_message":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":"iMessage","requested_service":null,"fallback_from":null,"reactions":[{"kind":"love","emoji":null,"from":"+14155550142","at":"2026-11-20T16:04:09.000Z"}],"status":"delivered","error":null,"guid":"6F1C2A9E-0B7D-4E43-9A58-1D2C3B4A5F60","created_at":"2026-11-20T16:04:05.000Z","sent_at":"2026-11-20T16:04:07.000Z","delivered_at":"2026-11-20T16:04:09.000Z","read_at":null,"queue_until":null}}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"chats.update"}},"/v1/profiles/{profile_id}/chats/{chat_id}/messages":{"get":{"operationId":"listChatMessages","summary":"List a chat's messages","description":"The chat's messages, newest first, ordered by when they happened.","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"chat_id","in":"path","required":true,"description":"The chat (`cht_…`).","schema":{"type":"string"},"example":"cht_5Rf1sD8hJw"},{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of messages.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["data","has_more","next_before"]},"example":{"data":[{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":"iMessage","requested_service":null,"fallback_from":null,"reactions":[{"kind":"love","emoji":null,"from":"+14155550142","at":"2026-11-20T16:04:09.000Z"}],"status":"delivered","error":null,"guid":"6F1C2A9E-0B7D-4E43-9A58-1D2C3B4A5F60","created_at":"2026-11-20T16:04:05.000Z","sent_at":"2026-11-20T16:04:07.000Z","delivered_at":"2026-11-20T16:04:09.000Z","read_at":null,"queue_until":null}],"has_more":true,"next_before":"msg_9KxT3vQ7Pa"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"chats.listMessages","x-bubblr-pagination":"cursor"}},"/v1/profiles/{profile_id}/chats/{chat_id}/attachments":{"get":{"operationId":"listChatAttachments","summary":"List a chat's files","description":"Photos and files shared in the chat, newest first. `limit` and `before` count messages (`before` is a message id).","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"chat_id","in":"path","required":true,"description":"The chat (`cht_…`).","schema":{"type":"string"},"example":"cht_5Rf1sD8hJw"},{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of files.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatAttachment"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["object","data","has_more","next_before"]},"example":{"object":"list","data":[{"id":"att_3Hn6vB1kYt","file_name":"floorplan.pdf","mime_type":"application/pdf","size_bytes":482113,"url":"/v1/attachments/att_3Hn6vB1kYt","object":"attachment","message_id":"msg_9KxT3vQ7Pa","direction":"inbound","sent_at":"2026-11-20T16:04:07.000Z"}],"has_more":false,"next_before":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"chats.listAttachments","x-bubblr-pagination":"cursor"}},"/v1/profiles/{profile_id}/chats/{chat_id}/read":{"post":{"operationId":"markChatRead","summary":"Mark a chat read","description":"Marks the chat read on the line, which sends read receipts if the line has them on. Needs the line working.","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"chat_id","in":"path","required":true,"description":"The chat (`cht_…`).","schema":{"type":"string"},"example":"cht_5Rf1sD8hJw"}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"chat_id":{"type":"string"}},"required":["ok","chat_id"]},"example":{"ok":true,"chat_id":"cht_5Rf1sD8hJw"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"chats.markRead","x-bubblr-errors":["draft_only_key","recipient_not_allowed","sending_paused","line_unavailable"]}},"/v1/profiles/{profile_id}/typing":{"post":{"operationId":"setTyping","summary":"Show typing","description":"Shows (or stops) the typing indicator in a chat. Give `to` or `chat_id`. Needs the line working.","tags":["Chats"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":1,"maxLength":320,"description":"The person or group id. Give this or `chat_id`."},"chat_id":{"type":"string","description":"The chat. Give this or `to`."},"typing":{"default":true,"type":"boolean","description":"`false` stops it (default `true`)."},"seconds":{"type":"integer","minimum":1,"maximum":60,"description":"Stop after this many seconds, 1–60."}},"additionalProperties":false},"example":{"chat_id":"cht_5Rf1sD8hJw","typing":true}}}},"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"typing":{"type":"boolean"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["ok","typing"]},"example":{"ok":true,"typing":true}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"chats.setTyping","x-bubblr-errors":["draft_only_key","recipient_not_allowed","sending_paused","line_unavailable"]}},"/v1/drafts":{"get":{"operationId":"listDrafts","summary":"List drafts","description":"Drafts written by draft-only keys, newest first.","tags":["Drafts"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}},{"name":"profile_id","in":"query","required":false,"description":"Only this line's drafts.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"`pending`, `approved` or `rejected`.","schema":{"type":"string","enum":["pending","approved","rejected"]}}],"responses":{"200":{"description":"A page of drafts.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Draft"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["data","has_more","next_before"]},"example":{"data":[{"id":"drf_7Lp2mC9xQe","object":"draft","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","to":"+14155550142","text":"Thanks Hannah! Does Thursday at 3 PM work for the viewing?","attachments":[],"reply_to":null,"service":null,"effect":null,"status":"pending","reason":null,"message_id":null,"created_by":"api_key:key_6Nd1rM8pWc","decided_by":null,"decided_at":null,"created_at":"2026-11-20T16:04:05.000Z"}],"has_more":false,"next_before":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"drafts.list","x-bubblr-pagination":"cursor","x-bubblr-example-query":{"status":"pending"}}},"/v1/drafts/{draft_id}":{"get":{"operationId":"getDraft","summary":"Get a draft","description":"One draft.","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"description":"The draft (`drf_…`).","schema":{"type":"string"},"example":"drf_7Lp2mC9xQe"}],"responses":{"200":{"description":"The draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"},"example":{"id":"drf_7Lp2mC9xQe","object":"draft","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","to":"+14155550142","text":"Thanks Hannah! Does Thursday at 3 PM work for the viewing?","attachments":[],"reply_to":null,"service":null,"effect":null,"status":"pending","reason":null,"message_id":null,"created_by":"api_key:key_6Nd1rM8pWc","decided_by":null,"decided_at":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"drafts.get"}},"/v1/drafts/{draft_id}/approve":{"post":{"operationId":"approveDraft","summary":"Approve a draft","description":"Sends the draft, optionally with edited `text`, under the approving key's own limits. The key needs `messages:send` and must not be draft-only. Approving again answers `200` with the same message.","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"description":"The draft (`drf_…`).","schema":{"type":"string"},"example":"drf_7Lp2mC9xQe"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000,"description":"Send this text instead of the draft's."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Already approved: the same message.","content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"$ref":"#/components/schemas/Draft"},"message":{"$ref":"#/components/schemas/Message"}},"required":["draft","message"]}}}},"202":{"description":"Approved and queued.","content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"$ref":"#/components/schemas/Draft"},"message":{"$ref":"#/components/schemas/Message"}},"required":["draft","message"]},"example":{"draft":{"id":"drf_7Lp2mC9xQe","object":"draft","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","to":"+14155550142","text":"Thanks Hannah! Does Thursday at 3 PM work for the viewing?","attachments":[],"reply_to":null,"service":null,"effect":null,"status":"approved","reason":null,"message_id":"msg_9KxT3vQ7Pa","created_by":"api_key:key_6Nd1rM8pWc","decided_by":"user:usr_7Ty2cN5jXa","decided_at":"2026-11-20T16:06:00.000Z","created_at":"2026-11-20T16:04:05.000Z"},"message":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":null,"requested_service":null,"fallback_from":null,"reactions":[],"status":"queued","error":null,"guid":null,"created_at":"2026-11-20T16:04:05.000Z","sent_at":null,"delivered_at":null,"read_at":null,"queue_until":"2026-11-20T16:19:05.000Z"}}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"drafts.approve","x-bubblr-errors":["draft_rejected","draft_only_key","draft_conflict","rate_limited","new_conversation_limit","sending_paused","payment_required"]}},"/v1/drafts/{draft_id}/reject":{"post":{"operationId":"rejectDraft","summary":"Reject a draft","description":"Discards a pending draft, with an optional reason the agent can read. A draft-only key may discard its own drafts.","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"description":"The draft (`drf_…`).","schema":{"type":"string"},"example":"drf_7Lp2mC9xQe"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":1000,"description":"Why, for the agent that wrote it."}},"additionalProperties":false},"example":{"reason":"Wrong day"}}}},"responses":{"200":{"description":"The rejected draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"},"example":{"id":"drf_7Lp2mC9xQe","object":"draft","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","to":"+14155550142","text":"Thanks Hannah! Does Thursday at 3 PM work for the viewing?","attachments":[],"reply_to":null,"service":null,"effect":null,"status":"rejected","reason":"Wrong day","message_id":null,"created_by":"api_key:key_6Nd1rM8pWc","decided_by":"user:usr_7Ty2cN5jXa","decided_at":"2026-11-20T16:06:00.000Z","created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"drafts.reject","x-bubblr-errors":["draft_approved"]}},"/v1/events":{"get":{"operationId":"streamEvents","summary":"Stream events","description":"Server-Sent Events: each event arrives as `event: <type>` and `data: <event JSON>`, the same JSON webhooks get. Live only: events from before you connected aren't replayed, so use webhooks for anything you must not miss. A comment line every 15 seconds keeps the connection open.","tags":["Events"],"parameters":[{"name":"profile_id","in":"query","required":false,"description":"Only this line's events.","schema":{"type":"string"}},{"name":"types","in":"query","required":false,"description":"Comma-separated event types, such as `message.received,message.sent`.","schema":{"type":"string"}}],"responses":{"200":{"description":"A stream of events.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/Event"},"example":{"id":"evt_8Bv3nR7tLx","object":"event","type":"message.received","created_at":"2026-11-20T16:04:05.000Z","profile_id":"prf_2Wq8nT4kLm","data":{"message":{"id":"msg_9KxT3vQ7Pa","object":"message","chat_id":"cht_5Rf1sD8hJw","direction":"inbound","text":"Is the 7 PM table still free?","…":"…"}}}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"events.stream","x-bubblr-example-query":{"types":"message.received"}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List webhooks","description":"The team's webhooks. A key limited to some lines sees only webhooks for those lines.","tags":["Webhooks"],"responses":{"200":{"description":"The webhooks.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"has_more":{"type":"boolean","description":"More items exist after this page."}},"required":["data","has_more"]},"example":{"data":[{"id":"whk_4Td8pZ2rNs","object":"webhook","url":"https://example.com/hooks/bubblr","events":["message.received","message.failed"],"profile_ids":null,"description":"CRM sync","active":true,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}],"has_more":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.list"},"post":{"operationId":"createWebhook","summary":"Create a webhook","description":"Starts sending the chosen events to `url`. The answer has the signing `secret`, shown only this once.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public `https://` URL. No credentials, private or local addresses; redirects aren't followed."},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","message.fallback","message.reaction","draft.created","draft.approved","draft.rejected","chat.updated","profile.online","profile.offline","call.ringing","call.answered","call.transferred","call.ended","call.voicemail","call.transcription","calling.cap_warning"]},"description":"The event types to send, such as `message.received`."},"profile_ids":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},{"type":"null"}],"description":"Only events from these lines. Leave it out (or null) for every line. A key limited to some lines must list them."},"description":{"type":"string","maxLength":500,"description":"A note for people."}},"required":["url","events"],"additionalProperties":false},"example":{"url":"https://example.com/hooks/bubblr","events":["message.received","message.failed"],"description":"CRM sync"}}}},"responses":{"201":{"description":"The webhook and its secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"},"example":{"id":"whk_4Td8pZ2rNs","object":"webhook","url":"https://example.com/hooks/bubblr","events":["message.received","message.failed"],"profile_ids":null,"description":"CRM sync","active":true,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z","secret":"whsec_…"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.create"}},"/v1/webhooks/{webhook_id}":{"get":{"operationId":"getWebhook","summary":"Get a webhook","description":"One webhook (without its secret).","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"}],"responses":{"200":{"description":"The webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"},"example":{"id":"whk_4Td8pZ2rNs","object":"webhook","url":"https://example.com/hooks/bubblr","events":["message.received","message.failed"],"profile_ids":null,"description":"CRM sync","active":true,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.get"},"patch":{"operationId":"updateWebhook","summary":"Update a webhook","description":"Changes its URL, events, lines or description, or pauses it with `active: false`.","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public `https://` URL. No credentials, private or local addresses; redirects aren't followed."},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","message.fallback","message.reaction","draft.created","draft.approved","draft.rejected","chat.updated","profile.online","profile.offline","call.ringing","call.answered","call.transferred","call.ended","call.voicemail","call.transcription","calling.cap_warning"]},"description":"The event types to send, such as `message.received`."},"profile_ids":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},{"type":"null"}],"description":"Only events from these lines. Leave it out (or null) for every line. A key limited to some lines must list them."},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"A note for people."},"active":{"type":"boolean","description":"`false` pauses deliveries."}},"additionalProperties":false},"example":{"active":false}}}},"responses":{"200":{"description":"The webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"},"example":{"id":"whk_4Td8pZ2rNs","object":"webhook","url":"https://example.com/hooks/bubblr","events":["message.received","message.failed"],"profile_ids":null,"description":"CRM sync","active":false,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.update"},"delete":{"operationId":"deleteWebhook","summary":"Delete a webhook","description":"Stops deliveries and deletes the webhook.","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"]},"example":{"id":"whk_4Td8pZ2rNs","object":"webhook","deleted":true}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.delete"}},"/v1/webhooks/{webhook_id}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate a webhook's secret","description":"A new signing secret, shown once. Deliveries are signed with it from now on.","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"}],"responses":{"200":{"description":"The webhook and its new secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecret"},"example":{"id":"whk_4Td8pZ2rNs","object":"webhook","url":"https://example.com/hooks/bubblr","events":["message.received","message.failed"],"profile_ids":null,"description":"CRM sync","active":true,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z","secret":"whsec_…"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.rotateSecret"}},"/v1/webhooks/{webhook_id}/test":{"post":{"operationId":"testWebhook","summary":"Send a test event","description":"Delivers a `webhook.test` event to the webhook, signed and retried like any other.","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"}],"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"delivery_id":{"type":"string"},"event_id":{"type":"string"}},"required":["ok","delivery_id","event_id"]},"example":{"ok":true,"delivery_id":"dlv_6Gy1qW5mKc","event_id":"evt_8Bv3nR7tLx"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.test"}},"/v1/webhooks/{webhook_id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"List deliveries","description":"The webhook's recent deliveries, newest first, with attempts and your endpoint's last answer.","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"},{"name":"limit","in":"query","required":false,"description":"How many, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"description":"`pending`, `success` or `failed`.","schema":{"type":"string","enum":["pending","success","failed"]}}],"responses":{"200":{"description":"Deliveries.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean","description":"More items exist after this page."}},"required":["data","has_more"]},"example":{"data":[{"id":"dlv_6Gy1qW5mKc","object":"webhook_delivery","webhook_id":"whk_4Td8pZ2rNs","event_id":"evt_8Bv3nR7tLx","event_type":"message.received","status":"success","attempts":1,"next_attempt_at":null,"last_status":200,"last_error":null,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:07.000Z"}],"has_more":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.listDeliveries"}},"/v1/webhooks/{webhook_id}/deliveries/{delivery_id}/replay":{"post":{"operationId":"replayWebhookDelivery","summary":"Replay a delivery","description":"Sends a finished delivery (succeeded or failed) again, with a fresh set of attempts.","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"description":"The webhook (`whk_…`).","schema":{"type":"string"},"example":"whk_4Td8pZ2rNs"},{"name":"delivery_id","in":"path","required":true,"description":"The delivery (`dlv_…`).","schema":{"type":"string"},"example":"dlv_6Gy1qW5mKc"}],"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"delivery_id":{"type":"string"},"status":{"type":"string","const":"pending"}},"required":["ok","delivery_id","status"]},"example":{"ok":true,"delivery_id":"dlv_6Gy1qW5mKc","status":"pending"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"webhooks:manage","x-bubblr-sdk":"webhooks.replayDelivery"}},"/v1/contacts":{"get":{"operationId":"listContacts","summary":"List contacts","description":"People your team named, tagged or noted, most recently changed first. `address` looks up several people at once (repeat it or separate with commas, up to 100).","tags":["Contacts"],"parameters":[{"name":"q","in":"query","required":false,"description":"Matches name, company, email or address.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"tag","in":"query","required":false,"description":"Only people with this tag (any case).","schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"address","in":"query","required":false,"description":"Look up these people (repeatable or comma-separated, up to 100).","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of contacts.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["object","data","has_more","next_before"]},"example":{"object":"list","data":[{"id":"ctc_9Pw4gL1sHn","object":"contact","address":"+14155550142","name":"Hannah Lee","company":"Lee Realty","email":"hannah@example.com","tags":["VIP"],"updated_by":"user:usr_7Ty2cN5jXa","created_at":"2026-11-02T09:15:00.000Z","updated_at":"2026-11-20T16:04:05.000Z"}],"has_more":false,"next_before":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"contacts.list","x-bubblr-pagination":"cursor","x-bubblr-example-query":{"tag":"VIP"}}},"/v1/contacts/tags":{"get":{"operationId":"listContactTags","summary":"List tags","description":"The team's tags with how many people have each, most used first.","tags":["Contacts"],"responses":{"200":{"description":"Tags.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactTag"}}},"required":["object","data"]},"example":{"object":"list","data":[{"tag":"VIP","count":12}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"contacts.listTags"}},"/v1/contacts/{address}":{"get":{"operationId":"getContact","summary":"Get a contact","description":"What the team knows about a person. Someone nobody named yet answers an empty contact (`id: null`), not 404.","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"}],"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"},"example":{"id":"ctc_9Pw4gL1sHn","object":"contact","address":"+14155550142","name":"Hannah Lee","company":"Lee Realty","email":"hannah@example.com","tags":["VIP"],"updated_by":"user:usr_7Ty2cN5jXa","created_at":"2026-11-02T09:15:00.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"contacts.get"},"patch":{"operationId":"updateContact","summary":"Update a contact","description":"Creates or updates the person's details. `null` or `\"\"` clears a field. Tags are trimmed and kept in the spelling your team already uses (`vip` → `VIP`), at most 20 of 40 characters. Group chats can't be named.","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Their name."},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Their company."},"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"description":"Their email."},"tags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40},"description":"Replaces their tags."}},"additionalProperties":false},"example":{"name":"Hannah Lee","company":"Lee Realty","tags":["VIP"]}}}},"responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"},"example":{"id":"ctc_9Pw4gL1sHn","object":"contact","address":"+14155550142","name":"Hannah Lee","company":"Lee Realty","email":"hannah@example.com","tags":["VIP"],"updated_by":"user:usr_7Ty2cN5jXa","created_at":"2026-11-02T09:15:00.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"contacts.update","x-bubblr-errors":["group_not_supported"]}},"/v1/contacts/{address}/notes":{"get":{"operationId":"listContactNotes","summary":"List notes","description":"Notes on the person, newest first (up to 200).","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"}],"responses":{"200":{"description":"Notes.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactNote"}},"has_more":{"type":"boolean","description":"More items exist after this page."}},"required":["object","data","has_more"]},"example":{"object":"list","data":[{"id":"cnt_3Vb7xK2qTf","object":"contact_note","address":"+14155550142","body":"Prefers texts after 5 PM.","author":{"type":"user","id":"usr_7Ty2cN5jXa","name":"Sam Ortiz"},"created_by":"user:usr_7Ty2cN5jXa","created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}],"has_more":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"contacts.listNotes"},"post":{"operationId":"createContactNote","summary":"Add a note","description":"Adds a note on the person, up to 5,000 characters.","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000,"description":"The note."}},"required":["body"],"additionalProperties":false},"example":{"body":"Prefers texts after 5 PM."}}}},"responses":{"201":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactNote"},"example":{"id":"cnt_3Vb7xK2qTf","object":"contact_note","address":"+14155550142","body":"Prefers texts after 5 PM.","author":{"type":"api_key","id":"key_6Nd1rM8pWc","name":"CRM sync"},"created_by":"api_key:key_6Nd1rM8pWc","created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"contacts.createNote"}},"/v1/contacts/{address}/notes/{note_id}":{"patch":{"operationId":"updateContactNote","summary":"Edit a note","description":"Only the note's author can edit it.","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"},{"name":"note_id","in":"path","required":true,"description":"The note (`cnt_…`).","schema":{"type":"string"},"example":"cnt_3Vb7xK2qTf"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000,"description":"The new text."}},"required":["body"],"additionalProperties":false},"example":{"body":"Prefers texts after 6 PM."}}}},"responses":{"200":{"description":"The note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactNote"},"example":{"id":"cnt_3Vb7xK2qTf","object":"contact_note","address":"+14155550142","body":"Prefers texts after 5 PM.","author":{"type":"user","id":"usr_7Ty2cN5jXa","name":"Sam Ortiz"},"created_by":"user:usr_7Ty2cN5jXa","created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"contacts.updateNote","x-bubblr-errors":["not_note_author"]},"delete":{"operationId":"deleteContactNote","summary":"Delete a note","description":"The note's author can delete it (and team owners and admins in the app).","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"},{"name":"note_id","in":"path","required":true,"description":"The note (`cnt_…`).","schema":{"type":"string"},"example":"cnt_3Vb7xK2qTf"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"contact_note"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"]},"example":{"id":"cnt_3Vb7xK2qTf","object":"contact_note","deleted":true}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:send","x-bubblr-sdk":"contacts.deleteNote","x-bubblr-errors":["not_note_author"]}},"/v1/contacts/{address}/conversations":{"get":{"operationId":"listContactConversations","summary":"List a contact's chats","description":"The person's chats on the team's lines, each with the line, unread count and newest message.","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"}],"responses":{"200":{"description":"Chats.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}}},"required":["object","data"]},"example":{"object":"list","data":[{"id":"cht_5Rf1sD8hJw","object":"chat","profile_id":"prf_2Wq8nT4kLm","handle":"+14155550142","kind":"dm","title":null,"contact":{"name":"Hannah Lee","tags":["VIP"]},"last_message_at":"2026-11-20T16:04:07.000Z","assigned_to":"agent","last_read_at":"2026-11-20T16:04:07.000Z","created_at":"2026-11-02T09:12:44.000Z","unread_count":1,"last_message":{"id":"msg_9KxT3vQ7Pa","object":"message","profile_id":"prf_2Wq8nT4kLm","chat_id":"cht_5Rf1sD8hJw","chat_handle":"+14155550142","direction":"outbound","sender":null,"text":"Hi Hannah, your table for 4 is confirmed for 7 PM.","attachments":[],"service":"iMessage","requested_service":null,"fallback_from":null,"reactions":[{"kind":"love","emoji":null,"from":"+14155550142","at":"2026-11-20T16:04:09.000Z"}],"status":"delivered","error":null,"guid":"6F1C2A9E-0B7D-4E43-9A58-1D2C3B4A5F60","created_at":"2026-11-20T16:04:05.000Z","sent_at":"2026-11-20T16:04:07.000Z","delivered_at":"2026-11-20T16:04:09.000Z","read_at":null,"queue_until":null},"line":{"id":"prf_2Wq8nT4kLm","label":"Front desk","phone_number":"+14155550123"}}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"messages:read","x-bubblr-sdk":"contacts.listConversations"}},"/v1/contacts/{address}/calls":{"get":{"operationId":"listContactCalls","summary":"List a contact's calls","description":"Recent calls with the person on any line, voicemails included, newest first.","tags":["Contacts"],"parameters":[{"name":"address","in":"path","required":true,"description":"The person's phone number or email, URL-encoded (`%2B14155550142`). Any common phone format works.","schema":{"type":"string"},"example":"+14155550142"},{"name":"limit","in":"query","required":false,"description":"How many, 1–100 (default 20).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Calls.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}}},"required":["object","data"]},"example":{"object":"list","data":[{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"inbound","origin":"pstn","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"completed","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":"2026-11-20T16:04:07.000Z","ended_at":"2026-11-20T16:07:31.000Z","duration_sec":204,"billable_minutes":4,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"contacts.listCalls"}},"/v1/profiles/{profile_id}/calling":{"get":{"operationId":"getLineCalling","summary":"Get a line's calling","description":"Whether the line can place and receive calls right now, and what the team can fix if not (`problems`).","tags":["Calls"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"Calling on the line.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calling"},"example":{"object":"calling","enabled":true,"phone_number":"+14155550123","state":"working","can_place_calls":true,"can_receive_calls":true,"problems":[],"message":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"calling.getLine"}},"/v1/calling":{"get":{"operationId":"getCallingAccount","summary":"Get the team's calling","description":"Minutes this month per line, and the SIP domain and username your voice agent uses to place calls.","tags":["Calls"],"responses":{"200":{"description":"The team's calling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallingAccount"},"example":{"object":"calling_account","enabled":true,"status":"active","month":"2026-11","minutes_used":318,"minutes_cap":null,"outbound_blocked":false,"sip_domain":"acme.sip.example.com","sip_username":"acme","profiles":[{"profile_id":"prf_2Wq8nT4kLm","calls":64,"inbound_minutes":201,"outbound_minutes":117}]}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"calling.getAccount"}},"/v1/profiles/{profile_id}/calls":{"get":{"operationId":"listCalls","summary":"List calls","description":"The line's call log, newest first.","tags":["Calls"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"limit","in":"query","required":false,"description":"Items per page, 1–200 (default 50).","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"The `next_before` of the previous page.","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"`inbound` or `outbound`.","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"with","in":"query","required":false,"description":"Only calls with this number.","schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"chat_id","in":"query","required":false,"description":"Only calls with this chat's person.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Only calls with this `status`.","schema":{"type":"string","maxLength":20}}],"responses":{"200":{"description":"A page of calls.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"has_more":{"type":"boolean","description":"More items exist after this page."},"next_before":{"description":"Pass as `before` for the next page; null on the last one.","type":["string","null"]}},"required":["data","has_more","next_before"]},"example":{"data":[{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"inbound","origin":"pstn","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"completed","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":"2026-11-20T16:04:07.000Z","ended_at":"2026-11-20T16:07:31.000Z","duration_sec":204,"billable_minutes":4,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}],"has_more":false,"next_before":null}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"calls.list","x-bubblr-pagination":"cursor","x-bubblr-example-query":{"with":"+14155550142","limit":1}},"post":{"operationId":"placeCall","summary":"Place a call","description":"Calls `to` from the line's number; when they answer, connects your voice agent (`endpoint_id`) or a teammate's app (`user_id`). US and Canada only; emergency numbers never.\n\n**Idempotency:** the `Idempotency-Key` header is required, like sends: a retry with the same key answers `200` with the same call and never places a second one.","tags":["Calls"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"Idempotency-Key","in":"header","required":true,"description":"Any unique string up to 255 characters, such as a UUID. Retrying with the same key never sends twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":1,"maxLength":40,"description":"The number to call: US or Canada, any common format."},"endpoint_id":{"type":"string","minLength":1,"maxLength":100,"description":"Connect your voice agent (`vep_…`) when they answer. Give this or `user_id`."},"user_id":{"type":"string","minLength":1,"maxLength":100,"description":"Ring a teammate's app (`usr_…`) and connect them when they answer. Give this or `endpoint_id`."},"timeout_seconds":{"type":"integer","minimum":5,"maximum":60,"description":"How long to ring, 5–60 seconds."}},"required":["to"],"additionalProperties":false},"example":{"to":"+14155550142","endpoint_id":"vep_5Qs2hJ9nVb"}}}},"responses":{"200":{"description":"A retry with the same `Idempotency-Key`: the same call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}}},"201":{"description":"The call, ringing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"},"example":{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"outbound","origin":"api","from":"+14155550123","to":"+14155550142","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"queued","handled_by":null,"endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":null,"ended_at":null,"duration_sec":null,"billable_minutes":null,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"calls.place","x-bubblr-errors":["idempotency_key_required","idempotency_key_reused","emergency_number_blocked","destination_not_allowed","calling_not_subscribed","spending_cap_reached","fair_use_paused","caller_id_unverified","calling_not_set_up"]}},"/v1/calls/{call_id}":{"get":{"operationId":"getCall","summary":"Get a call","description":"One call. Your voice agent finds its call id in the `X-Bubblr-Call-Id` header.","tags":["Calls"],"parameters":[{"name":"call_id","in":"path","required":true,"description":"The call (`cal_…`).","schema":{"type":"string"},"example":"cal_1Mx7kP4wZd"}],"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"},"example":{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"inbound","origin":"pstn","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"completed","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":"2026-11-20T16:04:07.000Z","ended_at":"2026-11-20T16:07:31.000Z","duration_sec":204,"billable_minutes":4,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"calls.get"}},"/v1/profiles/{profile_id}/calls/{call_id}":{"get":{"operationId":"getLineCall","summary":"Get a call on a line","description":"The same as `GET /v1/calls/{call_id}`, checking that the call is on this line.","tags":["Calls"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"call_id","in":"path","required":true,"description":"The call (`cal_…`).","schema":{"type":"string"},"example":"cal_1Mx7kP4wZd"}],"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"},"example":{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"inbound","origin":"pstn","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"completed","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":"2026-11-20T16:04:07.000Z","ended_at":"2026-11-20T16:07:31.000Z","duration_sec":204,"billable_minutes":4,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":null}},"/v1/calls/{call_id}/transfer":{"post":{"operationId":"transferCall","summary":"Transfer a call","description":"Moves the outside caller to `team` (every teammate's app), a number (`+1…`), a teammate (`usr_…`) or another voice agent (`vep_…`). This is how a voice agent hands a caller back to people.","tags":["Calls"],"parameters":[{"name":"call_id","in":"path","required":true,"description":"The call (`cal_…`).","schema":{"type":"string"},"example":"cal_1Mx7kP4wZd"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":1,"maxLength":100,"description":"`team`, a US or Canadian number, `usr_…` or `vep_…`."}},"required":["to"],"additionalProperties":false},"example":{"to":"team"}}}},"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"},"example":{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"inbound","origin":"pstn","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"in_progress","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":"2026-11-20T16:04:07.000Z","ended_at":null,"duration_sec":null,"billable_minutes":null,"voicemail":null,"transfers":[{"to":"team","by":"api_key:key_6Nd1rM8pWc","at":"2026-11-20T16:05:12.000Z"}],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"calls.transfer","x-bubblr-errors":["call_not_active","emergency_number_blocked","destination_not_allowed"]}},"/v1/calls/{call_id}/hangup":{"post":{"operationId":"hangUpCall","summary":"Hang up a call","description":"Ends the call for everyone on it.","tags":["Calls"],"parameters":[{"name":"call_id","in":"path","required":true,"description":"The call (`cal_…`).","schema":{"type":"string"},"example":"cal_1Mx7kP4wZd"}],"responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"},"example":{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"inbound","origin":"pstn","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"completed","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":"2026-11-20T16:04:07.000Z","ended_at":"2026-11-20T16:07:31.000Z","duration_sec":204,"billable_minutes":4,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"calls.hangUp","x-bubblr-errors":["call_not_active"]}},"/v1/calls/{call_id}/recording":{"get":{"operationId":"getCallRecording","summary":"Download a voicemail","description":"Answers `302` to a short-lived link to the call's voicemail audio (MP3).","tags":["Calls"],"parameters":[{"name":"call_id","in":"path","required":true,"description":"The call (`cal_…`).","schema":{"type":"string"},"example":"cal_1Mx7kP4wZd"}],"responses":{"302":{"description":"`Location` is the audio link.","headers":{"Location":{"description":"The short-lived link.","schema":{"type":"string","format":"uri"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"calls.getRecordingUrl"}},"/v1/profiles/{profile_id}/voice-endpoints":{"get":{"operationId":"listVoiceEndpoints","summary":"List voice endpoints","description":"The line's voice agents.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"Voice endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceEndpoint"}},"has_more":{"type":"boolean","description":"More items exist after this page."}},"required":["data","has_more"]},"example":{"data":[{"id":"vep_5Qs2hJ9nVb","object":"voice_endpoint","profile_id":"prf_2Wq8nT4kLm","name":"Receptionist agent","kind":"sip","vendor":"other","sip_uri":"sip:+14155550123@agents.example.com;transport=tcp","sip_username":"bubblr","has_sip_password":true,"stream_url":null,"phone_number":null,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}],"has_more":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"voiceEndpoints.list"},"post":{"operationId":"createVoiceEndpoint","summary":"Add a voice endpoint","description":"Connects your voice agent to the line: a SIP address (recommended) or a `wss://` stream. The answer has `signing_secret`, shown once: check `X-Bubblr-Signature` on calls with it.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["sip","stream","phone"],"description":"`sip` (recommended), `stream` (WebSocket audio, for agents without SIP) or `phone` (an agent that has its own phone number: calls go there, then to the team if it doesn't answer)."},"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name for people."},"vendor":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},{"type":"null"}],"description":"Where the agent was built, as a short lowercase name such as `vapi`, `retell` or `other`. Only used for setup help in the app. Optional."},"sip_uri":{"type":"string","minLength":1,"maxLength":300,"description":"For `sip`: the agent's SIP address, such as `sip:+14155550123@agents.example.com;transport=tcp`. Public hosts only, no `?headers`."},"sip_username":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"For `sip`: the username your agent expects (SIP digest). Give both or neither."},"sip_password":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"For `sip`: its password. Write-only."},"stream_url":{"type":"string","minLength":1,"maxLength":500,"description":"For `stream`: a `wss://` URL with no query string."},"phone_number":{"type":"string","minLength":1,"maxLength":40,"description":"For `phone`: the agent's own US/Canada number, typed any way; stored as E.164."}},"required":["kind","name"],"additionalProperties":false},"example":{"kind":"sip","name":"Receptionist agent","sip_uri":"sip:+14155550123@agents.example.com;transport=tcp","sip_username":"bubblr","sip_password":"a-long-random-password"}}}},"responses":{"201":{"description":"The endpoint and its signing secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceEndpointWithSecret"},"example":{"id":"vep_5Qs2hJ9nVb","object":"voice_endpoint","profile_id":"prf_2Wq8nT4kLm","name":"Receptionist agent","kind":"sip","vendor":"other","sip_uri":"sip:+14155550123@agents.example.com;transport=tcp","sip_username":"bubblr","has_sip_password":true,"stream_url":null,"phone_number":null,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z","signing_secret":"vss_…"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voiceEndpoints.create"}},"/v1/profiles/{profile_id}/voice-endpoints/{endpoint_id}":{"get":{"operationId":"getVoiceEndpoint","summary":"Get a voice endpoint","description":"One voice endpoint (never its password or secret).","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"endpoint_id","in":"path","required":true,"description":"The voice endpoint (`vep_…`).","schema":{"type":"string"},"example":"vep_5Qs2hJ9nVb"}],"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceEndpoint"},"example":{"id":"vep_5Qs2hJ9nVb","object":"voice_endpoint","profile_id":"prf_2Wq8nT4kLm","name":"Receptionist agent","kind":"sip","vendor":"other","sip_uri":"sip:+14155550123@agents.example.com;transport=tcp","sip_username":"bubblr","has_sip_password":true,"stream_url":null,"phone_number":null,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"voiceEndpoints.get"},"patch":{"operationId":"updateVoiceEndpoint","summary":"Update a voice endpoint","description":"Changes its name, address or credentials. `null` clears the SIP username and password (both together).","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"endpoint_id","in":"path","required":true,"description":"The voice endpoint (`vep_…`).","schema":{"type":"string"},"example":"vep_5Qs2hJ9nVb"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name for people."},"vendor":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},{"type":"null"}],"description":"Where the agent was built, as a short lowercase name such as `vapi`, `retell` or `other`. Only used for setup help in the app. Optional."},"sip_uri":{"type":"string","minLength":1,"maxLength":300,"description":"For `sip`: the agent's SIP address, such as `sip:+14155550123@agents.example.com;transport=tcp`. Public hosts only, no `?headers`."},"sip_username":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"For `sip`: the username your agent expects (SIP digest). Give both or neither."},"sip_password":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"For `sip`: its password. Write-only."},"stream_url":{"type":"string","minLength":1,"maxLength":500,"description":"For `stream`: a `wss://` URL with no query string."},"phone_number":{"type":"string","minLength":1,"maxLength":40,"description":"For `phone`: the agent's own US/Canada number, typed any way; stored as E.164."}},"additionalProperties":false},"example":{"name":"Receptionist agent v2"}}}},"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceEndpoint"},"example":{"id":"vep_5Qs2hJ9nVb","object":"voice_endpoint","profile_id":"prf_2Wq8nT4kLm","name":"Receptionist agent","kind":"sip","vendor":"other","sip_uri":"sip:+14155550123@agents.example.com;transport=tcp","sip_username":"bubblr","has_sip_password":true,"stream_url":null,"phone_number":null,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voiceEndpoints.update"},"delete":{"operationId":"deleteVoiceEndpoint","summary":"Delete a voice endpoint","description":"Removes it. An endpoint the call routing uses can't be deleted: change the routing first.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"endpoint_id","in":"path","required":true,"description":"The voice endpoint (`vep_…`).","schema":{"type":"string"},"example":"vep_5Qs2hJ9nVb"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"voice_endpoint"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"]},"example":{"id":"vep_5Qs2hJ9nVb","object":"voice_endpoint","deleted":true}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voiceEndpoints.delete","x-bubblr-errors":["endpoint_in_use"]}},"/v1/profiles/{profile_id}/voice-endpoints/{endpoint_id}/rotate-secret":{"post":{"operationId":"rotateVoiceEndpointSecret","summary":"Rotate a voice endpoint's secret","description":"A new signing secret, shown once. Calls are signed with it from now on.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"endpoint_id","in":"path","required":true,"description":"The voice endpoint (`vep_…`).","schema":{"type":"string"},"example":"vep_5Qs2hJ9nVb"}],"responses":{"200":{"description":"The endpoint and its new secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceEndpointWithSecret"},"example":{"id":"vep_5Qs2hJ9nVb","object":"voice_endpoint","profile_id":"prf_2Wq8nT4kLm","name":"Receptionist agent","kind":"sip","vendor":"other","sip_uri":"sip:+14155550123@agents.example.com;transport=tcp","sip_username":"bubblr","has_sip_password":true,"stream_url":null,"phone_number":null,"created_at":"2026-11-20T16:04:05.000Z","updated_at":"2026-11-20T16:04:05.000Z","signing_secret":"vss_…"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voiceEndpoints.rotateSecret"}},"/v1/profiles/{profile_id}/voice-endpoints/{endpoint_id}/test":{"post":{"operationId":"testVoiceEndpoint","summary":"Test a voice endpoint","description":"Calls your SIP agent with a short test message. The outcome arrives as `call.*` events and on the call.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"endpoint_id","in":"path","required":true,"description":"The voice endpoint (`vep_…`).","schema":{"type":"string"},"example":"vep_5Qs2hJ9nVb"}],"responses":{"201":{"description":"The test call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"},"example":{"id":"cal_1Mx7kP4wZd","object":"call","profile_id":"prf_2Wq8nT4kLm","direction":"outbound","origin":"test","from":"+14155550142","to":"+14155550123","remote_number":"+14155550142","chat_id":"cht_5Rf1sD8hJw","status":"queued","handled_by":"voice_ai:vep_5Qs2hJ9nVb","endpoint_id":"vep_5Qs2hJ9nVb","started_at":"2026-11-20T16:04:05.000Z","answered_at":null,"ended_at":null,"duration_sec":null,"billable_minutes":null,"voicemail":null,"transfers":[],"error":null,"created_at":"2026-11-20T16:04:05.000Z"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voiceEndpoints.test","x-bubblr-errors":["calling_not_set_up"]}},"/v1/profiles/{profile_id}/call-routing":{"get":{"operationId":"getCallRouting","summary":"Get call routing","description":"Who answers the line's calls, and in what order.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"The routing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallRouting"},"example":{"object":"call_routing","profile_id":"prf_2Wq8nT4kLm","strategy":"ai_first","forward_to":null,"forward_seconds":null,"endpoint_id":"vep_5Qs2hJ9nVb","ring_seconds":null,"ai_timeout_seconds":10,"hours":null,"voicemail":{"greeting":null,"transcribe":true}}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"callRouting.get","x-bubblr-errors":["calling_not_set_up"]},"put":{"operationId":"updateCallRouting","summary":"Set call routing","description":"Replaces the routing. Fields left out take their defaults.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"strategy":{"default":"team","type":"string","enum":["team","team_first","ai_first","ai_after_hours","forward"],"description":"`team` (default: ring every teammate's app for `ring_seconds`, then voicemail), `team_first` (team, then your voice agent, then voicemail), `ai_first` (your voice agent for `ai_timeout_seconds`, then the team, then voicemail), `ai_after_hours` (inside `hours` like `team`, outside like `ai_first`) or `forward` (ring `forward_to`, then voicemail)."},"forward_to":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}],"description":"For `forward`: the number calls ring, US or Canada in any common format. Kept when you switch to another strategy."},"forward_seconds":{"default":null,"anyOf":[{"type":"integer","minimum":5,"maximum":60},{"type":"null"}],"description":"How long `forward_to` rings before voicemail, 5–60 seconds (default 20)."},"endpoint_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"The voice agent (`vep_…`) for the AI steps. Needed by every strategy but `team` and `forward`."},"ring_seconds":{"default":null,"anyOf":[{"type":"integer","minimum":5,"maximum":120},{"type":"null"}],"description":"How long the team's apps ring, 5–120 seconds."},"ai_timeout_seconds":{"default":null,"anyOf":[{"type":"integer","minimum":3,"maximum":60},{"type":"null"}],"description":"How long your voice agent has to answer, 3–60 seconds (default 10)."},"hours":{"default":null,"anyOf":[{"type":"object","properties":{"timezone":{"type":"string","minLength":1,"maxLength":64},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["timezone","days","start","end"],"additionalProperties":false},{"type":"null"}],"description":"Business hours for `ai_after_hours`: `{ timezone, days, start, end }`, days 0 (Sunday) to 6, times `HH:MM`. Hours past midnight belong to the day they start."},"voicemail":{"default":{"greeting":null,"transcribe":false},"type":"object","properties":{"greeting":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"transcribe":{"default":false,"type":"boolean"}},"additionalProperties":false,"description":"`{ greeting, transcribe }`: the text read before the beep (when there's no recorded greeting), and whether to transcribe voicemails."}},"additionalProperties":false},"example":{"strategy":"ai_first","endpoint_id":"vep_5Qs2hJ9nVb","voicemail":{"transcribe":true}}}}},"responses":{"200":{"description":"The routing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallRouting"},"example":{"object":"call_routing","profile_id":"prf_2Wq8nT4kLm","strategy":"ai_first","forward_to":null,"forward_seconds":null,"endpoint_id":"vep_5Qs2hJ9nVb","ring_seconds":null,"ai_timeout_seconds":10,"hours":null,"voicemail":{"greeting":null,"transcribe":true}}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"callRouting.update","x-bubblr-errors":["calling_not_set_up","forward_loop","forward_not_allowed","invalid_number"]}},"/v1/profiles/{profile_id}/voicemail-greeting":{"get":{"operationId":"getVoicemailGreeting","summary":"Get the voicemail greeting","description":"What callers hear before the beep: the recorded or uploaded greeting, else the routing's `voicemail.greeting` text, else `default_text`.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"The greeting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicemailGreeting"},"example":{"object":"voicemail_greeting","profile_id":"prf_2Wq8nT4kLm","audio":{"url":"https://api.bubblr.io/voice/greetings/vmg_…mp3","content_type":"audio/mpeg","size_bytes":96214,"duration_seconds":6.1,"source":"uploaded","file_name":"greeting.mp3","created_at":"2026-11-20T16:04:05.000Z"},"text":null,"default_text":"Sorry, nobody can take your call right now. Please leave a message after the beep."}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:read","x-bubblr-sdk":"voicemailGreeting.get"},"put":{"operationId":"setVoicemailGreeting","summary":"Upload a voicemail greeting","description":"The request body is the audio file itself: MP3 or WAV, up to 5 MB and 2 minutes, at least half a second. A new greeting replaces the old one.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"},{"name":"source","in":"query","required":false,"description":"`uploaded` (default) or `recorded`.","schema":{"default":"uploaded","type":"string","enum":["recorded","uploaded"]}},{"name":"file_name","in":"query","required":false,"description":"The file's name, for people.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"description":"The MP3 or WAV file.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}},"audio/wav":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The greeting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicemailGreeting"},"example":{"object":"voicemail_greeting","profile_id":"prf_2Wq8nT4kLm","audio":{"url":"https://api.bubblr.io/voice/greetings/vmg_…mp3","content_type":"audio/mpeg","size_bytes":96214,"duration_seconds":6.1,"source":"uploaded","file_name":"greeting.mp3","created_at":"2026-11-20T16:04:05.000Z"},"text":null,"default_text":"Sorry, nobody can take your call right now. Please leave a message after the beep."}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voicemailGreeting.set","x-bubblr-errors":["unsupported_audio","greeting_too_long","greeting_too_short","unreadable_audio","greeting_too_large","calling_not_set_up","storage_disabled"],"x-bubblr-example-query":{"file_name":"greeting.mp3"}},"delete":{"operationId":"deleteVoicemailGreeting","summary":"Delete the voicemail greeting","description":"Removes the recorded or uploaded greeting; callers hear the text greeting again.","tags":["Voice agents"],"parameters":[{"name":"profile_id","in":"path","required":true,"description":"The line (`prf_…`).","schema":{"type":"string"},"example":"prf_2Wq8nT4kLm"}],"responses":{"200":{"description":"The greeting now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicemailGreeting"},"example":{"object":"voicemail_greeting","profile_id":"prf_2Wq8nT4kLm","audio":null,"text":null,"default_text":"Sorry, nobody can take your call right now. Please leave a message after the beep."}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":"calls:write","x-bubblr-sdk":"voicemailGreeting.delete"}},"/v1/me":{"get":{"operationId":"getMe","summary":"Get the calling key","description":"The API key making the request: its team, scopes, the lines it's limited to, and whether it's draft-only. A quick way to check a key works.","tags":["Account"],"responses":{"200":{"description":"The key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIdentity"},"example":{"object":"api_key_identity","key_id":"key_6Nd1rM8pWc","tenant_id":"ten_4Ls9bH3vQk","scopes":["messages:read","messages:send"],"profile_ids":null,"draft_only":false}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":null,"x-bubblr-sdk":"me"}},"/public/plans":{"get":{"operationId":"getPlans","summary":"Get prices","description":"Current prices per line (monthly and yearly, in cents) and whether lines are in stock. No key needed, readable from any website.","tags":["Account"],"security":[],"responses":{"200":{"description":"Prices and stock.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plans"}}}},"default":{"$ref":"#/components/responses/Error"}},"x-bubblr-scope":null,"x-bubblr-sdk":"plans.get"}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_…","description":"An API key from the app (Developers → API keys)."}},"responses":{"Error":{"description":"An error: `code` says which, `message` how to fix it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"ApiKeyIdentity":{"type":"object","properties":{"object":{"type":"string","const":"api_key_identity"},"key_id":{"type":"string","description":"`key_…`"},"tenant_id":{"type":"string","description":"`ten_…`"},"scopes":{"type":"array","items":{"type":"string"}},"profile_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"draft_only":{"type":"boolean"}},"required":["object","key_id","tenant_id","scopes","profile_ids","draft_only"],"description":"The calling key: its team, scopes and limits."},"Attachment":{"type":"object","properties":{"id":{"type":"string","description":"`att_…`"},"file_name":{"type":["string","null"]},"mime_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"url":{"type":"string","description":"A path on the API: `GET` it with your key and follow the `302` to a short-lived download link."}},"required":["id","file_name","mime_type","size_bytes","url"],"description":"A photo or file on a message."},"Call":{"type":"object","properties":{"id":{"type":"string","description":"`cal_…`"},"object":{"type":"string","const":"call"},"profile_id":{"type":"string","description":"`prf_…`"},"direction":{"type":"string","enum":["inbound","outbound"]},"origin":{"type":"string","description":"`pstn` (an outside caller), `browser`, `api`, `sip` (your voice agent dialed out) or `test`."},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"remote_number":{"description":"The other party's number.","type":["string","null"]},"chat_id":{"description":"The chat with the same person, if there is one.","type":["string","null"]},"status":{"type":"string","description":"`queued`, `ringing`, `in_progress`, `completed`, `busy`, `no_answer`, `failed` or `canceled`."},"handled_by":{"description":"`user:usr_…`, `voice_ai:vep_…`, `number:+1…`, `voicemail` or `team`.","type":["string","null"]},"endpoint_id":{"type":["string","null"]},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"duration_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"billable_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rounded up per call."},"voicemail":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"duration_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"transcription":{"type":["string","null"]},"stored":{"type":"boolean"}},"required":["url","duration_sec","transcription","stored"]},{"type":"null"}],"description":"A voicemail left on the call: `GET` its `url` with your key for the audio."},"transfers":{"type":"array","items":{"type":"object","properties":{"to":{"type":"string"},"by":{"type":"string"},"at":{"type":"string"}},"required":["to","by","at"]}},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":["string","null"]}},"required":["code","message"]},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","profile_id","direction","origin","from","to","remote_number","chat_id","status","handled_by","endpoint_id","started_at","answered_at","ended_at","duration_sec","billable_minutes","voicemail","transfers","error","created_at"],"description":"A phone call on a line, in or out."},"Calling":{"type":"object","properties":{"object":{"type":"string","const":"calling"},"enabled":{"type":"boolean"},"phone_number":{"type":["string","null"]},"state":{"type":"string","enum":["off","setting_up","working","having_trouble","suspended"]},"can_place_calls":{"type":"boolean"},"can_receive_calls":{"type":"boolean"},"problems":{"type":"array","items":{"type":"string"},"description":"Only ones the team can fix: `payment_required`, `calling_not_subscribed`, `spending_cap_reached`, `calling_suspended`, `fair_use_paused`."},"message":{"type":["string","null"]}},"required":["object","enabled","phone_number","state","can_place_calls","can_receive_calls","problems","message"],"description":"Calling on one line: its number and whether calls work."},"CallingAccount":{"type":"object","properties":{"object":{"type":"string","const":"calling_account"},"enabled":{"type":"boolean"},"status":{"type":["string","null"]},"month":{"type":"string","description":"`YYYY-MM`, UTC."},"minutes_used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_cap":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"outbound_blocked":{"type":"boolean"},"sip_domain":{"description":"Where your voice agent sends its outbound calls (SIP).","type":["string","null"]},"sip_username":{"type":["string","null"]},"profiles":{"type":"array","items":{"type":"object","properties":{"profile_id":{"type":"string"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inbound_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["profile_id","calls","inbound_minutes","outbound_minutes"]}}},"required":["object","enabled","status","month","minutes_used","minutes_cap","outbound_blocked","sip_domain","sip_username","profiles"],"description":"The team's calling this month."},"CallRouting":{"type":"object","properties":{"strategy":{"default":"team","type":"string","enum":["team","team_first","ai_first","ai_after_hours","forward"]},"forward_to":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"forward_seconds":{"default":null,"anyOf":[{"type":"integer","minimum":5,"maximum":60},{"type":"null"}]},"endpoint_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ring_seconds":{"default":null,"anyOf":[{"type":"integer","minimum":5,"maximum":120},{"type":"null"}]},"ai_timeout_seconds":{"default":null,"anyOf":[{"type":"integer","minimum":3,"maximum":60},{"type":"null"}]},"hours":{"default":null,"anyOf":[{"type":"object","properties":{"timezone":{"type":"string","minLength":1,"maxLength":64},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["timezone","days","start","end"]},{"type":"null"}]},"voicemail":{"default":{"greeting":null,"transcribe":false},"type":"object","properties":{"greeting":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"transcribe":{"default":false,"type":"boolean"}},"required":["greeting","transcribe"]},"object":{"type":"string","const":"call_routing"},"profile_id":{"type":"string","description":"`prf_…`"}},"required":["strategy","forward_to","forward_seconds","endpoint_id","ring_seconds","ai_timeout_seconds","hours","voicemail","object","profile_id"],"description":"Who answers the line's calls."},"Chat":{"type":"object","properties":{"id":{"type":"string","description":"`cht_…`"},"object":{"type":"string","const":"chat"},"profile_id":{"type":"string","description":"`prf_…`"},"handle":{"type":"string","description":"The other side: a phone number (`+1…`), an email, or a group chat id."},"kind":{"type":"string","enum":["dm","group"]},"title":{"description":"The chat's own name (group chats).","type":["string","null"]},"contact":{"anyOf":[{"$ref":"#/components/schemas/ChatContact"},{"type":"null"}]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"assigned_to":{"anyOf":[{"type":"string","enum":["agent","human"]},{"type":"null"}],"description":"Who handles the chat; a flag your agent can read and set."},"last_read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","profile_id","handle","kind","title","contact","last_message_at","assigned_to","last_read_at","created_at"],"description":"A conversation on a line, with one person or a group."},"ChatAttachment":{"type":"object","properties":{"id":{"type":"string","description":"`att_…`"},"file_name":{"type":["string","null"]},"mime_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"url":{"type":"string"},"object":{"type":"string","const":"attachment"},"message_id":{"type":"string","description":"`msg_…`"},"direction":{"type":"string","enum":["inbound","outbound"]},"sent_at":{"type":"string","format":"date-time"}},"required":["id","file_name","mime_type","size_bytes","url","object","message_id","direction","sent_at"],"description":"A photo or file shared in a chat, with the message it came on."},"ChatContact":{"type":"object","properties":{"name":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}}},"required":["name","tags"],"description":"What the team calls the person (contacts), or null when nobody named them."},"ChatSummary":{"type":"object","properties":{"id":{"type":"string","description":"`cht_…`"},"object":{"type":"string","const":"chat"},"profile_id":{"type":"string","description":"`prf_…`"},"handle":{"type":"string","description":"The other side: a phone number (`+1…`), an email, or a group chat id."},"kind":{"type":"string","enum":["dm","group"]},"title":{"description":"The chat's own name (group chats).","type":["string","null"]},"contact":{"anyOf":[{"$ref":"#/components/schemas/ChatContact"},{"type":"null"}]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"assigned_to":{"anyOf":[{"type":"string","enum":["agent","human"]},{"type":"null"}],"description":"Who handles the chat; a flag your agent can read and set."},"last_read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Inbound messages since the chat was last read."},"last_message":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}]}},"required":["id","object","profile_id","handle","kind","title","contact","last_message_at","assigned_to","last_read_at","created_at","unread_count","last_message"],"description":"A chat in a list: the chat, its newest message and its unread count."},"Contact":{"type":"object","properties":{"id":{"description":"`ctc_…`, or null until someone names, tags or notes this person.","type":["string","null"]},"object":{"type":"string","const":"contact"},"address":{"type":"string","description":"Phone numbers are E.164 (`+1…`); emails lowercased."},"name":{"type":["string","null"]},"company":{"type":["string","null"]},"email":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"updated_by":{"type":["string","null"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","object","address","name","company","email","tags","updated_by","created_at","updated_at"],"description":"What the team knows about a person it talks to, shared by every line."},"ContactNote":{"type":"object","properties":{"id":{"type":"string","description":"`cnt_…`"},"object":{"type":"string","const":"contact_note"},"address":{"type":"string"},"body":{"type":"string"},"author":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"created_by":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","address","body","author","created_by","created_at","updated_at"],"description":"A note on a contact."},"ContactTag":{"type":"object","properties":{"tag":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tag","count"]},"Conversation":{"type":"object","properties":{"id":{"type":"string","description":"`cht_…`"},"object":{"type":"string","const":"chat"},"profile_id":{"type":"string","description":"`prf_…`"},"handle":{"type":"string","description":"The other side: a phone number (`+1…`), an email, or a group chat id."},"kind":{"type":"string","enum":["dm","group"]},"title":{"description":"The chat's own name (group chats).","type":["string","null"]},"contact":{"anyOf":[{"$ref":"#/components/schemas/ChatContact"},{"type":"null"}]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"assigned_to":{"anyOf":[{"type":"string","enum":["agent","human"]},{"type":"null"}],"description":"Who handles the chat; a flag your agent can read and set."},"last_read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_message":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}]},"line":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"phone_number":{"type":["string","null"]}},"required":["id","label","phone_number"]}},"required":["id","object","profile_id","handle","kind","title","contact","last_message_at","assigned_to","last_read_at","created_at","unread_count","last_message","line"],"description":"A person's chat on one of the team's lines."},"Draft":{"type":"object","properties":{"id":{"type":"string","description":"`drf_…`"},"object":{"type":"string","const":"draft"},"profile_id":{"type":"string","description":"`prf_…`"},"chat_id":{"type":["string","null"]},"to":{"type":"string"},"text":{"type":["string","null"]},"attachments":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"file_name":{"type":["string","null"]}},"required":["url","file_name"]},{"type":"object","properties":{"upload_id":{"type":"string"},"file_name":{"type":["string","null"]}},"required":["upload_id","file_name"]}]}},"reply_to":{"type":["string","null"]},"service":{"type":["string","null"]},"effect":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected"]},"reason":{"description":"Why it was rejected, if the person said.","type":["string","null"]},"message_id":{"description":"Once approved: the message it became.","type":["string","null"]},"created_by":{"type":"string","description":"`api_key:key_…` (the draft-only key that wrote it)."},"decided_by":{"description":"`user:usr_…` or `api_key:key_…`.","type":["string","null"]},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","profile_id","chat_id","to","text","attachments","reply_to","service","effect","status","reason","message_id","created_by","decided_by","decided_at","created_at"],"description":"A message a draft-only key wrote, waiting for a person to approve it."},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable and machine-readable: branch on this."},"message":{"type":"string","description":"What went wrong and how to fix it, for people."},"details":{"description":"Extra data for some codes: the invalid fields for `validation_failed`, the limit for `rate_limited`."}},"required":["code","message"]}},"required":["error"],"description":"Every error has this shape."},"Event":{"type":"object","properties":{"id":{"type":"string","description":"`evt_…`"},"object":{"type":"string","const":"event"},"type":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","message.fallback","message.reaction","draft.created","draft.approved","draft.rejected","chat.updated","profile.online","profile.offline","call.ringing","call.answered","call.transferred","call.ended","call.voicemail","call.transcription","calling.cap_warning","webhook.test"]},"created_at":{"type":"string","format":"date-time"},"profile_id":{"type":["string","null"]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Depends on `type`: `{ message }` for `message.*`, `{ draft }` for `draft.*`, `{ call }` for `call.*`, `{ chat, changed, by }` for `chat.updated`."}},"required":["id","object","type","created_at","profile_id","data"],"description":"The same JSON goes to webhooks and to the live stream (`GET /v1/events`)."},"LineStats":{"type":"object","properties":{"object":{"type":"string","const":"line_stats"},"profile_id":{"type":"string","description":"`prf_…`"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"time_zone":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avg_reply_seconds":{"description":"From a contact's first unanswered message to the team's next answer; a 12-hour gap starts a new wait.","type":["number","null"]},"busiest_hour":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"messages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["start","messages"]},{"type":"null"}],"description":"Local time."},"avg_per_hour":{"type":"number","description":"Messages per hour between 8 AM and 8 PM local time."},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","sent","received"]},"description":"One row per local day, oldest first, ending today."}},"required":["object","profile_id","from","to","time_zone","days","sent","delivered","read","received","failed","avg_reply_seconds","busiest_hour","avg_per_hour","daily"],"description":"A line's activity over the last `days` days."},"Message":{"type":"object","properties":{"id":{"type":"string","description":"`msg_…`"},"object":{"type":"string","const":"message"},"profile_id":{"type":"string","description":"`prf_…`"},"chat_id":{"type":"string","description":"`cht_…`"},"chat_handle":{"description":"The chat's address: a phone number, email or group chat id.","type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"sender":{"description":"Who sent an inbound message (in group chats, one of the members).","type":["string","null"]},"text":{"type":["string","null"]},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"service":{"description":"How it went or came: `iMessage`, `RCS` or `SMS`. Null until known.","type":["string","null"]},"requested_service":{"description":"The `service` the send asked for, if any.","type":["string","null"]},"fallback_from":{"description":"Set when the message failed over: the service it started on (`iMessage`).","type":["string","null"]},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/Reaction"}},"status":{"type":"string","enum":["queued","dispatched","sent","delivered","read","failed","unconfirmed","received"],"description":"`queued` → `dispatched` → `sent` → `delivered` → `read` (iMessage only), or `failed` / `unconfirmed`. Inbound messages are `received`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},{"type":"null"}],"description":"Why a message failed: `line_unavailable`, `recipient_not_allowed`, `sending_paused`, `unconfirmed` or `send_failed`."},"guid":{"description":"The message's id in Messages, once it has one.","type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"queue_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"While `queued`: when the send gives up if the line is still unavailable."}},"required":["id","object","profile_id","chat_id","direction","sender","text","attachments","service","requested_service","fallback_from","reactions","status","error","guid","created_at","sent_at","delivered_at","read_at","queue_until"],"description":"A message sent or received on a line."},"NamePhoto":{"type":"object","properties":{"object":{"type":"string","const":"name_photo"},"profile_id":{"type":"string","description":"`prf_…`"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"has_photo":{"type":"boolean"},"photo_url":{"description":"A link to the picture, good for 15 minutes.","type":["string","null"]},"shared_with_new_contacts":{"type":["boolean","null"]}},"required":["object","profile_id","first_name","last_name","has_photo","photo_url","shared_with_new_contacts"],"description":"The name and photo the line shares with each new iMessage contact."},"Plans":{"type":"object","properties":{"object":{"type":"string","const":"plans"},"messaging":{"type":"object","properties":{"month":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit (cents), per line."},"currency":{"type":"string"},"interval":{"type":["string","null"]},"unit":{"type":"string","const":"line"}},"required":["amount","currency","interval","unit"]},{"type":"null"}]},"year":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit (cents), per line."},"currency":{"type":"string"},"interval":{"type":["string","null"]},"unit":{"type":"string","const":"line"}},"required":["amount","currency","interval","unit"]},{"type":"null"}]}},"required":["month","year"]},"calling":{"type":"object","properties":{"month":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit (cents), per line."},"currency":{"type":"string"},"interval":{"type":["string","null"]},"unit":{"type":"string","const":"line"}},"required":["amount","currency","interval","unit"]},{"type":"null"}]},"year":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit (cents), per line."},"currency":{"type":"string"},"interval":{"type":["string","null"]},"unit":{"type":"string","const":"line"}},"required":["amount","currency","interval","unit"]},{"type":"null"}]}},"required":["month","year"],"description":"The Calling add-on per line: Messaging + Calling = `messaging` + `calling`."},"in_stock":{"type":"boolean","description":"Whether a new line can be bought right now."}},"required":["object","messaging","calling","in_stock"],"description":"Current prices and whether lines are in stock."},"Profile":{"type":"object","properties":{"id":{"type":"string","description":"`prf_…`"},"object":{"type":"string","const":"profile"},"slug":{"type":"string"},"label":{"type":["string","null"]},"status":{"type":"string","description":"`provisioning`, `active`, `offline`, `suspended` or `retired`. Prefer `state`."},"state":{"type":"string","enum":["working","having_trouble","setting_up","suspended","retired"],"description":"Whether the line works right now. `having_trouble`: sends wait in the queue until it's back."},"phone_number":{"description":"The line's number, E.164.","type":["string","null"]},"calling_on_plan":{"type":"boolean","description":"Calling is on the plan for this line."},"call_forwarding":{"type":"object","properties":{"forward_to":{"type":["string","null"]},"status":{"type":"string","enum":["off","requested","on"]}},"required":["forward_to","status"],"description":"Forwarding of the line's calls to another number (lines without Calling)."},"sending_paused":{"type":"boolean","description":"We paused sending on this line or your whole account while we review recent activity. Incoming messages still arrive; sends answer `403 sending_paused`."},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","slug","label","status","state","phone_number","calling_on_plan","call_forwarding","sending_paused","created_at"],"description":"A line: one phone number that texts and, with Calling, takes calls. Called a profile in the API (`prf_…`)."},"ProfileStatus":{"type":"object","properties":{"object":{"type":"string","const":"profile_status"},"profile_id":{"type":"string","description":"`prf_…`"},"status":{"type":"string"},"state":{"type":"string","enum":["working","having_trouble","setting_up","suspended","retired"],"description":"Whether the line works right now. `having_trouble`: sends wait in the queue until it's back."},"message":{"description":"One sentence for people, or null when the line is working.","type":["string","null"]},"queued_messages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"oldest_queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pending_drafts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sending_paused":{"type":"boolean","description":"We paused sending (this line, or your whole account) while we review recent activity. Incoming messages still arrive."}},"required":["object","profile_id","status","state","message","queued_messages","oldest_queued_at","pending_drafts","sending_paused"],"description":"Whether a line works, and what is waiting on it."},"Reaction":{"type":"object","properties":{"kind":{"anyOf":[{"type":"string","enum":["love","like","dislike","laugh","emphasize","question"]},{"type":"string","const":"emoji"}],"description":"One of the six tapbacks, or `emoji` for an emoji reaction."},"emoji":{"description":"The emoji, when `kind` is `emoji`.","type":["string","null"]},"from":{"type":"string","description":"`\"me\"` for the line's own reaction, else the person's address."},"at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["kind","emoji","from","at"],"description":"A tapback on a message. One per person: a new one replaces that person's earlier one."},"Upload":{"type":"object","properties":{"id":{"type":"string","description":"`upl_…`"},"object":{"type":"string","const":"upload"},"profile_id":{"type":"string","description":"`prf_…`"},"file_name":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"method":{"type":"string","const":"PUT"},"upload_url":{"type":"string","description":"PUT the file's bytes here, exactly `size_bytes` long, within 15 minutes."},"upload_expires_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time","description":"Until when sends may name this upload (7 days)."}},"required":["id","object","profile_id","file_name","size_bytes","method","upload_url","upload_expires_at","expires_at"],"description":"A place to upload a file, then send it with `attachments: [{ upload_id }]`."},"Usage":{"type":"object","properties":{"object":{"type":"string","const":"usage"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"data":{"type":"array","items":{"type":"object","properties":{"profile_id":{"type":"string"},"inbound":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["profile_id","inbound","outbound","outbound_failed"]}}},"required":["object","from","to","data"],"description":"Message counts per line for a period."},"VoiceEndpoint":{"type":"object","properties":{"id":{"type":"string","description":"`vep_…`"},"object":{"type":"string","const":"voice_endpoint"},"profile_id":{"type":"string","description":"`prf_…`"},"name":{"type":"string"},"kind":{"type":"string","enum":["sip","stream","phone"],"description":"`sip` (recommended), `stream` (WebSocket), or `phone`: an agent with its own phone number."},"vendor":{"description":"Where the agent was built, as a short lowercase name such as `vapi`, `retell` or `other`, for setup help.","type":["string","null"]},"sip_uri":{"type":["string","null"]},"sip_username":{"type":["string","null"]},"has_sip_password":{"type":"boolean"},"stream_url":{"type":["string","null"]},"phone_number":{"description":"For `phone` agents: the agent's own number (E.164).","type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","profile_id","name","kind","vendor","sip_uri","sip_username","has_sip_password","stream_url","phone_number","created_at","updated_at"],"description":"Your voice agent: a SIP address (recommended), a WebSocket stream URL, or the agent's own phone number."},"VoiceEndpointWithSecret":{"type":"object","properties":{"id":{"type":"string","description":"`vep_…`"},"object":{"type":"string","const":"voice_endpoint"},"profile_id":{"type":"string","description":"`prf_…`"},"name":{"type":"string"},"kind":{"type":"string","enum":["sip","stream","phone"],"description":"`sip` (recommended), `stream` (WebSocket), or `phone`: an agent with its own phone number."},"vendor":{"description":"Where the agent was built, as a short lowercase name such as `vapi`, `retell` or `other`, for setup help.","type":["string","null"]},"sip_uri":{"type":["string","null"]},"sip_username":{"type":["string","null"]},"has_sip_password":{"type":"boolean"},"stream_url":{"type":["string","null"]},"phone_number":{"description":"For `phone` agents: the agent's own number (E.164).","type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"signing_secret":{"type":"string","description":"`vss_…`: check `X-Bubblr-Signature` with it. Shown only here."}},"required":["id","object","profile_id","name","kind","vendor","sip_uri","sip_username","has_sip_password","stream_url","phone_number","created_at","updated_at","signing_secret"],"description":"A voice endpoint with its signing secret, shown once."},"VoicemailGreeting":{"type":"object","properties":{"object":{"type":"string","const":"voicemail_greeting"},"profile_id":{"type":"string","description":"`prf_…`"},"audio":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duration_seconds":{"type":"number"},"source":{"type":"string","enum":["recorded","uploaded"]},"file_name":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["url","content_type","size_bytes","duration_seconds","source","file_name","created_at"]},{"type":"null"}],"description":"The recorded or uploaded greeting callers hear; null = they hear `text` (or `default_text`) read aloud."},"text":{"type":["string","null"]},"default_text":{"type":"string"}},"required":["object","profile_id","audio","text","default_text"],"description":"What callers hear before the beep."},"Webhook":{"type":"object","properties":{"id":{"type":"string","description":"`whk_…`"},"object":{"type":"string","const":"webhook"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","message.fallback","message.reaction","draft.created","draft.approved","draft.rejected","chat.updated","profile.online","profile.offline","call.ringing","call.answered","call.transferred","call.ended","call.voicemail","call.transcription","calling.cap_warning"]}},"profile_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Only events from these lines; null = every line the team has."},"description":{"type":["string","null"]},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","url","events","profile_ids","description","active","created_at","updated_at"],"description":"An HTTPS endpoint that receives events."},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","description":"`dlv_…`"},"object":{"type":"string","const":"webhook_delivery"},"webhook_id":{"type":"string","description":"`whk_…`"},"event_id":{"type":"string","description":"`evt_…`"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","success","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Your endpoint's last HTTP status."},"last_error":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","webhook_id","event_id","event_type","status","attempts","next_attempt_at","last_status","last_error","created_at","updated_at"],"description":"One event's delivery to one webhook, with its attempts."},"WebhookWithSecret":{"type":"object","properties":{"id":{"type":"string","description":"`whk_…`"},"object":{"type":"string","const":"webhook"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","message.fallback","message.reaction","draft.created","draft.approved","draft.rejected","chat.updated","profile.online","profile.offline","call.ringing","call.answered","call.transferred","call.ended","call.voicemail","call.transcription","calling.cap_warning"]}},"profile_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Only events from these lines; null = every line the team has."},"description":{"type":["string","null"]},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"secret":{"type":"string","description":"`whsec_…`: verify `X-Signature` with it. Shown only here."}},"required":["id","object","url","events","profile_ids","description","active","created_at","updated_at","secret"],"description":"A webhook with its signing secret, shown once."}}},"x-bubblr-error-codes":[{"status":400,"code":"validation_failed","meaning":"A field is missing or invalid.","fix":"Read `message`; `details` lists each field and what's wrong with it."},{"status":400,"code":"idempotency_key_required","meaning":"A send or call came without an `Idempotency-Key` header.","fix":"Send one: any unique string up to 255 characters, such as a UUID."},{"status":400,"code":"idempotency_key_reserved","meaning":"The `Idempotency-Key` starts with `draft:`, which draft approval uses.","fix":"Use another key, such as a UUID."},{"status":400,"code":"group_not_supported","meaning":"Group chats can't have contact details.","fix":"Name the people in the group instead."},{"status":400,"code":"invalid_number","meaning":"That isn't a phone number calls can go to.","fix":"Use a US or Canadian number, in any common format."},{"status":400,"code":"forward_loop","meaning":"Forwarding there would send the call straight back to a line.","fix":"Forward to a number outside your lines."},{"status":400,"code":"forward_not_allowed","meaning":"Calls can't be forwarded to that number (emergency, premium or outside the US and Canada).","fix":"Pick another number."},{"status":400,"code":"unsupported_audio","meaning":"The greeting isn't an MP3 or WAV file.","fix":"Save it as MP3 or WAV and send it as the request body."},{"status":400,"code":"greeting_too_long","meaning":"The greeting is longer than 2 minutes.","fix":"Shorten it."},{"status":400,"code":"greeting_too_short","meaning":"The greeting is shorter than half a second.","fix":"Record a longer one."},{"status":400,"code":"unreadable_audio","meaning":"The audio file couldn't be read.","fix":"Export it again as MP3 or WAV."},{"status":401,"code":"unauthorized","meaning":"The API key is missing, unknown or revoked.","fix":"Send `Authorization: Bearer sk_live_…` with a key that exists."},{"status":402,"code":"payment_required","meaning":"The team's subscription isn't paid up, so sending is paused.","fix":"Fix billing in the app. Reading still works."},{"status":402,"code":"calling_not_subscribed","meaning":"The line doesn't have Calling on its plan.","fix":"Add Calling to the line in the app."},{"status":402,"code":"spending_cap_reached","meaning":"The team has used its calling minutes for the month.","fix":"Wait for the 1st, or ask support to raise the cap. Incoming calls still ring."},{"status":403,"code":"insufficient_scope","meaning":"The API key lacks the scope this needs.","fix":"Create a key with that scope."},{"status":403,"code":"forbidden","meaning":"The line is suspended, or the key may not do this.","fix":"Read `message`; contact support about a suspended line."},{"status":403,"code":"recipient_not_allowed","meaning":"The recipient isn't on this key's allowed recipients.","fix":"Add them to the key's list, or use another key."},{"status":403,"code":"draft_only_key","meaning":"This key can only write drafts; typing, reactions and read receipts aren't drafts.","fix":"Use a key that isn't draft-only."},{"status":403,"code":"session_required","meaning":"Only a signed-in team member can do this, not an API key.","fix":"Do it in the app."},{"status":403,"code":"not_note_author","meaning":"Only a note's author can edit it (or delete it, with owners and admins).","fix":"Add a new note instead."},{"status":403,"code":"emergency_number_blocked","meaning":"Emergency and N11 numbers can't be called from a line.","fix":"Dial emergency services from a phone."},{"status":403,"code":"destination_not_allowed","meaning":"Calls go to US and Canadian numbers only.","fix":"Call a US or Canadian number."},{"status":403,"code":"fair_use_paused","meaning":"Outgoing calls on this line are paused for the month (fair use).","fix":"Contact support. Incoming calls still ring."},{"status":403,"code":"calling_suspended","meaning":"Calling is suspended for the team.","fix":"Contact support."},{"status":403,"code":"sending_paused","meaning":"We paused sending on your account (or this line) while we review recent activity that looked like mass texting. Incoming messages still arrive. `details.scope` is `team` or `line`.","fix":"Reply to our email or contact support. Messages waiting to go out when it paused fail with this code too."},{"status":404,"code":"not_found","meaning":"No such object, or the key can't see it.","fix":"Check the id. A key limited to some lines gets 404 for the others."},{"status":404,"code":"attachment_missing","meaning":"The file is no longer there.","fix":"Ask the sender for it again."},{"status":409,"code":"idempotency_key_reused","meaning":"The `Idempotency-Key` was used before for a different request. Nothing was sent.","fix":"Use a new key for a new message."},{"status":409,"code":"profile_not_ready","meaning":"The line is still being set up.","fix":"Wait until its `state` is `working`."},{"status":409,"code":"not_sent_yet","meaning":"The message hasn't gone out yet, so it can't be reacted or replied to.","fix":"Wait for `message.sent`."},{"status":409,"code":"imessage_only","meaning":"Reactions work only on iMessage messages.","fix":"React to an iMessage message, or reply instead."},{"status":409,"code":"draft_approved","meaning":"The draft was already approved.","fix":"Nothing to do: it has been sent."},{"status":409,"code":"draft_rejected","meaning":"The draft was rejected.","fix":"Write a new message."},{"status":409,"code":"draft_conflict","meaning":"A message already uses the draft's idempotency key.","fix":"Draft the message again."},{"status":409,"code":"line_needs_update","meaning":"The line can't do this yet.","fix":"Try again later; we update lines in the background."},{"status":409,"code":"calling_not_set_up","meaning":"The line has no calling.","fix":"Add Calling to the line."},{"status":409,"code":"caller_id_unverified","meaning":"Calling on the line is still being set up.","fix":"Wait until calling's `state` is `working`."},{"status":409,"code":"call_not_active","meaning":"The call has ended or isn't connected yet.","fix":"Only a live call can be transferred or hung up."},{"status":409,"code":"endpoint_in_use","meaning":"Call routing uses this voice endpoint.","fix":"Change the routing first."},{"status":413,"code":"attachment_too_large","meaning":"The file is larger than attachments may be.","fix":"Send a smaller file, or a link to it."},{"status":413,"code":"greeting_too_large","meaning":"The greeting file is over 5 MB.","fix":"Shorten it, or save it as MP3."},{"status":429,"code":"rate_limited","meaning":"The key's sends for this window are used up.","fix":"Wait `Retry-After` seconds. `details` has the limit and window."},{"status":429,"code":"new_conversation_limit","meaning":"The line started as many new conversations in the last 24 hours as it may. Replies, and messages to anyone who already wrote to the line, still go.","fix":"Wait `Retry-After` seconds. Texting people who expect to hear from you keeps a line healthy."},{"status":503,"code":"line_unavailable","meaning":"The line is having trouble right now.","fix":"Retry later, or send with `queue: true` (the default) to have it go out once the line is back."},{"status":503,"code":"line_timeout","meaning":"The line didn't answer in time.","fix":"Retry."},{"status":503,"code":"storage_disabled","meaning":"File storage is off on this server.","fix":"Send a public https URL instead of an upload."},{"status":503,"code":"upload_mismatch","meaning":"A file didn't arrive whole.","fix":"Retry."},{"status":503,"code":"calling_error","meaning":"Calling couldn't complete the request.","fix":"Retry; if it keeps failing, contact support."},{"status":500,"code":"internal","meaning":"Something went wrong on our side.","fix":"Retry; if it keeps happening, contact support."}]}