{"openapi":"3.1.0","info":{"title":"SMSBlast API","version":"1.0.0","summary":"Text marketing and two-way texting for small businesses in the US and Canada.","description":"The SMSBlast API lets your own software do what the dashboard does: keep contacts and their consent, send one-to-one texts and campaigns, run automatic workflows, answer people in the inbox, and hear about replies, deliveries and opt-outs through webhooks.\n\n**Base URL** `https://app.smsblast.net`. Every path starts with `/v1`.\n\n**Authentication.** Send an API key as a bearer token: `Authorization: Bearer sb_...`. Keys are created and revoked in the dashboard at **Settings → Developers** (an API key cannot manage keys). A key is shown once, when it is created; keep it secret, on your server.\n\n**JSON.** Send request bodies as JSON objects with `Content-Type: application/json`; answers are JSON (except the CSV export). Times are ISO 8601 in UTC, such as `2026-11-20T17:02:11.482Z`. Phone numbers are US and Canada numbers: send them in any common format, they come back in E.164 (`+14155550101`). Field names are shown exactly as the API returns them: contacts, lists, segments, campaigns, conversations, keywords, imports and the account are snake_case; messages, webhooks and workflows are camelCase.\n\n**Errors** use the HTTP status (400 invalid input, 401 bad key, 402 credits or plan, 404 not found, 409 conflict, 422 reused idempotency key, 429 too many requests, 500 our fault) and this body: `{\"error\": {\"code\": \"invalid_phone\", \"message\": \"...\", \"details\": {...}, \"requestId\": \"req_...\"}}`. `code` is stable and safe to branch on; `message` is plain English you can show; `details` appears on some errors.\n\n**Idempotency.** Every POST accepts an `Idempotency-Key` header. Retrying with the same key and the same body returns the first answer (marked `Idempotent-Replayed: true`) instead of doing the work twice, so a text is never sent twice because of a timeout. Keys last 24 hours. The same key with a different body is refused (422); server errors (5xx) are not remembered, so they can be retried.\n\n**Rate limits.** Up to 600 requests a minute per API key. Every answer carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix seconds); over the limit you get 429 with `Retry-After` (seconds).\n\n**Pagination.** `GET /v1/messages` pages with a cursor (`nextCursor` → `cursor`). Contacts and conversations page with `limit` and `offset`. Other lists return everything, or their most recent entries as each operation says.\n\n**Request ids.** Every answer has an `X-Request-Id` header (also `error.requestId` in errors). Quote it when you contact support.\n\n**Texting rules.** Texts only go to subscribed contacts. Sending needs an approved (active) sending number and, once the 14-day free trial is over, a paid plan. Credits are taken when the text is queued: 1 per SMS segment (160 plain characters, or 153 per segment once a text is split; 70 and 67 when it contains an emoji or another character outside GSM-7), or 3 for a picture message. A text that cannot be sent, or is skipped because the person opted out first, gets its credits back. STOP, HELP and START are handled for you, and anyone who opts out is never texted again until they opt back in themselves. Campaign and workflow texts wait for 8am to 9pm in each recipient's time zone.\n\nThis description is published at `GET /v1/openapi.json` (no key needed)."},"servers":[{"url":"https://app.smsblast.net","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Messages","description":"Send one text to one subscribed contact, look up any text sent or received (campaign, inbox, workflow, API, automatic answers and incoming texts), and preview what a message will cost.\n\nAn outgoing text moves from `queued` to `sending` to `sent` and then `delivered` or `failed`; a text not sent because the person opted out first is `skipped`. Incoming texts are `received`."},{"name":"Contacts","description":"The people you text, and your proof that they agreed to it. Every contact is added with your confirmation of consent (`consent.attested: true`), kept with the contact as an opt-in record alongside every later opt-out. A contact is `subscribed` or `unsubscribed`; only subscribed contacts are texted, and nobody who opted out is ever resubscribed by you: only by texting START or a signup keyword from their own phone.\n\nAdd people one at a time (`POST /v1/contacts`), up to 50,000 at once (`POST /v1/contacts/import`), or from a large file in batches with an import job (`/v1/imports`)."},{"name":"Lists","description":"Named groups of contacts, to send campaigns to and to start workflows. Put people on a list with `POST /v1/contacts/bulk` (`add_to_list`), with `listId` when adding or importing them, with a signup keyword, or with a workflow step; see who is on one with `GET /v1/contacts?listId=...`."},{"name":"Segments","description":"Saved filters over your contacts (area code, name, email, status, source, list, when added, custom fields), worked out each time they are used. Use them as campaign audiences, to enroll people in workflows, or to filter contacts. See `SegmentRule` for the rule format."},{"name":"Campaigns","description":"One message to many people. Write a draft, check who it reaches and what it costs (`estimate`), send yourself a test, then send it now or schedule it. Only subscribed people in the audience get it, each once, personalised with their name.\n\nCredits for the whole campaign are taken when you send it. Texts go out in each recipient's sending hours (8am to 9pm in their time zone). A scheduled campaign, or one still going out, can be stopped, and the credits for texts not yet sent come back. A draft can also be made recurring: it is then sent again on a schedule (every day, week or month)."},{"name":"Workflows","description":"Automatic text series. A trigger (someone subscribes, is added to a list, texts a keyword, or has a birthday) starts a run for that person, who then goes through the steps: send a text, wait, add to or remove from a list. Each person goes through a workflow once (birthday workflows once a year), and leaves it when they opt out. Workflow texts follow campaign rules: credits, personalisation, tracked links and sending hours."},{"name":"Forms","description":"Signup forms that grow your list from the web. Each form has a hosted page (`https://app.smsblast.net/f/{publicId}`) and an embed code for your own website: `<script async src=\"https://app.smsblast.net/embed/form.js\" data-smsblast-form=\"PUBLIC_ID\"></script>`, with `data-mode=\"popup\"` added for a popup. Manage forms with your API key; the two `/v1/public/forms/{publicId}` endpoints need no key and are for browsers, if you build your own form.\n\nSubmitting a form is the person's opt-in: the exact consent wording they saw is stored with the signup, with the page, time, IP address and browser, as carriers and the law ask. New subscribers get the form's welcome text and start workflows. A form never undoes an opt-out: someone who texted STOP must text START from their own phone to rejoin."},{"name":"Conversations","description":"The shared inbox: one conversation per phone number, with every text in and out. List and search conversations, read them, text people one-to-one, and set status (open, pending, closed) and assignment."},{"name":"Keywords","description":"Signup keywords such as JOIN. When someone texts one to your number they become a subscribed contact (texting it is their consent), get your reply and can be put on a list. STOP, HELP and START are handled automatically and cannot be used."},{"name":"Webhooks","description":"Have SMSBlast tell your own systems the moment something happens: a reply comes in, a text is delivered, someone opts out, a campaign finishes, a link is clicked. Each event is posted as JSON to the endpoints subscribed to it (see the event payloads under Webhooks/Events).\n\n**Verify every delivery.** The `SMSBlast-Signature` header looks like `t=1795712703,v1=5f0b...`. Compute an HMAC-SHA256 with your webhook's secret (`whsec_...`) over the string `<t>.<raw request body>` (the exact bytes received, before parsing the JSON), hex-encode it and compare it to `v1` in constant time. Reject the delivery if they differ or if `t` is more than 5 minutes from now.\n\n**Answer quickly.** Any 2xx within 10 seconds marks a delivery done; do slow work afterwards. Anything else (an error status, a redirect, a timeout) is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours: 8 attempts over about two days, then the delivery is `failed` (send it again with the retry operation). An endpoint that fails 100 deliveries in a row is switched off; switch it back on with `PATCH` once it is fixed.\n\n**Expect repeats and any order.** The same event can arrive more than once and events can arrive out of order: use the event `id` (also `SMSBlast-Event-Id`) to ignore repeats. Events that happen while an endpoint is switched off are not sent later. Delivery history is kept for 30 days."},{"name":"Account","description":"Your account: business name, time zone, support contact, credit balance and sending numbers. API keys, billing and number registration are managed in the dashboard."},{"name":"Analytics","description":"The numbers behind the dashboard's Home and Analytics pages: audience growth, campaign and messaging activity per day, and inbox workload. Days are counted in your account's time zone; ranges are up to 400 days."}],"paths":{"/v1/messages":{"post":{"operationId":"sendMessage","tags":["Messages"],"summary":"Send a text","description":"Sends one text to one person, such as an order update, a reminder or an answer to something they did. It is queued at once and usually goes out within seconds; follow it with `GET /v1/messages/{id}` or the `message.sent`, `message.delivered` and `message.failed` webhooks.\n\nThe person must already be a contact who is subscribed: add them first with `POST /v1/contacts` and your record of their consent. Texting anyone else is refused (`not_a_contact`, `unsubscribed`), the same as in the dashboard. The text also appears in that person's inbox conversation.\n\nCredits are taken when the text is queued: 1 per SMS segment (160 plain characters, or 153 per segment once a text is split; 70 and 67 when it contains an emoji or another character outside GSM-7), or 3 for a picture message. A text that cannot be sent, or is skipped because the person opted out first, gets its credits back.\n\nAPI texts go out at any hour unless you send `respectQuietHours: true`, which holds the text until 8am to 9pm in the contact's time zone (or your account's). Schedule a text with `sendAt`. Send the final text: personalisation tags are not filled in here.\n\nUse an `Idempotency-Key` so a retried request cannot send the text twice.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"},"example":{"to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","respectQuietHours":false}}}},"responses":{"201":{"description":"The text, queued.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}}},"example":{"message":{"id":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","direction":"outbound","status":"queued","kind":"api","from":"+14155550100","to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","mediaUrls":[],"credits":1,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T17:02:11.482Z","sentAt":null,"deliveredAt":null}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_phone`: `to` is not a valid US or Canada mobile number.\n- `empty_body`: There is no `body` and no `mediaUrls`.\n- `body_too_long`: `body` is longer than 1,600 characters.\n- `invalid_media`: `mediaUrls` is not a list of up to 10 https addresses.\n- `invalid_send_at`: `sendAt` is not a date and time, or is more than a year ahead.\n- `invalid_from`: `from` is not one of your approved sending numbers.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired","description":"Sending is not possible right now. `error.code` is one of:\n\n- `insufficient_credits`: Your credit balance is too low for this. `error.details` has `needed` and `available`.\n- `trial_ended`: The 14-day free trial is over. Choose a plan on the Billing page of the dashboard to keep sending.\n- `plan_required`: Your paid plan has ended. Choose a plan on the Billing page of the dashboard to keep sending."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_a_contact`: The number is not one of your contacts. Add them, with their consent, first.\n- `unsubscribed`: The contact has opted out.\n- `blocked`: The number is blocked on SMSBlast (by SMSBlast staff, for every account) and cannot be texted.\n- `no_active_number`: You have no approved sending number yet (your number registration is still under review).\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"operationId":"listMessages","tags":["Messages"],"summary":"List texts","description":"Every text sent or received by your account (campaigns, inbox replies, workflows, API texts, automatic answers and incoming texts), newest first, a page at a time.\n\nTo page through, pass the `nextCursor` of one page as `cursor` for the next; `nextCursor` is empty on the last page. Filters can be combined.","parameters":[{"name":"direction","in":"query","required":false,"description":"Only incoming (`inbound`) or outgoing (`outbound`) texts.","schema":{"type":"string","enum":["inbound","outbound"],"description":"Direction."}},{"name":"status","in":"query","required":false,"description":"Only texts with this status.","schema":{"$ref":"#/components/schemas/MessageStatus"}},{"name":"kind","in":"query","required":false,"description":"Only texts of this kind.","schema":{"$ref":"#/components/schemas/MessageKind"}},{"name":"contactId","in":"query","required":false,"description":"Only texts to or from this contact.","schema":{"type":"string","format":"uuid"}},{"name":"campaignId","in":"query","required":false,"description":"Only texts of this campaign.","schema":{"type":"string","format":"uuid"}},{"name":"phone","in":"query","required":false,"description":"Only texts to or from this number, in any common format.","schema":{"type":"string"}},{"name":"since","in":"query","required":false,"description":"Only texts created at or after this time (a date like `2026-11-01` or a date and time).","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":false,"description":"Only texts created before this time.","schema":{"type":"string","format":"date-time"}},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"One page of texts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"},"example":{"messages":[{"id":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","direction":"outbound","status":"delivered","kind":"api","from":"+14155550100","to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","mediaUrls":[],"credits":1,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T17:02:11.482Z","sentAt":"2026-11-20T17:02:12.104Z","deliveredAt":"2026-11-20T17:02:15.930Z"},{"id":"d1f3a5c7-9e0b-4d2f-a4c6-e8f0b2d4f697","direction":"inbound","status":"received","kind":"inbound","from":"+14155550101","to":"+14155550100","body":"Do you have rye bread today?","mediaUrls":[],"credits":0,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T16:45:03.118Z","sentAt":null,"deliveredAt":null}],"nextCursor":"MjAyNi0xMS0yMFQxNjo0NTowMy4xMThafGQxZjNhNWM3LTllMGItNGQyZi1hNGM2LWU4ZjBiMmQ0ZjY5Nw"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_direction`: `direction` is not `inbound` or `outbound`.\n- `invalid_phone`: `phone` is not a valid US or Canada number.\n- `invalid_date`: `since` or `until` is not a date.\n- `invalid_cursor`: `cursor` is not one this API gave out."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/messages/{id}":{"get":{"operationId":"getMessage","tags":["Messages"],"summary":"Get a text","description":"One text, sent or received, with its current status. Useful to follow a text from `POST /v1/messages` until it is delivered (or use the webhooks).","parameters":[{"$ref":"#/components/parameters/MessageId"}],"responses":{"200":{"description":"The text.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}}},"example":{"message":{"id":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","direction":"outbound","status":"delivered","kind":"api","from":"+14155550100","to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","mediaUrls":[],"credits":1,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T17:02:11.482Z","sentAt":"2026-11-20T17:02:12.104Z","deliveredAt":"2026-11-20T17:02:15.930Z"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No text with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/messages/preview":{"post":{"operationId":"previewMessage","tags":["Messages"],"summary":"Preview a message","description":"Works out how a message body would be sent, without sending anything: its encoding, length in SMS segments, the credits one recipient would cost, and warnings worth fixing (no opt-out wording, characters that shorten each segment, personalisation that can change the length).\n\nPersonalisation tags are counted with their fallbacks (`{first_name|there}` counts as \"there\") or as empty.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePreviewRequest"},"example":{"body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out."}}}},"responses":{"200":{"description":"The preview.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePreview"},"example":{"encoding":"GSM-7","characters":114,"segments":1,"creditsPerMessage":1,"nonGsm":[],"warnings":["Names vary in length, so some recipients may use one more credit than shown."]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/messages/inbound":{"get":{"operationId":"listInboundMessages","tags":["Messages"],"summary":"List incoming texts","description":"Texts people sent to your numbers, newest first. With `review=true`, only texts a person should read because they mention opting out without being an exact opt-out keyword (for example \"please remove me from this\"); exact keywords such as STOP are handled automatically.\n\nThe objects here are snake_case and leave out pictures; `GET /v1/messages?direction=inbound` gives full `Message` objects with cursor paging.","parameters":[{"$ref":"#/components/parameters/Limit"},{"name":"review","in":"query","required":false,"description":"`true` for only the texts flagged for review.","schema":{"type":"string","enum":["true"]}}],"responses":{"200":{"description":"Incoming texts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/InboundMessage"},"description":"Newest first."}}},"example":{"messages":[{"id":"d1f3a5c7-9e0b-4d2f-a4c6-e8f0b2d4f697","from_number":"+14155550101","to_number":"+14155550100","body":"Do you have rye bread today?","needs_review":false,"contact_id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","created_at":"2026-11-20T16:45:03.118Z"},{"id":"b2d4f6a8-0c1e-4a3c-8e5a-7c9e1a3c5e97","from_number":"+14155550102","to_number":"+14155550100","body":"Please remove me from this","needs_review":true,"contact_id":"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71","created_at":"2026-11-19T23:12:40.551Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/contacts":{"get":{"operationId":"listContacts","tags":["Contacts"],"summary":"List contacts","description":"Your contacts, a page at a time, with counts. Filter by status, a search, a list or a segment; page with `limit` and `offset` (`matching` says how many there are in all).\n\nSearch matches first name, last name, full name and email (ignoring case, part of a word is enough), and phone numbers when it has 3 or more digits.","parameters":[{"name":"status","in":"query","required":false,"description":"Only subscribed or unsubscribed contacts. Other values are ignored.","schema":{"type":"string","enum":["subscribed","unsubscribed"],"description":"Status."}},{"name":"search","in":"query","required":false,"description":"Text to look for in names, email and (3 or more digits) phone numbers.","schema":{"type":"string"}},{"name":"listId","in":"query","required":false,"description":"Only contacts on this list.","schema":{"type":"string","format":"uuid"}},{"name":"notListId","in":"query","required":false,"description":"Only contacts that are not on this list (for example, to pick people to add to it).","schema":{"type":"string","format":"uuid"}},{"name":"segmentId","in":"query","required":false,"description":"Only contacts in this segment.","schema":{"type":"string","format":"uuid"}},{"name":"sort","in":"query","required":false,"description":"Sort by when they were added, or by name. Empty names sort last.","schema":{"type":"string","enum":["created","first_name","last_name"],"default":"created"}},{"name":"dir","in":"query","required":false,"description":"Sort direction. Default `desc` (newest first).","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 500. Default 50.","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"One page of contacts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPage"},"example":{"contacts":[{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","email":"alice@example.com","timezone":"America/Los_Angeles","status":"subscribed","source":"import","fields":{"favorite_bread":"Sourdough","store":"Mission St"},"created_at":"2026-11-02T18:24:09.311Z"},{"id":"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71","phone":"+14155550102","first_name":"Ben","last_name":"Carter","email":null,"timezone":null,"status":"unsubscribed","source":"keyword:JOIN","fields":{},"created_at":"2026-11-09T21:40:52.007Z"}],"total":1873,"matching":2,"subscribed":1802,"unsubscribed":71}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The segment in `segmentId` does not exist."},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createContact","tags":["Contacts"],"summary":"Add a contact","description":"Adds one person who has agreed to get your texts. You must confirm their consent with `consent.attested: true`; that confirmation, its `source` and the time are kept as their opt-in record (see `GET /v1/contacts/{id}/consent`). The contact is subscribed at once.\n\nA number that is already a contact is merged, not refused: each detail you send replaces the one on file, blanks keep what is there, `fields` are added to theirs, and with `listId` they are put on that list. The answer is then `200` with `merged: true`. Merging records no new opt-in, and someone who opted out stays opted out; only they can opt back in, by texting START or a signup keyword.\n\nA new contact sends the `contact.created` and `contact.opted_in` webhooks and starts any workflow triggered by a new subscriber. Being put on the list in `listId` (new or merged) starts any workflow triggered by that list.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactRequest"},"example":{"phone":"(415) 555-0101","firstName":"Alice","lastName":"Moreno","email":"alice@example.com","timezone":"America/Los_Angeles","fields":{"favorite_bread":"Sourdough"},"consent":{"attested":true,"source":"Website signup form"},"listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}}}},"responses":{"200":{"description":"The number was already a contact: the details sent were merged into it. `merged` is `true`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["contact","merged","addedToList"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"merged":{"type":"boolean","description":"`true` when the number was already a contact and these details were merged into it."},"addedToList":{"type":"boolean","description":"`true` when this request put them on the list in `listId` (`false` when there is no `listId` or they were on it already)."}}},"example":{"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","email":"alice@example.com","timezone":"America/Los_Angeles","status":"subscribed","source":"import","fields":{"favorite_bread":"Sourdough"},"created_at":"2026-11-02T18:24:09.311Z"},"merged":true,"addedToList":true}}}},"201":{"description":"The new contact. Its `source` is `api` when added with an API key (`manual` when added by a person in the dashboard).","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["contact","merged","addedToList"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"merged":{"type":"boolean","description":"`true` when the number was already a contact and these details were merged into it."},"addedToList":{"type":"boolean","description":"`true` when this request put them on the list in `listId` (`false` when there is no `listId` or they were on it already)."}}},"example":{"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","email":"alice@example.com","timezone":"America/Los_Angeles","status":"subscribed","source":"api","fields":{"favorite_bread":"Sourdough"},"created_at":"2026-11-02T18:24:09.311Z"},"merged":false,"addedToList":true}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_phone`: `phone` is not a valid US or Canada mobile number.\n- `consent_required`: `consent.attested` is not `true`.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The list in `listId` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/contacts/{id}":{"get":{"operationId":"getContact","tags":["Contacts"],"summary":"Get a contact","description":"One contact, the lists they are on and their full consent history.","parameters":[{"$ref":"#/components/parameters/ContactId"}],"responses":{"200":{"description":"The contact.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactDetail"},"example":{"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","email":"alice@example.com","timezone":"America/Los_Angeles","status":"subscribed","source":"import","fields":{"favorite_bread":"Sourdough","store":"Mission St"},"created_at":"2026-11-02T18:24:09.311Z"},"lists":[{"id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","name":"Weekend regulars"}],"consent":[{"kind":"opt_in","source":"Checkout opt-in box","detail":"pos-customers.csv (Checkout opt-in box)","occurred_at":"2026-11-02T18:24:09.311Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No contact with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateContact","tags":["Contacts"],"summary":"Update a contact","description":"Changes a contact's name, email, time zone and custom fields. The phone number cannot be changed, and neither can the status: unsubscribe people with `POST /v1/contacts/bulk`; only the person can opt back in.\n\nOnly the fields you send change; send `null` or `\"\"` to clear one. `fields`, when sent, replaces all of the contact's custom fields, so send the full set.","parameters":[{"$ref":"#/components/parameters/ContactId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactRequest"},"example":{"email":"alice.moreno@example.com","fields":{"favorite_bread":"Rye","store":"Mission St"}}}}},"responses":{"200":{"description":"The updated contact.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["contact"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"}}},"example":{"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","email":"alice.moreno@example.com","timezone":"America/Los_Angeles","status":"subscribed","source":"import","fields":{"favorite_bread":"Rye","store":"Mission St"},"created_at":"2026-11-02T18:24:09.311Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_timezone`: `timezone` is not one we recognise.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No contact with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/contacts/{id}/consent":{"get":{"operationId":"getContactConsent","tags":["Contacts"],"summary":"Get consent history","description":"Every opt-in and opt-out for one contact, oldest first: your proof of consent. These records are never changed or deleted.","parameters":[{"$ref":"#/components/parameters/ContactId"}],"responses":{"200":{"description":"The consent history.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/ConsentEvent"},"description":"Oldest first."}}},"example":{"events":[{"kind":"opt_in","source":"keyword:JOIN","detail":"join","occurred_at":"2026-11-09T21:40:52.007Z"},{"kind":"opt_out","source":"sms:STOP","detail":"Stop","occurred_at":"2026-11-19T23:15:02.660Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No contact with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/contacts/import":{"post":{"operationId":"importContacts","tags":["Contacts"],"summary":"Import contacts","description":"Adds or updates up to 50,000 people in one request. You must confirm they all agreed to get your texts (`consent.attested: true`); each new contact gets an opt-in record with your `consent.source` and `detail`.\n\nNumbers already on file have their details refreshed (only the values you send replace what is there; custom fields are merged). **An import never resubscribes anyone who opted out**: they are counted in `stillUnsubscribed`. Rows without a valid number are skipped and listed in `invalid`; when a number appears twice, the last row wins. With `listId`, everyone in the batch is also put on that list.\n\nImports do not send `contact.created` or `contact.opted_in` webhooks and do not start workflows. For a large file you want to send in parts with progress, use an import job (`POST /v1/imports`).","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportContactsRequest"},"example":{"contacts":[{"phone":"415-555-0101","firstName":"Alice","lastName":"Moreno","email":"alice@example.com","fields":{"favorite_bread":"Sourdough"}},{"phone":"(415) 555-0103","firstName":"Cara"},{"phone":"555-0199"}],"consent":{"attested":true,"source":"Checkout opt-in box","detail":"Collected at the till, November 2026"},"listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}}}},"responses":{"200":{"description":"What the import did.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResult"},"example":{"created":1,"updated":1,"stillUnsubscribed":0,"invalid":[{"row":2,"phone":"555-0199","reason":"Not a valid US or Canada mobile number"}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `consent_required`: `consent.attested` is not `true`.\n- `no_contacts`: `contacts` is missing or empty.\n- `too_many_contacts`: More than 50,000 contacts.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The list in `listId` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/contacts/bulk":{"post":{"operationId":"bulkUpdateContacts","tags":["Contacts"],"summary":"Act on many contacts","description":"Does one thing to up to 5,000 contacts at once:\n\n- `add_to_list`: put them on the list `listId` (starts workflows triggered by that list).\n- `remove_from_list`: take them off the list `listId`.\n- `unsubscribe`: opt them out, for example when someone asked in person. It is recorded in their consent history (\"Unsubscribed by API\") and sends `contact.opted_out`. There is no way to resubscribe someone: they must opt back in themselves.\n- `delete`: delete them. Someone who opted out is not forgotten: their name, email and custom fields are cleared, but the number stays on file as unsubscribed so no later import can text them.\n\nIds that are not your contacts are ignored.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkContactsRequest"},"example":{"action":"add_to_list","ids":["0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71"],"listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}}}},"responses":{"200":{"description":"How many contacts it changed.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkContactsResult"},"example":{"added":2}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `no_contacts`: `ids` is missing or empty.\n- `invalid_action`: `action` is not one of the four.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The list in `listId` does not exist (or `listId` is missing for a list action)."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/contacts/export.csv":{"get":{"operationId":"exportContacts","tags":["Contacts"],"summary":"Export contacts as CSV","description":"Every contact matching the filters, as a CSV file (UTF-8 with a byte-order mark, so spreadsheet apps read accents correctly). Columns: `phone`, `first_name`, `last_name`, `email`, `status`, `source`, `timezone`, `created_at`, then one column per custom field.\n\nTakes the same filters and sort as `GET /v1/contacts`, without paging. Cells that a spreadsheet would run as a formula (starting with `=`, `+`, `-` or `@`, other than phone numbers) are prefixed with an apostrophe.","parameters":[{"name":"status","in":"query","required":false,"description":"Only subscribed or unsubscribed contacts.","schema":{"type":"string","enum":["subscribed","unsubscribed"],"description":"Status."}},{"name":"search","in":"query","required":false,"description":"Text to look for in names, email and phone numbers.","schema":{"type":"string"}},{"name":"listId","in":"query","required":false,"description":"Only contacts on this list.","schema":{"type":"string","format":"uuid"}},{"name":"segmentId","in":"query","required":false,"description":"Only contacts in this segment.","schema":{"type":"string","format":"uuid"}},{"name":"sort","in":"query","required":false,"description":"Sort order.","schema":{"type":"string","enum":["created","first_name","last_name"],"default":"created"}},{"name":"dir","in":"query","required":false,"description":"Sort direction.","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"The CSV file, sent as a download named `contacts-YYYY-MM-DD.csv`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/csv":{"schema":{"type":"string"},"example":"phone,first_name,last_name,email,status,source,timezone,created_at,favorite_bread,store\r\n+14155550101,Alice,Moreno,alice@example.com,subscribed,import,America/Los_Angeles,2026-11-02T18:24:09.311Z,Sourdough,Mission St\r\n"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The segment in `segmentId` does not exist."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/imports":{"get":{"operationId":"listImports","tags":["Contacts"],"summary":"List import jobs","description":"Your 50 most recent import jobs, newest first.","responses":{"200":{"description":"Import jobs.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["imports"],"properties":{"imports":{"type":"array","items":{"$ref":"#/components/schemas/ImportJob"},"description":"Newest first."}}},"example":{"imports":[{"id":"1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","filename":"pos-customers.csv","list_id":"9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42","list_name":"Point of sale signups","consent_source":"Checkout opt-in box","status":"done","total_rows":2503,"processed":2503,"created":2497,"updated":4,"invalid":2,"still_unsubscribed":1,"created_at":"2026-11-19T18:30:00.000Z","finished_at":"2026-11-19T18:31:12.400Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"startImport","tags":["Contacts"],"summary":"Start an import job","description":"For a large file: start a job, send the rows in batches of up to 5,000 with `POST /v1/imports/{id}/rows`, then finish it with `POST /v1/imports/{id}/finish`. The job keeps running totals, so you can show progress, and an interrupted upload leaves an honest record of how far it got. (For up to 50,000 rows in one go, `POST /v1/contacts/import` is simpler.)\n\nYou must confirm everyone in the file agreed to get your texts. Contacts are added and updated by the same rules as `POST /v1/contacts/import`: nobody who opted out is resubscribed, and no webhooks are sent or workflows started. Everyone can be put on an existing list (`listId`) or a new one (`newListName`).","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartImportRequest"},"example":{"filename":"pos-customers.csv","totalRows":2503,"newListName":"Point of sale signups","consent":{"attested":true,"source":"Checkout opt-in box"}}}}},"responses":{"201":{"description":"The new job.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["import"],"properties":{"import":{"$ref":"#/components/schemas/ImportJob"}}},"example":{"import":{"id":"1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","filename":"pos-customers.csv","list_id":"9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42","list_name":"Point of sale signups","consent_source":"Checkout opt-in box","status":"running","total_rows":2503,"processed":0,"created":0,"updated":0,"invalid":0,"still_unsubscribed":0,"created_at":"2026-11-19T18:30:00.000Z","finished_at":null}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `consent_required`: `consent.attested` is not `true`.\n- `invalid_name`: `newListName` is empty after trimming.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The list in `listId` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"413":{"$ref":"#/components/responses/PayloadTooLarge","description":"The body is too large. `error.code` is one of:\n\n- `too_large`: The body is larger than 12 MB."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/imports/{id}":{"get":{"operationId":"getImport","tags":["Contacts"],"summary":"Get an import job","description":"One import job and its running totals.","parameters":[{"$ref":"#/components/parameters/ImportId"}],"responses":{"200":{"description":"The job.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["import"],"properties":{"import":{"$ref":"#/components/schemas/ImportJob"}}},"example":{"import":{"id":"1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","filename":"pos-customers.csv","list_id":"9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42","list_name":"Point of sale signups","consent_source":"Checkout opt-in box","status":"running","total_rows":2503,"processed":2000,"created":1994,"updated":4,"invalid":2,"still_unsubscribed":1,"created_at":"2026-11-19T18:30:00.000Z","finished_at":null}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No import with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/imports/{id}/rows":{"post":{"operationId":"addImportRows","tags":["Contacts"],"summary":"Send a batch of rows","description":"Adds one batch of up to 5,000 rows to a running import job, at once. Set `offset` to the position of the batch's first row in the file, so skipped rows are reported with their real row numbers. Returns what the batch did and the job with its new totals.","parameters":[{"$ref":"#/components/parameters/ImportId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRowsRequest"},"example":{"rows":[{"phone":"415-555-0101","firstName":"Alice","lastName":"Moreno"},{"phone":"n/a","firstName":"Dana"}],"offset":2000}}}},"responses":{"200":{"description":"What the batch did.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchResult"},"example":{"created":1,"updated":0,"stillUnsubscribed":0,"invalid":[{"row":2001,"phone":"n/a","reason":"Not a valid US or Canada mobile number"}],"job":{"id":"1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","filename":"pos-customers.csv","list_id":"9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42","list_name":"Point of sale signups","consent_source":"Checkout opt-in box","status":"running","total_rows":2503,"processed":2000,"created":1994,"updated":4,"invalid":2,"still_unsubscribed":1,"created_at":"2026-11-19T18:30:00.000Z","finished_at":null}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `no_contacts`: `rows` is missing or empty.\n- `batch_too_large`: More than 5,000 rows.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No import with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `import_finished`: The import has already been finished.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"413":{"$ref":"#/components/responses/PayloadTooLarge","description":"The body is too large. `error.code` is one of:\n\n- `too_large`: The body is larger than 12 MB."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/imports/{id}/finish":{"post":{"operationId":"finishImport","tags":["Contacts"],"summary":"Finish an import job","description":"Marks a running import `done` (or `failed`, with `failed: true`, for example when the upload was abandoned). No more rows can be added afterwards. Finishing an import that is already finished changes nothing. The body is optional.","parameters":[{"$ref":"#/components/parameters/ImportId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinishImportRequest"},"example":{}}}},"responses":{"200":{"description":"The finished job.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["import"],"properties":{"import":{"$ref":"#/components/schemas/ImportJob"}}},"example":{"import":{"id":"1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","filename":"pos-customers.csv","list_id":"9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42","list_name":"Point of sale signups","consent_source":"Checkout opt-in box","status":"done","total_rows":2503,"processed":2503,"created":2497,"updated":4,"invalid":2,"still_unsubscribed":1,"created_at":"2026-11-19T18:30:00.000Z","finished_at":"2026-11-19T18:31:12.400Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No import with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"413":{"$ref":"#/components/responses/PayloadTooLarge","description":"The body is too large. `error.code` is one of:\n\n- `too_large`: The body is larger than 12 MB."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/lists":{"get":{"operationId":"listLists","tags":["Lists"],"summary":"List lists","description":"All your lists, newest first, with how many contacts each has.","parameters":[{"name":"search","in":"query","required":false,"description":"Only lists whose name contains this text (ignoring case).","schema":{"type":"string"}}],"responses":{"200":{"description":"Your lists.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["lists"],"properties":{"lists":{"type":"array","items":{"$ref":"#/components/schemas/List"},"description":"Newest first."}}},"example":{"lists":[{"id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Weekend regulars","description":"Customers who come in on Saturdays","created_at":"2026-10-14T16:20:00.000Z","total":412,"subscribed":398}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createList","tags":["Lists"],"summary":"Create a list","description":"Creates an empty list. Add people with `POST /v1/contacts/bulk` (`add_to_list`), or when adding or importing them (`listId`).","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInput"},"example":{"name":"Weekend regulars","description":"Customers who come in on Saturdays"}}}},"responses":{"201":{"description":"The new list.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["list"],"properties":{"list":{"$ref":"#/components/schemas/List"}}},"example":{"list":{"id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Weekend regulars","description":"Customers who come in on Saturdays","created_at":"2026-10-14T16:20:00.000Z","total":0,"subscribed":0}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_name`: `name` is missing or empty.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/lists/{id}":{"get":{"operationId":"getList","tags":["Lists"],"summary":"Get a list","description":"One list and how many contacts it has. To see who is on it, use `GET /v1/contacts?listId=...`.","parameters":[{"$ref":"#/components/parameters/ListId"}],"responses":{"200":{"description":"The list.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["list"],"properties":{"list":{"$ref":"#/components/schemas/List"}}},"example":{"list":{"id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Weekend regulars","description":"Customers who come in on Saturdays","created_at":"2026-10-14T16:20:00.000Z","total":412,"subscribed":398}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No list with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateList","tags":["Lists"],"summary":"Rename a list","description":"Changes a list's name and description. Send both: `name` is required, and leaving `description` out clears it. The answer does not include the contact counts.","parameters":[{"$ref":"#/components/parameters/ListId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInput"},"example":{"name":"Saturday regulars","description":"Customers who come in on Saturdays"}}}},"responses":{"200":{"description":"The list.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["list"],"properties":{"list":{"$ref":"#/components/schemas/List"}}},"example":{"list":{"id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Saturday regulars","description":"Customers who come in on Saturdays","created_at":"2026-10-14T16:20:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_name`: `name` is missing or empty.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No list with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteList","tags":["Lists"],"summary":"Delete a list","description":"Deletes a list. The contacts on it are kept. Campaign drafts and segments that point at the list no longer match anyone through it, and keywords that added people to it stop doing so. A list that a workflow starts from or uses in a step cannot be deleted until the workflow is changed.","parameters":[{"$ref":"#/components/parameters/ListId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No list with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `list_in_use`: A workflow starts from this list or uses it in a step; `details.workflows` names them."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/segments":{"get":{"operationId":"listSegments","tags":["Segments"],"summary":"List segments","description":"All your segments, newest first, each with how many contacts match it now.","parameters":[{"name":"search","in":"query","required":false,"description":"Only segments whose name contains this text (ignoring case).","schema":{"type":"string"}}],"responses":{"200":{"description":"Your segments.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["segments"],"properties":{"segments":{"type":"array","items":{"$ref":"#/components/schemas/SegmentWithCounts"},"description":"Newest first."}}},"example":{"segments":[{"id":"4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"San Francisco sourdough fans","description":null,"match":"all","rules":[{"field":"area_code","op":"is","value":"415, 628"},{"field":"custom","key":"favorite_bread","op":"equals","value":"Sourdough"}],"created_at":"2026-11-05T19:11:42.250Z","total":236,"subscribed":229}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createSegment","tags":["Segments"],"summary":"Create a segment","description":"Saves a filter over your contacts, such as \"area code 415 or 628 and favourite bread is sourdough\". A segment is worked out each time it is used, so it always reflects your contacts as they are. Use it as a campaign audience, to enroll people in a workflow, or to filter `GET /v1/contacts`.\n\nA segment has 1 to 20 rules (see `SegmentRule`) and `match`: `all` (every rule) or `any` (at least one). Try rules first with `POST /v1/segments/preview`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentInput"},"example":{"name":"San Francisco sourdough fans","match":"all","rules":[{"field":"area_code","op":"is","value":"415, 628"},{"field":"custom","key":"favorite_bread","op":"equals","value":"Sourdough"}]}}}},"responses":{"201":{"description":"The new segment.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["segment"],"properties":{"segment":{"$ref":"#/components/schemas/Segment"}}},"example":{"segment":{"id":"4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"San Francisco sourdough fans","description":null,"match":"all","rules":[{"field":"area_code","op":"is","value":"415, 628"},{"field":"custom","key":"favorite_bread","op":"equals","value":"Sourdough"}],"created_at":"2026-11-05T19:11:42.250Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_name`: `name` is missing or empty.\n- `no_rules`: `rules` is missing or empty.\n- `too_many_rules`: More than 20 rules.\n- `invalid_rule`: A rule has an unknown field or operator, or a missing or invalid value. The message says which.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/segments/preview":{"post":{"operationId":"previewSegment","tags":["Segments"],"summary":"Count a segment before saving","description":"Counts the contacts that match some rules, without saving anything. An empty list of rules counts nobody.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreviewRequest"},"example":{"match":"any","rules":[{"field":"area_code","op":"is","value":"415"},{"field":"created","op":"within_days","value":30}]}}}},"responses":{"200":{"description":"The counts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCounts"},"example":{"total":312,"subscribed":301}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_rule`: A rule has an unknown field or operator, or a missing or invalid value.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/segments/{id}":{"get":{"operationId":"getSegment","tags":["Segments"],"summary":"Get a segment","description":"One segment and how many contacts match it now. To see who, use `GET /v1/contacts?segmentId=...`.","parameters":[{"$ref":"#/components/parameters/SegmentId"}],"responses":{"200":{"description":"The segment and its counts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["segment","total","subscribed"],"properties":{"segment":{"$ref":"#/components/schemas/Segment"},"total":{"type":"integer","description":"Contacts matching now."},"subscribed":{"type":"integer","description":"Of those, subscribed."}}},"example":{"segment":{"id":"4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"San Francisco sourdough fans","description":null,"match":"all","rules":[{"field":"area_code","op":"is","value":"415, 628"},{"field":"custom","key":"favorite_bread","op":"equals","value":"Sourdough"}],"created_at":"2026-11-05T19:11:42.250Z"},"total":236,"subscribed":229}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No segment with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateSegment","tags":["Segments"],"summary":"Update a segment","description":"Replaces a segment's name, description, match and rules. Send them all: `name` and `rules` are required, and leaving `description` out clears it. The answer does not include counts.","parameters":[{"$ref":"#/components/parameters/SegmentId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentInput"},"example":{"name":"San Francisco bread fans","match":"all","rules":[{"field":"area_code","op":"is","value":"415, 628"},{"field":"custom","key":"favorite_bread","op":"is_set"}]}}}},"responses":{"200":{"description":"The segment.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["segment"],"properties":{"segment":{"$ref":"#/components/schemas/Segment"}}},"example":{"segment":{"id":"4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"San Francisco bread fans","description":null,"match":"all","rules":[{"field":"area_code","op":"is","value":"415, 628"},{"field":"custom","key":"favorite_bread","op":"is_set"}],"created_at":"2026-11-05T19:11:42.250Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_name`: `name` is missing or empty.\n- `no_rules`: `rules` is missing or empty.\n- `too_many_rules`: More than 20 rules.\n- `invalid_rule`: A rule is not valid.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No segment with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteSegment","tags":["Segments"],"summary":"Delete a segment","description":"Deletes a segment. Contacts are not affected. Campaign drafts that use it no longer reach anyone through it.","parameters":[{"$ref":"#/components/parameters/SegmentId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No segment with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns":{"get":{"operationId":"listCampaigns","tags":["Campaigns"],"summary":"List campaigns","description":"Your 200 most recent campaigns (by when they were sent, or created for drafts), with headline results.","parameters":[{"name":"status","in":"query","required":false,"description":"Only campaigns with this status. Other values are ignored.","schema":{"type":"string","enum":["draft","recurring","sending","sent"]}},{"name":"search","in":"query","required":false,"description":"Only campaigns whose name contains this text (ignoring case).","schema":{"type":"string"}}],"responses":{"200":{"description":"Campaigns.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["campaigns"],"properties":{"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/CampaignSummary"},"description":"Most recent first."}}},"example":{"campaigns":[{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"sent","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":1284,"credits":1290,"created_at":"2026-11-18T22:05:31.640Z","started_at":"2026-11-21T17:00:00.000Z","finished_at":"2026-11-21T17:09:47.512Z","scheduled_at":"2026-11-21T17:00:00.000Z","track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null,"delivered":1251,"failed":9,"unsubs":7,"clicked":183,"audience_label":"1 list, 1 segment"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createCampaign","tags":["Campaigns"],"summary":"Create a campaign draft","description":"Saves a campaign as a draft: the message, who it goes to and the number it goes from. Nothing is sent until you call `POST /v1/campaigns/{id}/send`. A draft can be written before your number is approved.\n\nPersonalise the message with `{first_name}`, `{last_name}`, or `{first_name|there}` (a fallback for contacts with no name). Say how to opt out (\"Reply STOP to opt out\"); the `preview` in the answer warns when it is missing. The audience is everyone subscribed unless you give lists or segments.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInput"},"example":{"name":"Holiday stollen","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"trackLinks":true}}}},"responses":{"201":{"description":"The draft and a preview of its message.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignWithPreview"},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"draft","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":0,"credits":0,"created_at":"2026-11-18T22:05:31.640Z","started_at":null,"finished_at":null,"scheduled_at":null,"track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null},"preview":{"encoding":"GSM-7","characters":114,"segments":1,"creditsPerMessage":1,"nonGsm":[],"warnings":["Names vary in length, so some recipients may use one more credit than shown."]}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `empty_body`: `body` is missing or empty.\n- `body_too_long`: `body` is longer than 1,600 characters.\n- `invalid_media`: A `mediaUrls` entry is not an https address.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: A list or segment in `audience` does not exist.\n- `no_sending_number`: The number in `fromNumberId` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns/estimate":{"post":{"operationId":"estimateCampaign","tags":["Campaigns"],"summary":"Estimate a campaign","description":"Counts who a campaign would reach (subscribed people in the audience) and what it would cost, with each person's personalisation filled in, plus your balance. Nothing is saved or sent.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignEstimateRequest"},"example":{"audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out."}}}},"responses":{"200":{"description":"The estimate.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignEstimate"},"example":{"recipients":1284,"credits":1290,"balance":4210,"preview":{"encoding":"GSM-7","characters":114,"segments":1,"creditsPerMessage":1,"nonGsm":[],"warnings":["Names vary in length, so some recipients may use one more credit than shown."]}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: A list or segment in `audience` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns/test":{"post":{"operationId":"sendTestMessage","tags":["Campaigns"],"summary":"Send a test text","description":"Sends a message to one phone to see how it looks. The text starts with \"[Test] \" and personalisation is filled in with the name Sam Rivera. It costs credits like any text and goes out at once (no sending hours).\n\nA test can only go to a teammate's own mobile number (saved in their profile in the dashboard) or to a subscribed contact: never to a stranger, and never to someone who opted out. Up to 20 tests per 24 hours per account. Sending needs an approved number and, after the free trial, a plan.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendRequest"},"example":{"to":"+14155550101","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out."}}}},"responses":{"201":{"description":"The test text, queued.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendResult"},"example":{"messageId":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","credits":1}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_phone`: `to` is not a valid US or Canada mobile number.\n- `empty_body`: `body` is missing or empty.\n- `invalid_media`: `mediaUrls` has more than 10 entries or one that is not an https address.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired","description":"Sending is not possible right now. `error.code` is one of:\n\n- `insufficient_credits`: Your credit balance is too low for this. `error.details` has `needed` and `available`.\n- `trial_ended`: The 14-day free trial is over. Choose a plan on the Billing page of the dashboard to keep sending.\n- `plan_required`: Your paid plan has ended. Choose a plan on the Billing page of the dashboard to keep sending."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `test_recipient`: `to` is neither a teammate's own mobile number nor a subscribed contact.\n- `unsubscribed`: `to` belongs to a contact who opted out.\n- `blocked`: The number is blocked on SMSBlast (by SMSBlast staff, for every account) and cannot be texted.\n- `no_active_number`: You have no approved sending number yet.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited","description":"Too many requests. `error.code` is one of:\n\n- `rate_limited`: More than your API key's requests per minute. Wait for `Retry-After` seconds.\n- `test_limit`: You have sent 20 tests in the last 24 hours."}}}},"/v1/campaigns/{id}":{"get":{"operationId":"getCampaign","tags":["Campaigns"],"summary":"Get a campaign report","description":"One campaign with its results: texts by status, credits refunded, opt-outs within 3 days and link clicks.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"The campaign and how it went.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignReport"},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"sent","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":1284,"credits":1290,"created_at":"2026-11-18T22:05:31.640Z","started_at":"2026-11-21T17:00:00.000Z","finished_at":"2026-11-21T17:09:47.512Z","scheduled_at":"2026-11-21T17:00:00.000Z","track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null,"audience_label":"1 list, 1 segment"},"counts":{"queued":0,"sending":0,"sent":21,"delivered":1251,"failed":9,"skipped":3},"creditsRefunded":6,"unsubs":7,"clicks":{"clicks":241,"people":183,"links":1,"byUrl":[{"url":"https://example.com/stollen","clicks":241,"people":183}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateCampaign","tags":["Campaigns"],"summary":"Update a campaign draft","description":"Changes a draft, or a recurring campaign (the change applies to its later dates). Only the fields you send change. Campaigns that were sent, scheduled or stopped cannot be changed.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaignRequest"},"example":{"name":"Holiday stollen (final)","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"]}}}}},"responses":{"200":{"description":"The draft and a preview of its message.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignWithPreview"},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen (final)","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"draft","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":[]},"recipients":0,"credits":0,"created_at":"2026-11-18T22:05:31.640Z","started_at":null,"finished_at":null,"scheduled_at":null,"track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null},"preview":{"encoding":"GSM-7","characters":114,"segments":1,"creditsPerMessage":1,"nonGsm":[],"warnings":["Names vary in length, so some recipients may use one more credit than shown."]}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `empty_body`: `body` is empty.\n- `body_too_long`: `body` is longer than 1,600 characters.\n- `invalid_media`: A `mediaUrls` entry is not an https address.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id, or a list or segment in `audience` does not exist.\n- `no_sending_number`: The number in `fromNumberId` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_a_draft`: The campaign has already been sent, scheduled or stopped."},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteCampaign","tags":["Campaigns"],"summary":"Delete a campaign draft","description":"Deletes a draft, or a recurring campaign (which ends its schedule; the campaigns it already sent are kept). Campaigns that were sent, scheduled or stopped cannot be deleted.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_a_draft`: The campaign is not a draft or recurring campaign."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns/{id}/duplicate":{"post":{"operationId":"duplicateCampaign","tags":["Campaigns"],"summary":"Duplicate a campaign","description":"Copies any campaign (sent or not) into a new draft named \"<name> (copy)\", with the same message, pictures, number, audience and link tracking.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"The new draft.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["campaign"],"properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}},"example":{"campaign":{"id":"2e6a8c0d-4f1b-4d3e-9a5c-7b9d1f3a5c75","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen (copy)","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"draft","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":0,"credits":0,"created_at":"2026-11-22T19:40:00.512Z","started_at":null,"finished_at":null,"scheduled_at":null,"track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns/{id}/cancel":{"post":{"operationId":"cancelCampaign","tags":["Campaigns"],"summary":"Stop a campaign","description":"Stops a campaign that is scheduled or still going out. Every text not yet handed to the carrier is cancelled (it becomes `skipped`, with the error \"The campaign was stopped\") and its credits are given back at once. Texts already on their way are not recalled.\n\nThe campaign becomes `canceled`. It cannot be sent again, but you can duplicate it. No `campaign.sent` webhook follows.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"The stopped campaign.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCancelResult"},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"canceled","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":1284,"credits":1290,"created_at":"2026-11-18T22:05:31.640Z","started_at":"2026-11-21T17:00:00.000Z","finished_at":"2026-11-21T09:12:40.118Z","scheduled_at":"2026-11-21T17:00:00.000Z","track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null},"canceled":1284,"creditsReturned":1290}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_sending`: The campaign is not scheduled or going out (it is a draft, a recurring campaign, already sent, or already stopped).\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns/{id}/recurring":{"post":{"operationId":"setCampaignRecurring","tags":["Campaigns"],"summary":"Make a campaign recurring","description":"Turns a draft into a recurring campaign, or changes the schedule of one: daily, weekly on chosen days, or monthly on a day of the month, at a time of day in your account's time zone (between 8:00 and 20:59).\n\nA recurring campaign is a template and never sends itself. At each occurrence a copy named \"<name> · Nov 21\" (with `parent_id` set to the template) is made and sent to the audience as it is at that moment, by the same rules as `POST /v1/campaigns/{id}/send`: credits for the whole send taken at once, only subscribed people, each in their sending hours. If a copy cannot go out (not enough credits, nobody subscribed, no approved number), it is dropped, the reason is kept in the template's `last_error` and the series carries on with the next date. When the schedule reaches its `endDate`, the template goes back to being a draft.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRecurringRequest"},"example":{"recurrence":{"freq":"weekly","interval":1,"weekdays":[5],"time":"10:00","startDate":"2026-11-27","endDate":"2027-02-26"}}}}},"responses":{"200":{"description":"The recurring campaign.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["campaign"],"properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Friday bread drop","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"recurring","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":0,"credits":0,"created_at":"2026-11-18T22:05:31.640Z","started_at":null,"finished_at":null,"scheduled_at":null,"track_links":true,"recurrence":{"freq":"weekly","interval":1,"time":"10:00","startDate":"2026-11-27","endDate":"2027-02-26","weekdays":[5]},"next_run_at":"2026-11-27T18:00:00.000Z","parent_id":null,"last_error":null}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_recurrence`: The schedule is not valid (the message says what to fix), or it has no dates left.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_a_draft`: The campaign is not a draft or recurring campaign, or it is an occurrence sent by one.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"stopCampaignRecurring","tags":["Campaigns"],"summary":"Stop a recurring campaign","description":"Stops the schedule. The campaign becomes a draft again (with its last schedule kept in `recurrence`); the campaigns it already sent stay as they are.","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"description":"The campaign, a draft again.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["campaign"],"properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Friday bread drop","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"draft","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":0,"credits":0,"created_at":"2026-11-18T22:05:31.640Z","started_at":null,"finished_at":null,"scheduled_at":null,"track_links":true,"recurrence":{"freq":"weekly","interval":1,"time":"10:00","startDate":"2026-11-27","endDate":"2027-02-26","weekdays":[5]},"next_run_at":null,"parent_id":null,"last_error":null}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_recurring`: The campaign is not recurring."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/campaigns/{id}/send":{"post":{"operationId":"sendCampaign","tags":["Campaigns"],"summary":"Send or schedule a campaign","description":"Sends a draft now, or at `sendAt` (up to a year ahead). The audience is worked out at this moment: everyone subscribed in it gets one text, personalised for them (numbers blocked on SMSBlast are left out).\n\n**The credits for every text are taken now, all or nothing**: if your balance is too low nothing is sent (`insufficient_credits`, with `needed`, `available` and `recipients`). Texts that cannot be delivered to the carrier, or are skipped because the person opted out before their text went out, get their credits back.\n\n**Sending hours:** each text waits until 8am to 9pm in the recipient's time zone (their contact time zone, else your account's), so a campaign sent in the evening reaches some people the next morning.\n\nThe campaign becomes `sending` at once (also when scheduled) and `sent` when its last text has gone out; the `campaign.sending` and `campaign.sent` webhooks tell you. To stop a scheduled campaign, or one still going out, use `POST /v1/campaigns/{id}/cancel`. The body is optional: send none (or `{}`) to send now.","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSendRequest"},"example":{"sendAt":"2026-11-28T17:00:00Z"}}}},"responses":{"200":{"description":"The campaign, now sending.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSendResult"},"example":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Holiday stollen","body":"Hi {first_name|there}! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","media_urls":[],"from_number_id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","status":"sending","audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"],"segments":["4f2a8c6e-1d3b-4f5a-9e7c-8b0d2f4a6c53"]},"recipients":1284,"credits":1290,"created_at":"2026-11-18T22:05:31.640Z","started_at":"2026-11-28T17:00:00.000Z","finished_at":null,"scheduled_at":"2026-11-28T17:00:00.000Z","track_links":true,"recurrence":null,"next_run_at":null,"parent_id":null,"last_error":null},"recipients":1284,"credits":1290,"balanceAfter":2920}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_send_at`: `sendAt` is not a date and time, is in the past, or is more than a year ahead.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired","description":"Sending is not possible right now. `error.code` is one of:\n\n- `insufficient_credits`: Not enough credits for every text. `error.details` has `needed`, `available` and `recipients`.\n- `trial_ended`: The 14-day free trial is over. Choose a plan on the Billing page of the dashboard to keep sending.\n- `plan_required`: Your paid plan has ended. Choose a plan on the Billing page of the dashboard to keep sending."},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No campaign with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `already_sent`: The campaign is not a draft: it was already sent, scheduled or stopped.\n- `recurring`: It is a recurring campaign, which only sends on its schedule. Stop the schedule (`DELETE /v1/campaigns/{id}/recurring`) to send it by hand.\n- `number_not_active`: The campaign's number is not approved yet (`details.numberStatus` says what it is), or you have no number.\n- `no_recipients`: Nobody subscribed is in the audience.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/workflows":{"get":{"operationId":"listWorkflows","tags":["Workflows"],"summary":"List workflows","description":"All your workflows, newest first, with counts of people part way through, finished, exited and failed, and texts sent.","responses":{"200":{"description":"Your workflows.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["workflows"],"properties":{"workflows":{"type":"array","items":{"$ref":"#/components/schemas/Workflow"},"description":"Newest first."}}},"example":{"workflows":[{"id":"5e7c9a1b-3d5f-4a7c-9e1b-3d5f7a9c1e74","name":"Welcome series","enabled":true,"trigger":{"type":"subscribed"},"steps":[{"type":"send","body":"Welcome to Corner Bakery texts, {first_name|friend}! Show this text for a free cookie. Reply STOP to opt out."},{"type":"wait","amount":3,"unit":"days"},{"type":"send","body":"Did you know we bake rye every Thursday? Pre-order at https://example.com/order. Reply STOP to opt out."},{"type":"add_to_list","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}],"createdAt":"2026-11-10T20:14:05.902Z","updatedAt":"2026-11-12T17:30:44.118Z","stats":{"active":37,"completed":212,"exited":6,"failed":0,"sent":461}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createWorkflow","tags":["Workflows"],"summary":"Create a workflow","description":"Creates an automatic series: when the trigger happens to a contact (they subscribe, are added to a list, text a keyword, or it is their birthday), they go through the steps one by one: send a text, wait, add to or remove from a list. Each person goes through a workflow once (a birthday workflow once a year).\n\nWorkflow texts follow campaign rules: personalisation tags are filled in, they cost credits like any text, they wait for 8am to 9pm in the contact's time zone, and links become tracked short links. A person who opts out leaves the workflow at their next step. A run fails when a text cannot be queued: no approved number, not enough credits, or the account cannot send (the free trial is over and there is no plan).\n\nA new workflow is off unless you send `enabled: true`, which needs at least one step.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowRequest"},"example":{"name":"Welcome series","trigger":{"type":"subscribed"},"steps":[{"type":"send","body":"Welcome to Corner Bakery texts, {first_name|friend}! Show this text for a free cookie. Reply STOP to opt out."},{"type":"wait","amount":3,"unit":"days"},{"type":"send","body":"Did you know we bake rye every Thursday? Pre-order at https://example.com/order. Reply STOP to opt out."},{"type":"add_to_list","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}],"enabled":true}}}},"responses":{"201":{"description":"The new workflow.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["workflow"],"properties":{"workflow":{"$ref":"#/components/schemas/Workflow"}}},"example":{"workflow":{"id":"5e7c9a1b-3d5f-4a7c-9e1b-3d5f7a9c1e74","name":"Welcome series","enabled":true,"trigger":{"type":"subscribed"},"steps":[{"type":"send","body":"Welcome to Corner Bakery texts, {first_name|friend}! Show this text for a free cookie. Reply STOP to opt out."},{"type":"wait","amount":3,"unit":"days"},{"type":"send","body":"Did you know we bake rye every Thursday? Pre-order at https://example.com/order. Reply STOP to opt out."},{"type":"add_to_list","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}],"createdAt":"2026-11-10T20:14:05.902Z","updatedAt":"2026-11-10T20:14:05.902Z","stats":{"active":0,"completed":0,"exited":0,"failed":0,"sent":0}}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_trigger`: `trigger` is missing or not valid (an unknown type, a list that does not exist, an empty keyword, or a birthday hour outside 8 to 20).\n- `invalid_steps`: A step is not valid (the message says which and why), or there are more than 30.\n- `no_steps`: `enabled` is `true` but there are no steps.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/workflows/{id}":{"get":{"operationId":"getWorkflow","tags":["Workflows"],"summary":"Get a workflow","description":"One workflow, its steps and its counts.","parameters":[{"$ref":"#/components/parameters/WorkflowId"}],"responses":{"200":{"description":"The workflow.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["workflow"],"properties":{"workflow":{"$ref":"#/components/schemas/Workflow"}}},"example":{"workflow":{"id":"5e7c9a1b-3d5f-4a7c-9e1b-3d5f7a9c1e74","name":"Welcome series","enabled":true,"trigger":{"type":"subscribed"},"steps":[{"type":"send","body":"Welcome to Corner Bakery texts, {first_name|friend}! Show this text for a free cookie. Reply STOP to opt out."},{"type":"wait","amount":3,"unit":"days"},{"type":"send","body":"Did you know we bake rye every Thursday? Pre-order at https://example.com/order. Reply STOP to opt out."},{"type":"add_to_list","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}],"createdAt":"2026-11-10T20:14:05.902Z","updatedAt":"2026-11-12T17:30:44.118Z","stats":{"active":37,"completed":212,"exited":6,"failed":0,"sent":461}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No workflow with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateWorkflow","tags":["Workflows"],"summary":"Update a workflow","description":"Changes a workflow's name, trigger or steps, or switches it on or off. Only the fields you send change; `steps`, when sent, replaces the whole list.\n\nChanges apply to people already part way through, from the step number they are on: if you insert or remove steps before that point, they carry on from whatever step now has that number. Switching a workflow off pauses everyone in it; switching it on again lets them carry on.","parameters":[{"$ref":"#/components/parameters/WorkflowId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowRequest"},"example":{"enabled":false}}}},"responses":{"200":{"description":"The workflow.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["workflow"],"properties":{"workflow":{"$ref":"#/components/schemas/Workflow"}}},"example":{"workflow":{"id":"5e7c9a1b-3d5f-4a7c-9e1b-3d5f7a9c1e74","name":"Welcome series","enabled":false,"trigger":{"type":"subscribed"},"steps":[{"type":"send","body":"Welcome to Corner Bakery texts, {first_name|friend}! Show this text for a free cookie. Reply STOP to opt out."},{"type":"wait","amount":3,"unit":"days"},{"type":"send","body":"Did you know we bake rye every Thursday? Pre-order at https://example.com/order. Reply STOP to opt out."},{"type":"add_to_list","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}],"createdAt":"2026-11-10T20:14:05.902Z","updatedAt":"2026-11-22T18:02:31.004Z","stats":{"active":37,"completed":212,"exited":6,"failed":0,"sent":461}}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_trigger`: `trigger` is not valid.\n- `invalid_steps`: A step is not valid, or there are more than 30.\n- `no_steps`: Switching on a workflow with no steps.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No workflow with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteWorkflow","tags":["Workflows"],"summary":"Delete a workflow","description":"Deletes a workflow and everyone's place in it. Texts it already queued still go out.","parameters":[{"$ref":"#/components/parameters/WorkflowId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No workflow with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/workflows/{id}/runs":{"get":{"operationId":"listWorkflowRuns","tags":["Workflows"],"summary":"List people in a workflow","description":"The people who started a workflow (one run each), newest first, with where they are and how their run ended.","parameters":[{"$ref":"#/components/parameters/WorkflowId"},{"name":"status","in":"query","required":false,"description":"Only runs with this status.","schema":{"type":"string","enum":["active","completed","exited","failed"],"description":"`active`: part way through. `completed`: went through every step. `exited`: stopped early because the contact opted out or was deleted (or the workflow was). `failed`: a text could not be queued (no approved number, not enough credits, or the account cannot send: the free trial is over and there is no plan); `detail` says which."}},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Runs.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["runs"],"properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRun"},"description":"Newest first."}}},"example":{"runs":[{"id":"7a9c1e3b-5d7f-4c9a-8b1d-3f5a7c9e1b85","status":"active","step":2,"nextRunAt":"2026-11-23T18:24:10.000Z","detail":null,"createdAt":"2026-11-20T18:24:09.950Z","finishedAt":null,"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno"}},{"id":"c9e1a3c5-7e9b-4d1f-a3c5-e7a9c1e3a5b6","status":"exited","step":2,"nextRunAt":null,"detail":"The contact opted out","createdAt":"2026-11-09T21:40:52.300Z","finishedAt":"2026-11-19T23:15:04.000Z","contact":{"id":"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71","phone":"+14155550102","first_name":"Ben","last_name":"Carter"}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No workflow with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/workflows/{id}/enroll":{"post":{"operationId":"enrollInWorkflow","tags":["Workflows"],"summary":"Enroll contacts in a workflow","description":"Starts the workflow now for contacts you choose, whatever its trigger: specific contacts (`contactIds`), or an audience like a campaign's (`audience`: everyone, lists and/or segments). Only subscribed contacts who have not been through the workflow before start; `started` says how many did.\n\nSay who explicitly: `contactIds` as a list, or `audience` as an object (`{\"all\": true}` for everyone subscribed). A request with neither is refused (`no_audience`). If the workflow is switched off, the people wait at the first step until it is switched on.","parameters":[{"$ref":"#/components/parameters/WorkflowId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollRequest"},"example":{"audience":{"lists":["e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"]}}}}},"responses":{"200":{"description":"How many started.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollResult"},"example":{"started":398}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `no_steps`: The workflow has no steps.\n- `no_audience`: Neither `contactIds` (a list) nor `audience` (an object) was sent.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No workflow with that id, or a list or segment in `audience` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/forms":{"get":{"operationId":"listForms","tags":["Forms"],"summary":"List signup forms","description":"All your signup forms, newest first, with their views and signups.","responses":{"200":{"description":"Your forms.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["forms"],"properties":{"forms":{"type":"array","items":{"$ref":"#/components/schemas/Form"},"description":"Newest first."}}},"example":{"forms":[{"id":"a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f","publicId":"Rk4xT9vQ","name":"Website footer","title":"Get texts from Corner Bakery","description":"Fresh bread alerts and a free cookie on your birthday.","buttonLabel":"Sign up","successMessage":"You're in! Watch for a text from us shortly.","fields":["first_name","birthday"],"consentText":"By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","welcomeText":"Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.","popup":{"delaySeconds":5,"exitIntent":true,"showOnMobile":true,"frequencyDays":7},"style":{"accent":"#B5562B","theme":"light"},"enabled":true,"views":5120,"submissions":214,"createdAt":"2026-11-03T17:45:20.118Z","updatedAt":"2026-11-15T21:02:09.640Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createForm","tags":["Forms"],"summary":"Create a signup form","description":"Creates a signup form, switched on at once (unless `enabled: false`). Every field is optional and has a sensible default, including consent wording that names your business. Up to 50 forms per account.\n\nPeople can then sign up on the hosted page `https://app.smsblast.net/f/{publicId}`, or on your own website with the embed code `<script async src=\"https://app.smsblast.net/embed/form.js\" data-smsblast-form=\"PUBLIC_ID\"></script>` (add `data-mode=\"popup\"` for a popup). To build your own form, use the public endpoints under `/v1/public/forms/{publicId}`.\n\nThe consent wording and the welcome text must both say how to stop the texts (mention STOP).","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormInput"},"example":{"name":"Website footer","description":"Fresh bread alerts and a free cookie on your birthday.","fields":["first_name","birthday"],"listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","style":{"accent":"#B5562B","theme":"light"}}}}},"responses":{"201":{"description":"The new form.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["form"],"properties":{"form":{"$ref":"#/components/schemas/Form"}}},"example":{"form":{"id":"a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f","publicId":"Rk4xT9vQ","name":"Website footer","title":"Get texts from Corner Bakery","description":"Fresh bread alerts and a free cookie on your birthday.","buttonLabel":"Sign up","successMessage":"You're in! Watch for a text from us shortly.","fields":["first_name","birthday"],"consentText":"By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","welcomeText":"Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.","popup":{"delaySeconds":5,"exitIntent":true,"showOnMobile":true,"frequencyDays":7},"style":{"accent":"#B5562B","theme":"light"},"enabled":true,"views":0,"submissions":0,"createdAt":"2026-11-03T17:45:20.118Z","updatedAt":"2026-11-03T17:45:20.118Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_fields`: `fields` is not a list, or names an unknown field.\n- `invalid_consent`: `consentText` does not mention STOP.\n- `invalid_welcome`: `welcomeText` does not mention STOP.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The list in `listId` does not exist."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `too_many_forms`: You already have 50 forms.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/forms/{id}":{"get":{"operationId":"getForm","tags":["Forms"],"summary":"Get a signup form","description":"One signup form, with its views and signups.","parameters":[{"$ref":"#/components/parameters/FormId"}],"responses":{"200":{"description":"The form.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["form"],"properties":{"form":{"$ref":"#/components/schemas/Form"}}},"example":{"form":{"id":"a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f","publicId":"Rk4xT9vQ","name":"Website footer","title":"Get texts from Corner Bakery","description":"Fresh bread alerts and a free cookie on your birthday.","buttonLabel":"Sign up","successMessage":"You're in! Watch for a text from us shortly.","fields":["first_name","birthday"],"consentText":"By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","welcomeText":"Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.","popup":{"delaySeconds":5,"exitIntent":true,"showOnMobile":true,"frequencyDays":7},"style":{"accent":"#B5562B","theme":"light"},"enabled":true,"views":5120,"submissions":214,"createdAt":"2026-11-03T17:45:20.118Z","updatedAt":"2026-11-15T21:02:09.640Z"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No form with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateForm","tags":["Forms"],"summary":"Update a signup form","description":"Changes a signup form. Only the fields you send change, except inside `popup` and `style`: those objects are replaced, and a setting left out of them goes back to its default. Changes show on the hosted page and every embed at once.","parameters":[{"$ref":"#/components/parameters/FormId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormInput"},"example":{"title":"Free cookie on your birthday","enabled":true}}}},"responses":{"200":{"description":"The form.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["form"],"properties":{"form":{"$ref":"#/components/schemas/Form"}}},"example":{"form":{"id":"a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f","publicId":"Rk4xT9vQ","name":"Website footer","title":"Free cookie on your birthday","description":"Fresh bread alerts and a free cookie on your birthday.","buttonLabel":"Sign up","successMessage":"You're in! Watch for a text from us shortly.","fields":["first_name","birthday"],"consentText":"By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","welcomeText":"Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.","popup":{"delaySeconds":5,"exitIntent":true,"showOnMobile":true,"frequencyDays":7},"style":{"accent":"#B5562B","theme":"light"},"enabled":true,"views":5120,"submissions":214,"createdAt":"2026-11-03T17:45:20.118Z","updatedAt":"2026-11-22T16:20:41.300Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_fields`: `fields` is not a list, or names an unknown field.\n- `invalid_consent`: `consentText` does not mention STOP.\n- `invalid_welcome`: `welcomeText` does not mention STOP.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No form with that id, or the list in `listId` does not exist."},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteForm","tags":["Forms"],"summary":"Delete a signup form","description":"Deletes a signup form. Its hosted page and embeds stop working. Contacts who signed up with it, and their consent records, are kept.","parameters":[{"$ref":"#/components/parameters/FormId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No form with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/public/forms/{publicId}":{"get":{"operationId":"getPublicForm","tags":["Forms"],"summary":"Show a form (public)","description":"What a web page needs to show one of your signup forms: title, fields, consent wording, links to your terms and privacy pages, look and popup settings. **No API key**: this is meant to be called from a browser on any website (it allows every origin). Add `?view=1` to count a view.\n\nThe hosted page and the embed code (`<script async src=\"https://app.smsblast.net/embed/form.js\" data-smsblast-form=\"PUBLIC_ID\"></script>`) already do this for you.","security":[],"parameters":[{"$ref":"#/components/parameters/PublicFormId"},{"name":"view","in":"query","required":false,"description":"`1` counts this as a view of the form.","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"The form.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["form"],"properties":{"form":{"$ref":"#/components/schemas/PublicForm"}}},"example":{"form":{"publicId":"Rk4xT9vQ","business":"Corner Bakery","title":"Get texts from Corner Bakery","description":"Fresh bread alerts and a free cookie on your birthday.","buttonLabel":"Sign up","successMessage":"You're in! Watch for a text from us shortly.","fields":["first_name","birthday"],"consentText":"By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.","termsUrl":"https://app.smsblast.net/legal/cb7Kq2/terms","privacyUrl":"https://app.smsblast.net/legal/cb7Kq2/privacy","popup":{"delaySeconds":5,"exitIntent":true,"showOnMobile":true,"frequencyDays":7},"style":{"accent":"#B5562B","theme":"light"}}}}}},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `form_not_found`: There is no form with that public id, or it is switched off."}}},"post":{"operationId":"submitPublicForm","tags":["Forms"],"summary":"Sign up with a form (public)","description":"Signs a person up through one of your forms, from your own page or app. **No API key**: call it from the person's browser (it allows every origin), not from your server, so the proof of consent records their IP address and browser. Submitting is their opt-in: it is stored with the exact consent wording the form shows, the page, the time, their IP address and browser.\n\n- Someone new becomes a subscribed contact (`contact.created` and `contact.opted_in` webhooks) and gets the welcome text right away, if the form has one and your account can send (an approved number, enough credits, and a plan once the free trial is over). Without that the signup is still kept, just with no welcome text.\n- Someone already subscribed only gets empty details filled in; the answer says `already_subscribed`.\n- **A number that opted out is not resubscribed**, because anyone can type any number into a form: nothing changes and nothing is texted, and the answer (`opted_out`) tells the person to text START to your number from their own phone.\n\nNew and already subscribed people are put on the form's list (which starts workflows triggered by that list for people new to it), and new subscribers start workflows triggered by subscribing. Only the fields the form asks for are kept. Up to 20 signups per 10 minutes from one IP address.","security":[],"parameters":[{"$ref":"#/components/parameters/PublicFormId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmitRequest"},"example":{"phone":"(415) 555-0104","first_name":"Dana","birthday":"04/12","page":"https://example.com/"}}}},"responses":{"201":{"description":"Signed up.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmitResult"},"example":{"status":"subscribed","message":"You're in! Watch for a text from us shortly."}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_phone`: `phone` is not a valid US or Canada mobile number.\n- `invalid_email`: `email` does not look like an email address.\n- `invalid_json`: The body is not a JSON object."},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `form_not_found`: There is no form with that public id, or it is switched off."},"429":{"$ref":"#/components/responses/TooManySignups","description":"Too many requests. `error.code` is one of:\n\n- `rate_limited`: More than 20 signups from this IP address in 10 minutes."}}}},"/v1/conversations":{"get":{"operationId":"listConversations","tags":["Conversations"],"summary":"List conversations","description":"The inbox: one conversation per phone number, most recent first. Every text that comes in opens (or reopens) one; texts you send show up in them too.\n\nChoose a folder: `all`, `unread`, `open`, `pending`, `closed` or `unassigned`. The `mine...` folders are for teammates logged in to the dashboard and are always empty with an API key.","parameters":[{"name":"folder","in":"query","required":false,"description":"Which folder. Unknown values mean `all`.","schema":{"type":"string","enum":["all","unread","open","pending","closed","unassigned","mine","mine_unread","mine_open","mine_pending"],"default":"all"}},{"name":"search","in":"query","required":false,"description":"Text to look for in the contact's first or last name and the last message, or (3 or more digits) the phone number.","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Conversations.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["conversations"],"properties":{"conversations":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"},"description":"Most recent first."}}},"example":{"conversations":[{"id":"6b8d0f2a-4c6e-4a8c-9e0b-2d4f6a8c0e18","phone":"+14155550101","contact_id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","first_name":"Alice","last_name":"Moreno","contact_status":"subscribed","status":"open","assigned_user_id":null,"assigned_name":null,"unread":1,"last_message_at":"2026-11-20T16:45:03.118Z","last_message_preview":"Do you have rye bread today?","last_direction":"inbound"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"startConversation","tags":["Conversations"],"summary":"Text someone from the inbox","description":"Sends a one-to-one text to a subscribed contact and puts it in their conversation (starting one if needed). It goes out at once, from the number you last used with them (or your first approved number). Text only: no pictures, no personalisation.\n\nCredits are taken when the text is queued: 1 per SMS segment (160 plain characters, or 153 per segment once a text is split; 70 and 67 when it contains an emoji or another character outside GSM-7), or 3 for a picture message. A text that cannot be sent, or is skipped because the person opted out first, gets its credits back.\n\nTexts only go to subscribed contacts. Sending needs an approved (active) sending number and, once the 14-day free trial is over, a paid plan.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConversationRequest"},"example":{"phone":"+14155550101","body":"Hi Alice, we saved you a rye loaf. It is at the counter until 3pm."}}}},"responses":{"201":{"description":"The text, queued.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationSendResult"},"example":{"messageId":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","conversationId":"6b8d0f2a-4c6e-4a8c-9e0b-2d4f6a8c0e18","credits":1}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `empty_body`: `body` is missing or empty.\n- `body_too_long`: `body` is longer than 1,600 characters.\n- `invalid_phone`: `phone` is not a valid US or Canada mobile number.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired","description":"Sending is not possible right now. `error.code` is one of:\n\n- `insufficient_credits`: Your credit balance is too low for this. `error.details` has `needed` and `available`.\n- `trial_ended`: The 14-day free trial is over. Choose a plan on the Billing page of the dashboard to keep sending.\n- `plan_required`: Your paid plan has ended. Choose a plan on the Billing page of the dashboard to keep sending."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_a_contact`: The number is not one of your contacts.\n- `unsubscribed`: The contact has opted out.\n- `blocked`: The number is blocked on SMSBlast (by SMSBlast staff, for every account) and cannot be texted.\n- `no_active_number`: You have no approved sending number yet.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/conversations/counts":{"get":{"operationId":"getConversationCounts","tags":["Conversations"],"summary":"Count conversations by folder","description":"How many conversations each inbox folder holds. The `mine...` counts are always 0 with an API key.","responses":{"200":{"description":"The counts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["counts"],"properties":{"counts":{"$ref":"#/components/schemas/ConversationCounts"}}},"example":{"counts":{"all":148,"unread":5,"open":22,"pending":3,"closed":123,"unassigned":19,"mine":0,"mine_unread":0,"mine_open":0,"mine_pending":0}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/conversations/{id}":{"get":{"operationId":"getConversation","tags":["Conversations"],"summary":"Get a conversation","description":"One conversation and its latest 200 texts (oldest first), whichever of your numbers they went through. Skipped texts are left out. Reading it does not mark it read: use `PATCH` with `read: true`.","parameters":[{"$ref":"#/components/parameters/ConversationId"}],"responses":{"200":{"description":"The conversation and its texts.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"},"example":{"conversation":{"id":"6b8d0f2a-4c6e-4a8c-9e0b-2d4f6a8c0e18","phone":"+14155550101","contact_id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","first_name":"Alice","last_name":"Moreno","contact_status":"subscribed","status":"open","assigned_user_id":null,"assigned_name":null,"unread":1,"last_message_at":"2026-11-20T16:45:03.118Z","last_message_preview":"Do you have rye bread today?","last_direction":"inbound"},"messages":[{"id":"e5a7c9e1-3b5d-4f7a-9c1e-3b5d7f9a1c2d","direction":"outbound","kind":"campaign","body":"Hi Alice! Our holiday stollen is back this weekend: 15% off with code STOLLEN. Reply STOP to opt out.","status":"delivered","created_at":"2026-11-19T17:00:00.412Z","user_name":null,"campaign_name":"Holiday stollen"},{"id":"d1f3a5c7-9e0b-4d2f-a4c6-e8f0b2d4f697","direction":"inbound","kind":"inbound","body":"Do you have rye bread today?","status":"received","created_at":"2026-11-20T16:45:03.118Z","user_name":null,"campaign_name":null}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No conversation with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateConversation","tags":["Conversations"],"summary":"Update a conversation","description":"Sets a conversation's status, assigns it to a teammate (or unassigns it with `null`), or marks it read. Only the fields you send change; values that are not allowed are ignored, and a body with nothing to change answers `ok` without checking the conversation exists.","parameters":[{"$ref":"#/components/parameters/ConversationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationRequest"},"example":{"status":"pending","assignedUserId":"9d1f3b5c-7e9a-4b1d-8c3f-5a7c9e1b3d63","read":true}}}},"responses":{"200":{"description":"Updated.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No conversation with that id, or `assignedUserId` is not one of your teammates."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/conversations/{id}/messages":{"post":{"operationId":"replyToConversation","tags":["Conversations"],"summary":"Reply in a conversation","description":"Sends a text in a conversation, to its phone number, and marks the conversation read. The person must be a subscribed contact. It goes out at once, from the number you last used with them. Text only.\n\nCredits are taken when the text is queued: 1 per SMS segment (160 plain characters, or 153 per segment once a text is split; 70 and 67 when it contains an emoji or another character outside GSM-7), or 3 for a picture message. A text that cannot be sent, or is skipped because the person opted out first, gets its credits back.","parameters":[{"$ref":"#/components/parameters/ConversationId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyRequest"},"example":{"body":"Yes, we have rye today until 3pm."}}}},"responses":{"201":{"description":"The text, queued.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationSendResult"},"example":{"messageId":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","conversationId":"6b8d0f2a-4c6e-4a8c-9e0b-2d4f6a8c0e18","credits":1}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `empty_body`: `body` is missing or empty.\n- `body_too_long`: `body` is longer than 1,600 characters.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired","description":"Sending is not possible right now. `error.code` is one of:\n\n- `insufficient_credits`: Your credit balance is too low for this. `error.details` has `needed` and `available`.\n- `trial_ended`: The 14-day free trial is over. Choose a plan on the Billing page of the dashboard to keep sending.\n- `plan_required`: Your paid plan has ended. Choose a plan on the Billing page of the dashboard to keep sending."},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No conversation with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `not_a_contact`: The number is not one of your contacts.\n- `unsubscribed`: The contact has opted out.\n- `blocked`: The number is blocked on SMSBlast (by SMSBlast staff, for every account) and cannot be texted.\n- `no_active_number`: You have no approved sending number yet.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/keywords":{"get":{"operationId":"listKeywords","tags":["Keywords"],"summary":"List keywords","description":"Your signup keywords, newest first, with how many people joined with each.","responses":{"200":{"description":"Keywords.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["keywords"],"properties":{"keywords":{"type":"array","items":{"$ref":"#/components/schemas/Keyword"},"description":"Newest first."}}},"example":{"keywords":[{"id":"f0a2c4e6-8b1d-4f3a-9c5e-7d9f1b3d5f29","word":"BREAD","reply":"Corner Bakery: You are in! Fresh bread alerts, about 4 texts a month. Msg & data rates may apply. Reply HELP for help, STOP to opt out.","list_id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30","list_name":"Weekend regulars","number":"+14155550100","signups":86,"created_at":"2026-10-20T15:12:44.201Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"saveKeyword","tags":["Keywords"],"summary":"Set up a keyword","description":"Sets up a signup keyword such as JOIN on one of your numbers: when someone texts exactly that word (any case, punctuation ignored), they become a subscribed contact (texting it is their consent, recorded as `keyword:JOIN`), get your `reply`, are put on `listId` if given, and start any workflows triggered by subscribing, by that keyword or by that list. Someone who opted out and texts the keyword is resubscribed.\n\nSaving a word that already exists on that number replaces its reply and list. The reply costs credits like any text (it is skipped if you run out). STOP, HELP, START and their variants are reserved. `warnings` flags a reply that does not mention \"Msg & data rates may apply\" or STOP, which carriers expect in the first text.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordInput"},"example":{"word":"bread","reply":"Corner Bakery: You are in! Fresh bread alerts, about 4 texts a month. Msg & data rates may apply. Reply HELP for help, STOP to opt out.","listId":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"}}}},"responses":{"201":{"description":"The keyword (new or replaced).","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordSaveResult"},"example":{"keyword":{"id":"f0a2c4e6-8b1d-4f3a-9c5e-7d9f1b3d5f29","word":"BREAD","reply":"Corner Bakery: You are in! Fresh bread alerts, about 4 texts a month. Msg & data rates may apply. Reply HELP for help, STOP to opt out.","list_id":"e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"},"warnings":[]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_keyword`: `word` is not one word of up to 20 letters or numbers.\n- `reserved_keyword`: `word` already means opt out, help or opt in (STOP, HELP, START, ...).\n- `empty_reply`: `reply` is missing or empty.\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: The list in `listId`, or the number in `numberId`, does not exist in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `no_sending_number`: You have no sending number yet.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/keywords/{id}":{"delete":{"operationId":"deleteKeyword","tags":["Keywords"],"summary":"Delete a keyword","description":"Deletes a signup keyword. Texts of that word are then treated like any other incoming text. Contacts who joined with it are not affected. The last keyword with a word that starts a workflow cannot be deleted until the workflow is changed.","parameters":[{"$ref":"#/components/parameters/KeywordId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No keyword with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `keyword_in_use`: This keyword starts a workflow; `details.workflows` names them."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","tags":["Webhooks"],"summary":"List webhooks","description":"Your webhook endpoints, oldest first (without their secrets), and every event type you can subscribe to.","responses":{"200":{"description":"Webhooks and event types.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["webhooks","eventTypes"],"properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"},"description":"Oldest first. `secret` is not included."},"eventTypes":{"type":"array","items":{"$ref":"#/components/schemas/EventType"},"description":"Every event type."}}},"example":{"webhooks":[{"id":"8e0a2c4f-6b8d-4e1a-9c3e-5f7a9c1e3b30","url":"https://hooks.example.com/smsblast","description":"CRM sync","events":["message.received","contact.opted_out"],"enabled":true,"disabledReason":null,"lastSuccessAt":"2026-11-20T16:45:05.441Z","lastFailureAt":null,"createdAt":"2026-11-01T15:00:12.000Z"}],"eventTypes":["message.received","message.sent","message.delivered","message.failed","contact.created","contact.opted_in","contact.opted_out","campaign.sending","campaign.sent","link.clicked"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createWebhook","tags":["Webhooks"],"summary":"Create a webhook","description":"Adds an endpoint of yours that SMSBlast posts events to, for the event types you choose (or `[\"*\"]` for all, the default). The address must be public and https; addresses in private networks are refused when saved and again before every delivery.\n\nThe answer includes the signing `secret` (`whsec_...`): use it to check the `SMSBlast-Signature` header of every delivery. You can fetch it again with `GET /v1/webhooks/{id}`. Up to 10 webhooks per account. Send a test event with `POST /v1/webhooks/{id}/test`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"},"example":{"url":"https://hooks.example.com/smsblast","events":["message.received","contact.opted_out"],"description":"CRM sync"}}}},"responses":{"201":{"description":"The new webhook, with its secret.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["webhook"],"properties":{"webhook":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"example":{"webhook":{"id":"8e0a2c4f-6b8d-4e1a-9c3e-5f7a9c1e3b30","url":"https://hooks.example.com/smsblast","description":"CRM sync","events":["message.received","contact.opted_out"],"enabled":true,"disabledReason":null,"lastSuccessAt":null,"lastFailureAt":null,"createdAt":"2026-11-01T15:00:12.000Z","secret":"whsec_Zk3vQ8pL2mN7xR4tW9yB1cD6fH0jK5sA"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_url`: `url` is not a full public https address (or the host cannot be found).\n- `invalid_events`: `events` is empty or has an unknown type (`details.allowed` lists them).\n- `invalid_json`: The body is not a JSON object.\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `too_many_webhooks`: You already have 10 webhooks.\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/webhooks/{id}":{"get":{"operationId":"getWebhook","tags":["Webhooks"],"summary":"Get a webhook","description":"One webhook endpoint, with its signing secret.","parameters":[{"$ref":"#/components/parameters/WebhookId"}],"responses":{"200":{"description":"The webhook.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["webhook"],"properties":{"webhook":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"example":{"webhook":{"id":"8e0a2c4f-6b8d-4e1a-9c3e-5f7a9c1e3b30","url":"https://hooks.example.com/smsblast","description":"CRM sync","events":["message.received","contact.opted_out"],"enabled":true,"disabledReason":null,"lastSuccessAt":"2026-11-20T16:45:05.441Z","lastFailureAt":null,"createdAt":"2026-11-01T15:00:12.000Z","secret":"whsec_Zk3vQ8pL2mN7xR4tW9yB1cD6fH0jK5sA"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No webhook with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateWebhook","tags":["Webhooks"],"summary":"Update a webhook","description":"Changes a webhook's address, events or description, or switches it off or on. Only the fields you send change. Switching it back on (after you switched it off, or after it was switched off for failing 100 times in a row) clears `disabledReason` and the failure count. Events that happen while it is off are not sent later.","parameters":[{"$ref":"#/components/parameters/WebhookId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"},"example":{"events":["*"],"enabled":true}}}},"responses":{"200":{"description":"The webhook.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["webhook"],"properties":{"webhook":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"example":{"webhook":{"id":"8e0a2c4f-6b8d-4e1a-9c3e-5f7a9c1e3b30","url":"https://hooks.example.com/smsblast","description":"CRM sync","events":["*"],"enabled":true,"disabledReason":null,"lastSuccessAt":"2026-11-20T16:45:05.441Z","lastFailureAt":null,"createdAt":"2026-11-01T15:00:12.000Z","secret":"whsec_Zk3vQ8pL2mN7xR4tW9yB1cD6fH0jK5sA"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_url`: `url` is not a full public https address.\n- `invalid_events`: `events` is empty or has an unknown type.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No webhook with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Delete a webhook","description":"Deletes a webhook and its delivery history. Deliveries still waiting are dropped.","parameters":[{"$ref":"#/components/parameters/WebhookId"}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No webhook with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","tags":["Webhooks"],"summary":"Rotate the signing secret","description":"Gives the webhook a new signing secret. The old one stops working at once: every delivery from now on, retries included, is signed with the new secret, so update your endpoint right after.","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"The webhook with its new secret.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"type":"object","required":["webhook"],"properties":{"webhook":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"example":{"webhook":{"id":"8e0a2c4f-6b8d-4e1a-9c3e-5f7a9c1e3b30","url":"https://hooks.example.com/smsblast","description":"CRM sync","events":["message.received","contact.opted_out"],"enabled":true,"disabledReason":null,"lastSuccessAt":"2026-11-20T16:45:05.441Z","lastFailureAt":null,"createdAt":"2026-11-01T15:00:12.000Z","secret":"whsec_Pq7rS2tU9vW4xY1zA6bC3dE8fG5hJ0kL"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No webhook with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/webhooks/{id}/test":{"post":{"operationId":"sendWebhookTest","tags":["Webhooks"],"summary":"Send a test event","description":"Queues a `webhook.test` event to this endpoint (even if it is switched off), signed like any other, to check your endpoint is reachable and verifies signatures. It goes out within a few seconds, is tried once and never retried; see the result in `GET /v1/webhooks/{id}/deliveries`.","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"The test delivery, queued.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResult"},"example":{"deliveryId":"3c5e7a9b-1d3f-4b5c-8e7a-9b1d3f5a7c41","eventId":"evt_Qm4xT9rV2kLp8NwZ"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No webhook with that id in your account."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Webhooks"],"summary":"List deliveries","description":"The events sent (or waiting to be sent) to one endpoint, newest first, with each attempt's outcome and the payload. History is kept for 30 days.","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"name":"status","in":"query","required":false,"description":"Only deliveries with this status.","schema":{"type":"string","enum":["pending","sending","delivered","failed","canceled"]}},{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 100. Default 50.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Deliveries.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["deliveries"],"properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"},"description":"Newest first."}}},"example":{"deliveries":[{"id":"3c5e7a9b-1d3f-4b5c-8e7a-9b1d3f5a7c41","eventId":"evt_Qm4xT9rV2kLp8NwZ","eventType":"message.received","status":"pending","attempts":2,"nextAttemptAt":"2026-11-20T17:21:05.000Z","lastStatus":503,"lastError":"Answered 503","lastResponse":"Service Unavailable","createdAt":"2026-11-20T16:45:03.200Z","deliveredAt":null,"payload":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"message.received","created":"2026-11-20T16:45:03.200Z","data":{"message":{"id":"d1f3a5c7-9e0b-4d2f-a4c6-e8f0b2d4f697","direction":"inbound","status":"received","kind":"inbound","from":"+14155550101","to":"+14155550100","body":"Do you have rye bread today?","mediaUrls":[],"credits":0,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T16:45:03.118Z","sentAt":null,"deliveredAt":null}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No webhook with that id in your account."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/webhooks/{id}/deliveries/{deliveryId}/retry":{"post":{"operationId":"retryWebhookDelivery","tags":["Webhooks"],"summary":"Send a delivery again","description":"Sends one delivery again now, whatever happened to it before (also a delivered one, so your endpoint gets it twice). A delivery that has used up its automatic retries gets one more attempt.","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/DeliveryId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Queued to go out now.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_idempotency_key`: The Idempotency-Key header is longer than 200 characters."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound","description":"Something the request names does not exist in your account. `error.code` is one of:\n\n- `not_found`: No such delivery for this webhook, or it is being sent right now."},"409":{"$ref":"#/components/responses/Conflict","description":"The request clashes with the current state of things. `error.code` is one of:\n\n- `idempotency_in_progress`: A request with the same Idempotency-Key is still running. Try again in a moment."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/account":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"Get your account","description":"Your account, your credit balance and your sending numbers. Only `active` numbers can send; a number stays `pending` until its carrier registration is approved in the dashboard.","responses":{"200":{"description":"Your account.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetails"},"example":{"account":{"id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Corner Bakery","timezone":"America/Los_Angeles","support_contact":"help@example.com"},"credits":4210,"numbers":[{"id":"b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b","account_id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","e164":"+14155550100","kind":"10dlc","provider":"telnyx","status":"active"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateAccount","tags":["Account"],"summary":"Update your account","description":"Changes your business name (it starts the automatic STOP, HELP and START answers), your time zone (used for sending hours when a contact has none, and for analytics days) or your support contact (included in the HELP answer). Only the fields you send change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountRequest"},"example":{"timezone":"America/Los_Angeles","supportContact":"help@example.com"}}}},"responses":{"200":{"description":"Your account.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["account"],"properties":{"account":{"$ref":"#/components/schemas/Account"}}},"example":{"account":{"id":"5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10","name":"Corner Bakery","timezone":"America/Los_Angeles","support_contact":"help@example.com"}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_timezone`: `timezone` is not one we recognise.\n- `invalid_json`: The body is not a JSON object."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/analytics/overview":{"get":{"operationId":"getAnalyticsOverview","tags":["Analytics"],"summary":"Headline numbers","description":"Contacts by status and conversations with unread texts, right now.","responses":{"200":{"description":"The numbers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsOverview"},"example":{"contacts":1873,"subscribed":1802,"unsubscribed":71,"unread":5,"unreadMine":0}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/analytics/audience":{"get":{"operationId":"getAudienceAnalytics","tags":["Analytics"],"summary":"Audience growth","description":"How your list grew over a range of days: opt-ins and opt-outs per day, contacts at the end of each day, new contacts by source, and totals. Days are counted in your account's time zone. `bySource` and `byStatus` describe all contacts now, not just the range.","parameters":[{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"}],"responses":{"200":{"description":"Audience numbers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceAnalytics"},"example":{"timezone":"America/Los_Angeles","totals":{"contacts":1873,"subscribed":1802,"newInRange":41,"netGrowth":41,"subscribes":44,"unsubscribes":6},"bySource":[{"source":"import","n":1610},{"source":"keyword","n":214},{"source":"manual","n":42},{"source":"inbox","n":7}],"byStatus":[{"status":"subscribed","n":1802},{"status":"unsubscribed","n":71}],"series":[{"d":"2026-11-19","subscribes":3,"unsubscribes":1,"total":1866,"bySource":{"keyword":2,"manual":1}},{"d":"2026-11-20","subscribes":7,"unsubscribes":0,"total":1873,"bySource":{"keyword":7}}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_range`: `from` or `to` is missing or not a date, `from` is after `to`, or the range is longer than 400 days."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/analytics/campaigns":{"get":{"operationId":"getCampaignAnalytics","tags":["Analytics"],"summary":"Campaign activity","description":"Campaigns started per day over a range of days (in your account's time zone), with their recipients, and how their texts did.","parameters":[{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"}],"responses":{"200":{"description":"Campaign numbers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignAnalytics"},"example":{"timezone":"America/Los_Angeles","series":[{"d":"2026-11-20","campaigns":0,"messages":0},{"d":"2026-11-21","campaigns":1,"messages":1284}],"totals":{"campaigns":1,"sent":1281,"delivered":1251,"failed":9}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_range`: `from` or `to` is missing or not a date, `from` is after `to`, or the range is longer than 400 days."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/analytics/messaging":{"get":{"operationId":"getMessagingAnalytics","tags":["Analytics"],"summary":"Texts sent and received","description":"All texts per day over a range of days (in your account's time zone): sent, received, delivered, failed, and credits used.","parameters":[{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"}],"responses":{"200":{"description":"Messaging numbers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagingAnalytics"},"example":{"timezone":"America/Los_Angeles","series":[{"d":"2026-11-20","outbound":64,"inbound":12,"delivered":61,"failed":1,"credits":70},{"d":"2026-11-21","outbound":1310,"inbound":37,"delivered":1279,"failed":9,"credits":1322}],"totals":{"outbound":1374,"inbound":49,"delivered":1340,"failed":10,"credits":1392}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"The request was refused because something in it is not valid. `error.code` is one of:\n\n- `invalid_range`: `from` or `to` is missing or not a date, `from` is after `to`, or the range is longer than 400 days."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/analytics/inbox":{"get":{"operationId":"getInboxAnalytics","tags":["Analytics"],"summary":"Inbox workload","description":"Conversations by status right now, and per teammate.","responses":{"200":{"description":"Inbox numbers.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxAnalytics"},"example":{"counts":{"open":22,"pending":3,"closed":123,"unassigned":19,"unread":5},"byTeammate":[{"id":null,"name":"Unassigned","total":131,"open":19,"pending":0},{"id":"9d1f3b5c-7e9a-4b1d-8c3f-5a7c9e1b3d63","name":"Dana Baker","total":17,"open":3,"pending":3}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"webhooks":{"message.received":{"post":{"operationId":"onMessageReceived","tags":["Webhooks"],"summary":"A text came in","description":"Someone texted one of your numbers. Sent for every incoming text, including STOP, HELP, START and keywords (which SMSBlast also handles automatically). `mediaUrls` holds any pictures they sent.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageReceivedEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"message.received","created":"2026-11-20T16:45:03.200Z","data":{"message":{"id":"d1f3a5c7-9e0b-4d2f-a4c6-e8f0b2d4f697","direction":"inbound","status":"received","kind":"inbound","from":"+14155550101","to":"+14155550100","body":"Do you have rye bread today?","mediaUrls":[],"credits":0,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T16:45:03.118Z","sentAt":null,"deliveredAt":null}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"message.sent":{"post":{"operationId":"onMessageSent","tags":["Webhooks"],"summary":"A text was sent","description":"The carrier accepted one of your outgoing texts, of any kind (campaign, API, inbox, workflow, keyword reply, compliance answer or test).\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageSentEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"message.sent","created":"2026-11-20T17:02:12.110Z","data":{"message":{"id":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","direction":"outbound","status":"sent","kind":"api","from":"+14155550100","to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","mediaUrls":[],"credits":1,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T17:02:11.482Z","sentAt":"2026-11-20T17:02:12.104Z","deliveredAt":null}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"message.delivered":{"post":{"operationId":"onMessageDelivered","tags":["Webhooks"],"summary":"A text was delivered","description":"The carrier confirmed one of your texts reached the phone.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDeliveredEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"message.delivered","created":"2026-11-20T17:02:15.940Z","data":{"message":{"id":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","direction":"outbound","status":"delivered","kind":"api","from":"+14155550100","to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","mediaUrls":[],"credits":1,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":null,"sendAt":null,"createdAt":"2026-11-20T17:02:11.482Z","sentAt":"2026-11-20T17:02:12.104Z","deliveredAt":"2026-11-20T17:02:15.930Z"}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"message.failed":{"post":{"operationId":"onMessageFailed","tags":["Webhooks"],"summary":"A text failed","description":"One of your texts could not be sent, or the carrier reported it undelivered. `data.message.error` says why. Texts that never reached the carrier are refunded. Skipped texts (the person opted out before it went out) send no event.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageFailedEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"message.failed","created":"2026-11-20T17:02:15.940Z","data":{"message":{"id":"a4c6e8f0-2b4d-4f6a-8c0e-1d3f5a7c9e86","direction":"outbound","status":"failed","kind":"api","from":"+14155550100","to":"+14155550101","body":"Hi Alice, your sourdough order is ready for pickup at Corner Bakery. Reply STOP to opt out.","mediaUrls":[],"credits":1,"contactId":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","campaignId":null,"error":"Number is not reachable","sendAt":null,"createdAt":"2026-11-20T17:02:11.482Z","sentAt":"2026-11-20T17:02:12.104Z","deliveredAt":null}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"contact.created":{"post":{"operationId":"onContactCreated","tags":["Webhooks"],"summary":"A contact was added","description":"A contact was added: with `POST /v1/contacts` (or by hand in the dashboard), by texting a signup keyword, or as an opt-out record when an unknown number texted STOP (then `status` is `unsubscribed`). Imports do not send this event.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreatedEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"contact.created","created":"2026-11-20T16:45:03.200Z","data":{"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","email":"alice@example.com","timezone":"America/Los_Angeles","status":"subscribed","source":"api","fields":{"favorite_bread":"Sourdough","store":"Mission St"},"created_at":"2026-11-02T18:24:09.311Z"}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"contact.opted_in":{"post":{"operationId":"onContactOptedIn","tags":["Webhooks"],"summary":"A contact opted in","description":"A contact agreed to get your texts: added with consent through `POST /v1/contacts` (or by hand), texted a signup keyword, or texted START after opting out. `source` says which. Imports do not send this event.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactOptedInEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"contact.opted_in","created":"2026-11-09T21:40:52.100Z","data":{"contact":{"id":"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71","phone":"+14155550102","first_name":"Ben","last_name":"Carter","email":null,"timezone":null,"status":"subscribed","source":"keyword:JOIN","fields":{},"created_at":"2026-11-09T21:40:52.007Z"},"source":"keyword:JOIN"}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"contact.opted_out":{"post":{"operationId":"onContactOptedOut","tags":["Webhooks"],"summary":"A contact opted out","description":"A contact opted out: they texted STOP or a similar word or phrase (`source` `sms:...`), or were unsubscribed with `POST /v1/contacts/bulk` or in the dashboard (`manual`). SMSBlast will not text them again; stop texting them from your other systems too.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactOptedOutEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"contact.opted_out","created":"2026-11-19T23:15:02.700Z","data":{"contact":{"id":"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71","phone":"+14155550102","first_name":"Ben","last_name":"Carter","email":null,"timezone":null,"status":"unsubscribed","source":"keyword:JOIN","fields":{},"created_at":"2026-11-09T21:40:52.007Z"},"source":"sms:STOP"}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"campaign.sending":{"post":{"operationId":"onCampaignSending","tags":["Webhooks"],"summary":"A campaign was sent or scheduled","description":"A campaign was sent (or scheduled, then `scheduledFor` is set) and its texts are queued.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSendingEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"campaign.sending","created":"2026-11-20T22:30:11.000Z","data":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","name":"Holiday stollen","status":"sending","recipients":1284,"credits":1290,"startedAt":"2026-11-21T17:00:00.000Z","scheduledFor":"2026-11-21T17:00:00.000Z"}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"campaign.sent":{"post":{"operationId":"onCampaignSent","tags":["Webhooks"],"summary":"A campaign finished","description":"Every text of a campaign has gone out or ended. `results` are the counts at that moment; delivery reports can still arrive afterwards (see `GET /v1/campaigns/{id}`).\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSentEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"campaign.sent","created":"2026-11-21T17:09:47.600Z","data":{"campaign":{"id":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","name":"Holiday stollen","status":"sent","recipients":1284,"credits":1290,"startedAt":"2026-11-21T17:00:00.000Z","finishedAt":"2026-11-21T17:09:47.512Z","results":{"sent":1272,"delivered":1198,"failed":9,"skipped":3}}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"link.clicked":{"post":{"operationId":"onLinkClicked","tags":["Webhooks"],"summary":"A tracked link was clicked","description":"A person opened a tracked link in one of your texts for the first time. Later clicks on the same link by the same person, and visits by link previewers and scanners, send no event.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkClickedEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"link.clicked","created":"2026-11-21T18:02:44.019Z","data":{"link":{"url":"https://example.com/stollen","campaignId":"c8d2e4f6-a1b3-4c5d-8e7f-9a0b1c2d3e64","workflowId":null,"clickedAt":"2026-11-21T18:02:44.019Z"},"contact":{"id":"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60","phone":"+14155550101","first_name":"Alice","last_name":"Moreno","status":"subscribed"}}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}},"webhook.test":{"post":{"operationId":"onWebhookTest","tags":["Webhooks"],"summary":"Test event","description":"Sent only when you call `POST /v1/webhooks/{id}/test`, even to a webhook that is switched off. It is tried once and never retried, and does not count towards switching a failing webhook off.\n\nSMSBlast posts this to every enabled webhook endpoint subscribed to the event, as JSON, with the headers `SMSBlast-Signature`, `SMSBlast-Event-Id`, `SMSBlast-Event-Type` and `User-Agent: SMSBlast-Webhooks/1.0`. Check the signature before trusting the body (see the Webhooks section).\n\nAnswer with any 2xx status within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.","parameters":[{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/EventIdHeader"},{"$ref":"#/components/parameters/EventTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestEvent"},"example":{"id":"evt_Qm4xT9rV2kLp8NwZ","type":"webhook.test","created":"2026-11-20T16:45:03.200Z","data":{"message":"This is a test event from SMSBlast. If you can read it, your endpoint works."}}}}},"responses":{"2XX":{"description":"Received. Any 2xx status within 10 seconds counts; the body is ignored (its first 500 characters are kept in the delivery log)."},"default":{"description":"Any other status, a redirect (redirects are not followed), no answer within 10 seconds or a connection failure counts as a failed attempt and is retried."}},"security":[]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sb_...","description":"An API key: `sb_` followed by 32 letters, digits, `-` and `_`. Create keys in the dashboard at Settings → Developers (only a person logged in to the dashboard can create or revoke them). A key is shown once; revoking it takes effect at once. Requests with a missing, unknown or revoked key get 401 `unauthorized`."}},"headers":{"X-Request-Id":{"description":"The id of this request (`req_...`), on every answer. Quote it when you contact support.","schema":{"type":"string"},"example":"req_8Fk2LqZ9xW1v"},"X-RateLimit-Limit":{"description":"Requests allowed per minute with this API key.","schema":{"type":"integer"},"example":600},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"},"example":597},"X-RateLimit-Reset":{"description":"When the current minute ends and the count starts again, in Unix seconds.","schema":{"type":"integer"},"example":1795712760},"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"},"example":12},"Idempotent-Replayed":{"description":"`true` when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.","schema":{"type":"string","enum":["true"]}}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with `Idempotent-Replayed: true`) instead of the work being done twice. Keys are kept for 24 hours per account.","schema":{"type":"string","maxLength":200},"example":"2b5c4f8e-order-1042"},"Cursor":{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` from the previous page. Leave it out for the first (newest) page.","schema":{"type":"string"}},"Limit":{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"Offset":{"name":"offset","in":"query","required":false,"description":"How many to skip, for paging. Default 0.","schema":{"type":"integer","minimum":0,"default":0}},"ContactId":{"name":"id","in":"path","required":true,"description":"The contact id.","schema":{"type":"string","format":"uuid"}},"ListId":{"name":"id","in":"path","required":true,"description":"The list id.","schema":{"type":"string","format":"uuid"}},"SegmentId":{"name":"id","in":"path","required":true,"description":"The segment id.","schema":{"type":"string","format":"uuid"}},"MessageId":{"name":"id","in":"path","required":true,"description":"The message id.","schema":{"type":"string","format":"uuid"}},"CampaignId":{"name":"id","in":"path","required":true,"description":"The campaign id.","schema":{"type":"string","format":"uuid"}},"WorkflowId":{"name":"id","in":"path","required":true,"description":"The workflow id.","schema":{"type":"string","format":"uuid"}},"ConversationId":{"name":"id","in":"path","required":true,"description":"The conversation id.","schema":{"type":"string","format":"uuid"}},"KeywordId":{"name":"id","in":"path","required":true,"description":"The keyword id.","schema":{"type":"string","format":"uuid"}},"WebhookId":{"name":"id","in":"path","required":true,"description":"The webhook id.","schema":{"type":"string","format":"uuid"}},"ImportId":{"name":"id","in":"path","required":true,"description":"The import id.","schema":{"type":"string","format":"uuid"}},"FormId":{"name":"id","in":"path","required":true,"description":"The form id.","schema":{"type":"string","format":"uuid"}},"PublicFormId":{"name":"publicId","in":"path","required":true,"description":"The form's `publicId`.","schema":{"type":"string"},"example":"Rk4xT9vQ"},"DeliveryId":{"name":"deliveryId","in":"path","required":true,"description":"The delivery id.","schema":{"type":"string","format":"uuid"}},"From":{"name":"from","in":"query","required":true,"description":"First day, `YYYY-MM-DD`, in your account's time zone.","schema":{"type":"string","format":"date"},"example":"2026-11-01"},"To":{"name":"to","in":"query","required":true,"description":"Last day (included), `YYYY-MM-DD`. Up to 400 days after `from`.","schema":{"type":"string","format":"date"},"example":"2026-11-30"},"SignatureHeader":{"name":"SMSBlast-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256>`. The HMAC is of `<t>.<raw body>` with your webhook's secret as the key. Check it before trusting the body.","schema":{"type":"string"},"example":"t=1795712703,v1=5f0b6a8e2d4c71f9b3a0e6d2c8f41a7b9e3d5c0f2a6b8d1e4f7a9c3b5d2e8f01"},"EventIdHeader":{"name":"SMSBlast-Event-Id","in":"header","required":true,"description":"The event id, the same as `id` in the body.","schema":{"type":"string"},"example":"evt_Qm4xT9rV2kLp8NwZ"},"EventTypeHeader":{"name":"SMSBlast-Event-Type","in":"header","required":true,"description":"The event type, the same as `type` in the body.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"The request was refused because something in it is not valid. `error.code` says what, and `error.message` explains it.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_phone","message":"\"to\" must be a valid US or Canada mobile number, like +15125550123.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"Unauthorized":{"description":"No API key, or one that is not valid or has been revoked (`unauthorized`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"That API key is not valid. Check it, or create a new one in Settings → Developers.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"PaymentRequired":{"description":"Sending is not possible right now: not enough credits (`insufficient_credits`, with `details.needed` and `details.available`), the free trial has ended (`trial_ended`) or the paid plan has ended (`plan_required`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_credits","message":"This send needs 1,290 credits and you have 850.","details":{"needed":1290,"available":850,"recipients":1284},"requestId":"req_8Fk2LqZ9xW1v"}}}}},"NotFound":{"description":"The thing named in the path or body does not exist in your account (`not_found`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"That contact was not found.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"Conflict":{"description":"The request clashes with the current state of things, such as texting someone who opted out or sending a campaign twice.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unsubscribed","message":"This person has opted out and cannot be texted.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"PayloadTooLarge":{"description":"The body is larger than 12 MB (`too_large`). Send fewer rows at a time.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"too_large","message":"That batch is too large. Send fewer rows at a time.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"TooManySignups":{"description":"Too many signups from this connection (`rate_limited`): up to 20 in 10 minutes per IP address.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many signups from this connection. Try again in a few minutes.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"IdempotencyKeyReused":{"description":"This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (`idempotency_key_reused`). Use a new key for each new request.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_key_reused","message":"This Idempotency-Key was already used for a different request. Use a new key for each new request.","requestId":"req_8Fk2LqZ9xW1v"}}}}},"RateLimited":{"description":"Too many requests with this API key (`rate_limited`). Wait for the number of seconds in `Retry-After`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests: up to 600 a minute per API key. Wait a moment and try again.","requestId":"req_8Fk2LqZ9xW1v"}}}}}},"schemas":{"Error":{"type":"object","description":"Every error has this shape.","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string","description":"A stable, machine-readable code such as `invalid_phone` or `insufficient_credits`. Each operation lists the codes it can return."},"message":{"type":"string","description":"A plain-English explanation, safe to show to a person."},"details":{"type":"object","additionalProperties":true,"description":"Extra facts for some errors, such as `needed` and `available` credits for `insufficient_credits`."},"requestId":{"type":"string","description":"The id of this request, the same as the `X-Request-Id` header. Quote it when you contact support."}}}}},"Ok":{"type":"object","description":"The answer when there is nothing else to return.","required":["ok"],"properties":{"ok":{"type":"boolean","const":true}}},"Message":{"type":"object","description":"One text, sent or received. Field names are camelCase.","required":["id","direction","status","kind","from","to","body","mediaUrls","credits","contactId","campaignId","error","sendAt","createdAt","sentAt","deliveredAt"],"properties":{"id":{"type":"string","format":"uuid","description":"The message id."},"direction":{"type":"string","enum":["outbound","inbound"],"description":"`outbound`: a text you sent. `inbound`: a text someone sent to one of your numbers."},"status":{"type":"string","enum":["queued","sending","sent","delivered","failed","skipped","received"],"description":"Where the text is:\n\n- `queued`: waiting to go out (now, at `sendAt`, when sending hours open, or for a retry after the carrier was busy).\n- `sending`: being handed to the carrier right now.\n- `sent`: the carrier accepted it.\n- `delivered`: the carrier confirmed it reached the phone.\n- `failed`: it could not be sent, or the carrier reported it undelivered. `error` says why. A text that never reached the carrier gets its credits back.\n- `skipped`: not sent, because the person opted out before it went out, its campaign was stopped, the number is blocked on SMSBlast, or (for a keyword reply) there were not enough credits. Credits are given back.\n- `received`: an inbound text."},"kind":{"type":"string","enum":["campaign","api","conversation","workflow","welcome","reply","compliance","test","inbound"],"description":"What sent it: `campaign`, `api` (`POST /v1/messages`), `conversation` (a reply from the inbox), `workflow`, `welcome` (a signup form's welcome text), `reply` (the answer to a signup keyword), `compliance` (the automatic answer to STOP, HELP or START), `test` (a campaign test send) or `inbound` (a text someone sent you)."},"from":{"type":"string","description":"The sending number for outbound texts; the person's number for inbound ones. E.164."},"to":{"type":"string","description":"The person's number for outbound texts; your number for inbound ones. E.164."},"body":{"type":"string","description":"The text exactly as sent or received (personalisation already filled in, tracked links already shortened)."},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"Pictures sent with the text (MMS). For inbound texts, the pictures the person sent."},"credits":{"type":"integer","description":"Credits it cost: 1 per SMS segment, 3 for a picture message, 0 for inbound texts and compliance answers."},"contactId":{"type":["string","null"],"format":"uuid","description":"The contact it was sent to or came from, when there is one."},"campaignId":{"type":["string","null"],"format":"uuid","description":"The campaign it belongs to, for `campaign` texts."},"error":{"type":["string","null"],"description":"Why it failed or was skipped. While a text is `queued` for another try after the carrier was busy, this reads \"Will retry: ...\"."},"sendAt":{"type":["string","null"],"format":"date-time","description":"The earliest time it may go out, when it was scheduled, held for sending hours, or is waiting for a retry. Empty when it goes out as soon as possible."},"createdAt":{"type":"string","format":"date-time","description":"When it was created (outbound) or received (inbound)."},"sentAt":{"type":["string","null"],"format":"date-time","description":"When the carrier accepted it."},"deliveredAt":{"type":["string","null"],"format":"date-time","description":"When the carrier confirmed delivery."}}},"MessagePage":{"type":"object","description":"One page of texts.","required":["messages","nextCursor"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"Newest first."},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to get the next (older) page. Empty on the last page."}}},"SendMessageRequest":{"type":"object","description":"Send `to` and at least one of `body` or `mediaUrls`.","properties":{"to":{"type":"string","description":"Who to text. A US or Canada mobile number in any common format (`+14155550101`, `(415) 555-0101`, `415-555-0101`). Stored and returned in E.164 (`+14155550101`). The person must already be a subscribed contact."},"body":{"type":"string","description":"The text, up to 1,600 characters. Personalisation tags are not filled in here: send the final text. Optional when you send `mediaUrls`.","maxLength":1600},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"Up to 10 https addresses of pictures. Any picture makes it an MMS costing 3 credits.","maxItems":10},"from":{"type":"string","description":"Which of your approved sending numbers to send from (E.164 or any common format). Leave it out to use your first approved number."},"sendAt":{"type":["string","null"],"format":"date-time","description":"Schedule the text, up to a year ahead, for example `2026-11-24T17:00:00Z`. A time in the past sends it now."},"respectQuietHours":{"type":"boolean","description":"`true` holds the text until 8am to 9pm in the contact's time zone (or your account's), counted from `sendAt` when given. Default `false`: API texts go out at any hour, as they are usually answers to something the person did."},"trackLinks":{"type":"boolean","description":"`true` swaps each link in the body for a short tracking link (such as `https://app.smsblast.net/s/Ab3dEf9`) so you hear about clicks (the `link.clicked` webhook). Default `false`."}}},"MessagePreview":{"type":"object","description":"How a message body will be sent and what it costs.","required":["encoding","characters","segments","creditsPerMessage","nonGsm","warnings"],"properties":{"encoding":{"type":"string","enum":["GSM-7","UCS-2"],"description":"`GSM-7`: plain text, 160 characters in one SMS segment, 153 per segment once split. `UCS-2`: the text has a character outside GSM-7 (an emoji, curly quotes, many accents), so 70 characters per segment, 67 once split."},"characters":{"type":"integer","description":"Characters in the body as written."},"segments":{"type":"integer","description":"SMS segments, counted with personalisation tags filled in with their fallbacks (or left empty)."},"creditsPerMessage":{"type":"integer","description":"Credits one recipient costs: the segments (at least 1), or 3 with a picture."},"nonGsm":{"type":"array","items":{"type":"string"},"description":"The characters that forced UCS-2, each once."},"warnings":{"type":"array","items":{"type":"string"},"description":"Things worth fixing before sending: no opt-out wording (\"Reply STOP to opt out\"), characters that shorten each segment, and personalisation that can change the length."}}},"MessagePreviewRequest":{"type":"object","properties":{"body":{"type":"string","description":"The message, with any personalisation tags."},"mediaUrls":{"type":"array","items":{"type":"string"},"description":"Send any non-empty list to price it as a picture message (3 credits)."}}},"InboundMessage":{"type":"object","description":"An incoming text, as `GET /v1/messages/inbound` returns it. Field names are snake_case (unlike `Message`), and pictures are not included: use `GET /v1/messages?direction=inbound` for those.","required":["id","from_number","to_number","body","needs_review","contact_id","created_at"],"properties":{"id":{"type":"string","format":"uuid","description":"The message id (the same id `GET /v1/messages/{id}` uses)."},"from_number":{"type":"string","description":"The person's number, E.164."},"to_number":{"type":"string","description":"Your number the text was sent to, E.164."},"body":{"type":"string","description":"The text they sent."},"needs_review":{"type":"boolean","description":"`true` when the text mentions an opt-out word (stop, unsubscribe, remove, opt out, revoke) without being one of the exact opt-out keywords, so a person should read it and unsubscribe them if that is what they meant."},"contact_id":{"type":["string","null"],"format":"uuid","description":"The contact, when the number is one."},"created_at":{"type":"string","format":"date-time","description":"When it was received."}}},"Contact":{"type":"object","description":"A person on your contact list. Field names are snake_case.","required":["id","phone","first_name","last_name","email","timezone","status","source","fields","created_at"],"properties":{"id":{"type":"string","format":"uuid","description":"The contact id."},"phone":{"type":"string","description":"Mobile number in E.164 format, such as `+14155550101`. There is one contact per number in an account."},"first_name":{"type":["string","null"],"description":"First name. Used by the `{first_name}` personalisation tag."},"last_name":{"type":["string","null"],"description":"Last name. Used by the `{last_name}` personalisation tag."},"email":{"type":["string","null"],"description":"Email address, lower case."},"timezone":{"type":["string","null"],"description":"IANA time zone such as `America/Chicago`. Campaign and workflow texts wait for 8am to 9pm in this time zone; when it is empty, the account time zone is used."},"status":{"type":"string","enum":["subscribed","unsubscribed"],"description":"`subscribed` people can be texted. `unsubscribed` people opted out (by texting STOP or similar, or by being unsubscribed by you) and get nothing until they opt back in themselves."},"source":{"type":["string","null"],"description":"How the contact first got onto your list: `import` (an import or `POST /v1/contacts/import`), `manual` (`POST /v1/contacts`, or added by hand in the dashboard), `keyword:JOIN` (texted that signup keyword), `form:Website footer` (signed up with that signup form, by its name) or `sms` (first heard from when they texted STOP)."},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them."},"created_at":{"type":"string","format":"date-time","description":"When the contact was added."}}},"ContactPage":{"type":"object","description":"One page of contacts, with counts.","required":["contacts","total","matching","subscribed","unsubscribed"],"properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"},"description":"This page of contacts."},"total":{"type":"integer","description":"All contacts in the account."},"matching":{"type":"integer","description":"Contacts matching the filters (status, search, list, segment), across all pages."},"subscribed":{"type":"integer","description":"Subscribed contacts in the account."},"unsubscribed":{"type":"integer","description":"Unsubscribed contacts in the account."}}},"ConsentAttestation":{"type":"object","description":"Your confirmation that the people agreed to get your texts. It is kept as their opt-in record.","required":["attested"],"properties":{"attested":{"type":"boolean","const":true,"description":"Must be `true`: you confirm these people agreed to receive your texts. Anything else is refused with `consent_required`."},"source":{"type":"string","description":"Where they agreed, such as `Checkout opt-in box` or `Website signup form`, up to 120 characters. Stored with each new contact's opt-in record."},"detail":{"type":"string","description":"Any further detail about the consent, up to 300 characters. Imports only; `POST /v1/contacts` records \"Added by hand\"."}}},"CreateContactRequest":{"type":"object","required":["phone","consent"],"properties":{"phone":{"type":"string","description":"A US or Canada mobile number in any common format (`+14155550101`, `(415) 555-0101`, `415-555-0101`). Stored and returned in E.164 (`+14155550101`)."},"firstName":{"type":"string","description":"First name, up to 120 characters."},"lastName":{"type":"string","description":"Last name, up to 120 characters."},"email":{"type":"string","description":"Email address. One that does not look like an email address is left out (stored as empty)."},"timezone":{"type":"string","description":"IANA time zone such as `America/Chicago`. One we do not recognise is left out."},"fields":{"type":"object","additionalProperties":{"type":["string","number","boolean"]},"description":"Custom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500."},"consent":{"$ref":"#/components/schemas/ConsentAttestation"},"listId":{"type":"string","format":"uuid","description":"Also put the contact on this list."}}},"UpdateContactRequest":{"type":"object","description":"Only the fields you send change.","properties":{"firstName":{"type":["string","null"],"description":"First name, up to 120 characters. `null` or `\"\"` clears it."},"lastName":{"type":["string","null"],"description":"Last name, up to 120 characters. `null` or `\"\"` clears it."},"email":{"type":["string","null"],"description":"Email address. `null` or `\"\"` clears it; so does one that does not look like an email address."},"timezone":{"type":["string","null"],"description":"IANA time zone. `null` or `\"\"` clears it; one we do not recognise is refused with `invalid_timezone`."},"fields":{"type":"object","additionalProperties":{"type":["string","number","boolean"]},"description":"Custom fields. When sent, they replace all of the contact's custom fields (send the full set); leave it out to keep them."}}},"ContactDetail":{"type":"object","required":["contact","lists","consent"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"lists":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"The list id."},"name":{"type":"string","description":"The list name."}}},"description":"The lists the contact is on, by name."},"consent":{"type":"array","items":{"$ref":"#/components/schemas/ConsentEvent"},"description":"Every opt-in and opt-out, oldest first."}}},"ConsentEvent":{"type":"object","description":"One entry in a contact's consent history. These records are never changed or deleted.","required":["kind","source","detail","occurred_at"],"properties":{"kind":{"type":"string","enum":["opt_in","opt_out"],"description":"Whether they joined or left."},"source":{"type":"string","description":"Where it happened: your consent source for imports and contacts you added (default `import` or `manual`), `keyword:JOIN` for a signup keyword, `form:Rk4xT9vQ` for a signup form (its `publicId`), `sms:STOP` / `sms:START` (the words they texted, normalised) for opt-outs and opt-ins by text, or `manual` for someone you unsubscribed."},"detail":{"type":["string","null"],"description":"More about it: the text they sent, the file and consent source of an import, \"Added by hand\", who unsubscribed them (\"Unsubscribed by API\" for API keys), or for a signup form a JSON record of the form, the exact consent wording shown, and the IP address, browser and page of the signup."},"occurred_at":{"type":"string","format":"date-time","description":"When it happened."}}},"ContactImportRow":{"type":"object","description":"One person to add or update.","properties":{"phone":{"type":"string","description":"A US or Canada mobile number in any common format (`+14155550101`, `(415) 555-0101`, `415-555-0101`). Stored and returned in E.164 (`+14155550101`). A row without a valid number is skipped and reported in `invalid`."},"firstName":{"type":"string","description":"First name, up to 120 characters."},"lastName":{"type":"string","description":"Last name, up to 120 characters."},"email":{"type":"string","description":"Email address. One that does not look like an email address is left out (stored as empty)."},"timezone":{"type":"string","description":"IANA time zone such as `America/Chicago`. One we do not recognise is left out."},"fields":{"type":"object","additionalProperties":{"type":["string","number","boolean"]},"description":"Custom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500."}}},"ImportContactsRequest":{"type":"object","required":["contacts","consent"],"properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/ContactImportRow"},"description":"The people, 1 to 50,000. When a number appears twice, the last row wins.","minItems":1,"maxItems":50000},"consent":{"$ref":"#/components/schemas/ConsentAttestation"},"listId":{"type":"string","format":"uuid","description":"Also put everyone in the batch (new or already on file) on this list."}}},"ImportResult":{"type":"object","description":"What an import did.","required":["created","updated","stillUnsubscribed","invalid"],"properties":{"created":{"type":"integer","description":"New contacts added, each with an opt-in record."},"updated":{"type":"integer","description":"Contacts already on file whose details were refreshed."},"stillUnsubscribed":{"type":"integer","description":"Of the updated contacts, how many had opted out and so stay unsubscribed. An import never resubscribes anyone."},"invalid":{"type":"array","items":{"type":"object","required":["row","phone","reason"],"properties":{"row":{"type":"integer","description":"Position of the row: 0 for the first row of `contacts` (or, for import jobs, the row number in the file, counted from `offset`)."},"phone":{"type":"string","description":"The phone value as sent."},"reason":{"type":"string","description":"Why it was skipped, such as \"Not a valid US or Canada mobile number\" or \"No phone number\"."}}},"description":"Rows that were skipped."}}},"BulkContactsRequest":{"type":"object","required":["action","ids"],"properties":{"action":{"type":"string","enum":["add_to_list","remove_from_list","unsubscribe","delete"],"description":"What to do with the contacts."},"ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Contact ids, 1 to 5,000 (any more are ignored). Ids that are not yours are ignored.","minItems":1},"listId":{"type":"string","format":"uuid","description":"The list, for `add_to_list` and `remove_from_list`."}}},"BulkContactsResult":{"description":"The count for the action that ran.","oneOf":[{"type":"object","required":["added"],"properties":{"added":{"type":"integer","description":"Contacts newly added to the list (ones already on it are not counted)."}},"title":"add_to_list"},{"type":"object","required":["removed"],"properties":{"removed":{"type":"integer","description":"Contacts taken off the list."}},"title":"remove_from_list"},{"type":"object","required":["unsubscribed"],"properties":{"unsubscribed":{"type":"integer","description":"Contacts that were subscribed and are now unsubscribed."}},"title":"unsubscribe"},{"type":"object","required":["deleted","keptAsOptOut"],"properties":{"deleted":{"type":"integer","description":"Subscribed contacts deleted."},"keptAsOptOut":{"type":"integer","description":"Unsubscribed contacts whose name, email and custom fields were cleared but whose number is kept as an opt-out, so no later import can text them."}},"title":"delete"}]},"ImportJob":{"type":"object","description":"An import job: a large file sent in batches, with running totals.","required":["id","account_id","filename","list_id","list_name","consent_source","status","total_rows","processed","created","updated","invalid","still_unsubscribed","created_at","finished_at"],"properties":{"id":{"type":"string","format":"uuid","description":"The import id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"filename":{"type":"string","description":"The file name you gave (default `contacts.csv`)."},"list_id":{"type":["string","null"],"format":"uuid","description":"The list everyone in the import is put on."},"list_name":{"type":["string","null"],"description":"That list's name."},"consent_source":{"type":"string","description":"Where the people agreed to your texts (default `CSV import`)."},"status":{"type":"string","enum":["running","done","failed"],"description":"`running` until you finish it."},"total_rows":{"type":"integer","description":"Rows in the file, as you said when starting (for showing progress)."},"processed":{"type":"integer","description":"Rows sent so far."},"created":{"type":"integer","description":"New contacts so far."},"updated":{"type":"integer","description":"Contacts already on file, refreshed."},"invalid":{"type":"integer","description":"Rows skipped for a missing or invalid number."},"still_unsubscribed":{"type":"integer","description":"Updated contacts that had opted out and stay unsubscribed."},"created_at":{"type":"string","format":"date-time","description":"When the import started."},"finished_at":{"type":["string","null"],"format":"date-time","description":"When it was finished."}}},"StartImportRequest":{"type":"object","required":["consent"],"properties":{"filename":{"type":"string","description":"The file name, for your records (up to 200 characters)."},"totalRows":{"type":"integer","description":"How many rows the file has, so progress can be shown.","minimum":0},"listId":{"type":"string","format":"uuid","description":"Put everyone in the import on this existing list."},"newListName":{"type":"string","description":"Create a new list with this name and put everyone on it. Takes precedence over `listId`."},"consent":{"type":"object","required":["attested"],"properties":{"attested":{"type":"boolean","const":true,"description":"Must be `true`: you confirm everyone in the file agreed to receive your texts."},"source":{"type":"string","description":"Where they agreed, up to 120 characters (default `CSV import`)."}}}}},"ImportRowsRequest":{"type":"object","required":["rows"],"properties":{"rows":{"type":"array","items":{"$ref":"#/components/schemas/ContactImportRow"},"description":"Up to 5,000 rows.","minItems":1,"maxItems":5000},"offset":{"type":"integer","description":"The position of the first row of this batch in the file, so `invalid[].row` points at the right line. Default 0.","minimum":0}}},"ImportBatchResult":{"type":"object","description":"What one batch did, and the job with its new totals.","required":["created","updated","stillUnsubscribed","invalid","job"],"properties":{"created":{"type":"integer","description":"New contacts added from this batch."},"updated":{"type":"integer","description":"Contacts already on file, refreshed from this batch."},"stillUnsubscribed":{"type":"integer","description":"Of those, contacts that had opted out and stay unsubscribed."},"invalid":{"type":"array","items":{"type":"object","required":["row","phone","reason"],"properties":{"row":{"type":"integer","description":"Row number in the file (`offset` plus the position in this batch)."},"phone":{"type":"string","description":"The phone value as sent."},"reason":{"type":"string","description":"Why it was skipped."}}},"description":"Rows of this batch that were skipped."},"job":{"$ref":"#/components/schemas/ImportJob"}}},"FinishImportRequest":{"type":"object","properties":{"failed":{"type":"boolean","description":"`true` marks the import `failed` (for example the upload was abandoned) instead of `done`."}}},"List":{"type":"object","description":"A named group of contacts. Field names are snake_case.","required":["id","account_id","name","description","created_at"],"properties":{"id":{"type":"string","format":"uuid","description":"The list id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"The list name."},"description":{"type":["string","null"],"description":"A note about the list, for you."},"created_at":{"type":"string","format":"date-time","description":"When the list was created."},"total":{"type":"integer","description":"Contacts on the list. Not included in the answer to `PATCH /v1/lists/{id}`."},"subscribed":{"type":"integer","description":"Subscribed contacts on the list. Not included in the answer to `PATCH /v1/lists/{id}`."}}},"ListInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"The list name, up to 120 characters.","maxLength":120},"description":{"type":["string","null"],"description":"A note, up to 300 characters. Leaving it out clears it.","maxLength":300}}},"Segment":{"type":"object","description":"A saved filter over your contacts. It is worked out each time it is used, so it is always current.","required":["id","account_id","name","description","match","rules","created_at"],"properties":{"id":{"type":"string","format":"uuid","description":"The segment id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"The segment name."},"description":{"type":["string","null"],"description":"A note about the segment."},"match":{"type":"string","enum":["all","any"],"description":"`all`: a contact must match every rule. `any`: one rule is enough."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/SegmentRule"},"description":"1 to 20 rules."},"created_at":{"type":"string","format":"date-time","description":"When the segment was created."}}},"SegmentWithCounts":{"type":"object","description":"A segment with how many contacts match it now.","required":["id","account_id","name","description","match","rules","created_at","total","subscribed"],"properties":{"id":{"type":"string","format":"uuid","description":"The segment id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"The segment name."},"description":{"type":["string","null"],"description":"A note about the segment."},"match":{"type":"string","enum":["all","any"],"description":"`all`: a contact must match every rule. `any`: one rule is enough."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/SegmentRule"},"description":"1 to 20 rules."},"created_at":{"type":"string","format":"date-time","description":"When the segment was created."},"total":{"type":"integer","description":"Contacts matching the segment now."},"subscribed":{"type":"integer","description":"Of those, subscribed contacts (the ones a campaign would reach)."}}},"SegmentCounts":{"type":"object","required":["total","subscribed"],"properties":{"total":{"type":"integer","description":"Contacts matching."},"subscribed":{"type":"integer","description":"Of those, subscribed contacts."}}},"SegmentInput":{"type":"object","required":["name","rules"],"properties":{"name":{"type":"string","description":"The segment name, up to 120 characters."},"description":{"type":["string","null"],"description":"A note, up to 300 characters. Leaving it out clears it."},"match":{"type":"string","enum":["all","any"],"description":"`any` to match contacts that meet any rule; anything else means `all`."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/SegmentRule"},"description":"1 to 20 rules.","minItems":1,"maxItems":20}}},"SegmentPreviewRequest":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"`any`, or anything else for `all`."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/SegmentRule"},"description":"The rules to count. An empty list counts nobody."}}},"SegmentRule":{"description":"One condition on a contact. Pick the `field`, then an `op` it allows:\n\n- `area_code`: `is` / `is_not`, `value` one or more 3-digit area codes separated by spaces or commas (`\"415, 628\"`).\n- `first_name`, `last_name`, `email`: `is_set`, `is_not_set`, `equals` or `contains` (both ignore case; they need a `value`).\n- `status`: `is`, `value` `subscribed` or `unsubscribed`.\n- `source`: `is` / `is_not`, `value` one of `import`, `keyword` (any signup keyword), `web_form` (any signup form), `sms`, `manual`, `api`.\n- `list`: `in` / `not_in`, `value` a list id.\n- `created`: `within_days` (`value` a number of days, 1 to 3650), `after` or `before` (`value` a date such as `2026-11-30`; `after` includes that day, `before` does not; days start at midnight UTC).\n- `custom`: a custom field named by `key`; `is_set`, `equals` or `contains` (ignoring case).\n- `clicked`: `campaign` (clicked a tracked link in the campaign `value`), `not_campaign` (got the campaign `value` but did not click), or `within_days` (clicked any tracked link in the last `value` days).\n- `replied`: `within_days` (texted you anything in the last `value` days) or `never` (has never texted you).\n\nAnything else is refused with `invalid_rule`.","oneOf":[{"$ref":"#/components/schemas/AreaCodeRule"},{"$ref":"#/components/schemas/TextFieldRule"},{"$ref":"#/components/schemas/StatusRule"},{"$ref":"#/components/schemas/SourceRule"},{"$ref":"#/components/schemas/ListRule"},{"$ref":"#/components/schemas/CreatedRule"},{"$ref":"#/components/schemas/CustomFieldRule"},{"$ref":"#/components/schemas/ClickedRule"},{"$ref":"#/components/schemas/RepliedRule"}],"discriminator":{"propertyName":"field","mapping":{"area_code":"#/components/schemas/AreaCodeRule","first_name":"#/components/schemas/TextFieldRule","last_name":"#/components/schemas/TextFieldRule","email":"#/components/schemas/TextFieldRule","status":"#/components/schemas/StatusRule","source":"#/components/schemas/SourceRule","list":"#/components/schemas/ListRule","created":"#/components/schemas/CreatedRule","custom":"#/components/schemas/CustomFieldRule","clicked":"#/components/schemas/ClickedRule","replied":"#/components/schemas/RepliedRule"}}},"AreaCodeRule":{"type":"object","description":"Contacts by the area code of their number.","required":["field","op","value"],"properties":{"field":{"type":"string","const":"area_code"},"op":{"type":"string","enum":["is","is_not"],"description":"Whether the number is (or is not) in one of the area codes."},"value":{"type":"string","description":"One or more 3-digit area codes, separated by spaces or commas."}}},"TextFieldRule":{"type":"object","description":"Contacts by first name, last name or email.","required":["field","op"],"properties":{"field":{"type":"string","enum":["first_name","last_name","email"],"description":"The contact field."},"op":{"type":"string","enum":["is_set","is_not_set","equals","contains"],"description":"`equals` and `contains` ignore case."},"value":{"type":"string","description":"The text to compare with, for `equals` and `contains`."}}},"StatusRule":{"type":"object","description":"Contacts by subscription status.","required":["field","op","value"],"properties":{"field":{"type":"string","const":"status"},"op":{"type":"string","const":"is"},"value":{"type":"string","enum":["subscribed","unsubscribed"],"description":"The status."}}},"SourceRule":{"type":"object","description":"Contacts by how they joined.","required":["field","op","value"],"properties":{"field":{"type":"string","const":"source"},"op":{"type":"string","enum":["is","is_not"],"description":"Whether the contact came (or did not come) from this source."},"value":{"type":"string","enum":["import","keyword","sms","manual","api","web_form"],"description":"Where the contact came from. `keyword` matches every signup keyword and `web_form` every signup form."}}},"ListRule":{"type":"object","description":"Contacts by list membership.","required":["field","op","value"],"properties":{"field":{"type":"string","const":"list"},"op":{"type":"string","enum":["in","not_in"],"description":"Whether the contact is (or is not) on the list."},"value":{"type":"string","format":"uuid","description":"The list id."}}},"CreatedRule":{"type":"object","description":"Contacts by when they were added.","required":["field","op","value"],"properties":{"field":{"type":"string","const":"created"},"op":{"type":"string","enum":["within_days","after","before"],"description":"`within_days`: added in the last N days. `after`: added on or after the date. `before`: added before the date."},"value":{"type":["integer","string"],"description":"For `within_days`, a whole number of days from 1 to 3650. For `after` and `before`, a date like `2026-11-30`."}}},"CustomFieldRule":{"type":"object","description":"Contacts by a custom field.","required":["field","key","op"],"properties":{"field":{"type":"string","const":"custom"},"key":{"type":"string","description":"The custom field name, as in the contact's `fields`."},"op":{"type":"string","enum":["is_set","equals","contains"],"description":"`equals` and `contains` ignore case."},"value":{"type":"string","description":"The text to compare with, for `equals` and `contains`."}}},"ClickedRule":{"type":"object","description":"Contacts by tracked link clicks.","required":["field","op","value"],"properties":{"field":{"type":"string","const":"clicked"},"op":{"type":"string","enum":["campaign","not_campaign","within_days"],"description":"`campaign`: clicked a tracked link in that campaign. `not_campaign`: was sent that campaign but clicked none of its links. `within_days`: clicked any tracked link in the last N days."},"value":{"type":["string","integer"],"description":"A campaign id for `campaign` and `not_campaign`; a whole number of days from 1 to 3650 for `within_days`."}}},"RepliedRule":{"type":"object","description":"Contacts by whether they text you.","required":["field","op"],"properties":{"field":{"type":"string","const":"replied"},"op":{"type":"string","enum":["within_days","never"],"description":"`within_days`: texted you anything in the last N days. `never`: has never texted you."},"value":{"type":"integer","description":"For `within_days`, a whole number of days from 1 to 3650.","minimum":1,"maximum":3650}}},"Audience":{"type":"object","description":"Who a campaign (or a workflow enrollment) goes to: everyone subscribed, or the people on any of the lists or in any of the segments (a person in several is texted once). Only subscribed contacts are ever texted, and numbers blocked on SMSBlast are left out. Stored as `{\"all\": true}` or as `{\"lists\": [...], \"segments\": [...]}`.","properties":{"all":{"type":"boolean","const":true,"description":"Everyone subscribed. This is what you get when no lists or segments are given."},"lists":{"type":"array","items":{"type":"string","format":"uuid"},"description":"List ids."},"segments":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Segment ids."}}},"Campaign":{"type":"object","description":"A campaign: one message sent to an audience. Field names are snake_case.","required":["id","account_id","name","body","media_urls","from_number_id","status","audience","recipients","credits","created_at","started_at","finished_at","scheduled_at","track_links","recurrence","next_run_at","parent_id","last_error"],"properties":{"id":{"type":"string","format":"uuid","description":"The campaign id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"Name, for you only (people do not see it)."},"body":{"type":"string","description":"The message as written, with any personalisation tags (`{first_name}`, `{last_name}`, `{first_name|there}`)."},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"https addresses of pictures sent with the text. With a picture, every text is an MMS costing 3 credits."},"from_number_id":{"type":["string","null"],"format":"uuid","description":"The sending number the campaign goes out from. Empty for a draft written before the account had a number; the first approved number is used when it is sent."},"status":{"type":"string","enum":["draft","recurring","sending","sent","canceled"],"description":"`draft` can be edited, deleted, sent or made recurring. `recurring` is a template sent again and again on a schedule (see `recurrence`); it can be edited and deleted but is never sent itself. `sending` means it was sent or scheduled and its texts are queued. `sent` means every text has gone out or ended. `canceled` means it was stopped with `POST /v1/campaigns/{id}/cancel`."},"audience":{"$ref":"#/components/schemas/Audience"},"recipients":{"type":"integer","description":"How many people it was sent to. 0 for a draft."},"credits":{"type":"integer","description":"Credits taken when it was sent, before any refunds. 0 for a draft."},"created_at":{"type":"string","format":"date-time","description":"When the draft was created."},"started_at":{"type":["string","null"],"format":"date-time","description":"When sending started, or the time it is scheduled for."},"finished_at":{"type":["string","null"],"format":"date-time","description":"When the last text went out or ended."},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"The time it was scheduled for, when it was scheduled with `sendAt`."},"track_links":{"type":"boolean","description":"Whether links in the body are swapped for a short tracking link per person (such as `https://app.smsblast.net/s/Ab3dEf9`), so clicks can be counted."},"recurrence":{"description":"The schedule of a recurring campaign. Empty for other campaigns.","oneOf":[{"$ref":"#/components/schemas/Recurrence"},{"type":"null"}]},"next_run_at":{"type":["string","null"],"format":"date-time","description":"When a recurring campaign goes out next."},"parent_id":{"type":["string","null"],"format":"uuid","description":"For a campaign sent by a recurring campaign: the recurring campaign (template) it was copied from."},"last_error":{"type":["string","null"],"description":"For a recurring campaign: why its last occurrence could not go out (for example not enough credits). Empty when it went out."}}},"CampaignSummary":{"type":"object","description":"A campaign with its headline results, as listed.","required":["id","account_id","name","body","media_urls","from_number_id","status","audience","recipients","credits","created_at","started_at","finished_at","scheduled_at","track_links","recurrence","next_run_at","parent_id","last_error","delivered","failed","unsubs","clicked","audience_label"],"properties":{"id":{"type":"string","format":"uuid","description":"The campaign id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"Name, for you only (people do not see it)."},"body":{"type":"string","description":"The message as written, with any personalisation tags (`{first_name}`, `{last_name}`, `{first_name|there}`)."},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"https addresses of pictures sent with the text. With a picture, every text is an MMS costing 3 credits."},"from_number_id":{"type":["string","null"],"format":"uuid","description":"The sending number the campaign goes out from. Empty for a draft written before the account had a number; the first approved number is used when it is sent."},"status":{"type":"string","enum":["draft","recurring","sending","sent","canceled"],"description":"`draft` can be edited, deleted, sent or made recurring. `recurring` is a template sent again and again on a schedule (see `recurrence`); it can be edited and deleted but is never sent itself. `sending` means it was sent or scheduled and its texts are queued. `sent` means every text has gone out or ended. `canceled` means it was stopped with `POST /v1/campaigns/{id}/cancel`."},"audience":{"$ref":"#/components/schemas/Audience"},"recipients":{"type":"integer","description":"How many people it was sent to. 0 for a draft."},"credits":{"type":"integer","description":"Credits taken when it was sent, before any refunds. 0 for a draft."},"created_at":{"type":"string","format":"date-time","description":"When the draft was created."},"started_at":{"type":["string","null"],"format":"date-time","description":"When sending started, or the time it is scheduled for."},"finished_at":{"type":["string","null"],"format":"date-time","description":"When the last text went out or ended."},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"The time it was scheduled for, when it was scheduled with `sendAt`."},"track_links":{"type":"boolean","description":"Whether links in the body are swapped for a short tracking link per person (such as `https://app.smsblast.net/s/Ab3dEf9`), so clicks can be counted."},"recurrence":{"description":"The schedule of a recurring campaign. Empty for other campaigns.","oneOf":[{"$ref":"#/components/schemas/Recurrence"},{"type":"null"}]},"next_run_at":{"type":["string","null"],"format":"date-time","description":"When a recurring campaign goes out next."},"parent_id":{"type":["string","null"],"format":"uuid","description":"For a campaign sent by a recurring campaign: the recurring campaign (template) it was copied from."},"last_error":{"type":["string","null"],"description":"For a recurring campaign: why its last occurrence could not go out (for example not enough credits). Empty when it went out."},"delivered":{"type":"integer","description":"Texts confirmed delivered."},"failed":{"type":"integer","description":"Texts that failed."},"unsubs":{"type":"integer","description":"People who opted out within 3 days of getting it."},"clicked":{"type":"integer","description":"People who clicked at least one tracked link in it."},"audience_label":{"type":"string","description":"The audience in words: \"All subscribers\", a list or segment name, or \"2 lists, 1 segment\"."}}},"CampaignReport":{"type":"object","description":"A campaign and how it went.","required":["campaign","counts","creditsRefunded","unsubs","clicks"],"properties":{"campaign":{"type":"object","required":["id","account_id","name","body","media_urls","from_number_id","status","audience","recipients","credits","created_at","started_at","finished_at","scheduled_at","track_links","recurrence","next_run_at","parent_id","last_error","audience_label"],"properties":{"id":{"type":"string","format":"uuid","description":"The campaign id."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"Name, for you only (people do not see it)."},"body":{"type":"string","description":"The message as written, with any personalisation tags (`{first_name}`, `{last_name}`, `{first_name|there}`)."},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"https addresses of pictures sent with the text. With a picture, every text is an MMS costing 3 credits."},"from_number_id":{"type":["string","null"],"format":"uuid","description":"The sending number the campaign goes out from. Empty for a draft written before the account had a number; the first approved number is used when it is sent."},"status":{"type":"string","enum":["draft","recurring","sending","sent","canceled"],"description":"`draft` can be edited, deleted, sent or made recurring. `recurring` is a template sent again and again on a schedule (see `recurrence`); it can be edited and deleted but is never sent itself. `sending` means it was sent or scheduled and its texts are queued. `sent` means every text has gone out or ended. `canceled` means it was stopped with `POST /v1/campaigns/{id}/cancel`."},"audience":{"$ref":"#/components/schemas/Audience"},"recipients":{"type":"integer","description":"How many people it was sent to. 0 for a draft."},"credits":{"type":"integer","description":"Credits taken when it was sent, before any refunds. 0 for a draft."},"created_at":{"type":"string","format":"date-time","description":"When the draft was created."},"started_at":{"type":["string","null"],"format":"date-time","description":"When sending started, or the time it is scheduled for."},"finished_at":{"type":["string","null"],"format":"date-time","description":"When the last text went out or ended."},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"The time it was scheduled for, when it was scheduled with `sendAt`."},"track_links":{"type":"boolean","description":"Whether links in the body are swapped for a short tracking link per person (such as `https://app.smsblast.net/s/Ab3dEf9`), so clicks can be counted."},"recurrence":{"description":"The schedule of a recurring campaign. Empty for other campaigns.","oneOf":[{"$ref":"#/components/schemas/Recurrence"},{"type":"null"}]},"next_run_at":{"type":["string","null"],"format":"date-time","description":"When a recurring campaign goes out next."},"parent_id":{"type":["string","null"],"format":"uuid","description":"For a campaign sent by a recurring campaign: the recurring campaign (template) it was copied from."},"last_error":{"type":["string","null"],"description":"For a recurring campaign: why its last occurrence could not go out (for example not enough credits). Empty when it went out."},"audience_label":{"type":"string","description":"The audience in words: \"All subscribers\", a list or segment name, or \"2 lists, 1 segment\"."}}},"counts":{"type":"object","description":"Texts by their status now. Each text is in exactly one of these.","required":["queued","sending","sent","delivered","failed","skipped"],"properties":{"queued":{"type":"integer","description":"Waiting to go out (scheduled, or holding for the recipient's sending hours)."},"sending":{"type":"integer","description":"Being handed to the carrier."},"sent":{"type":"integer","description":"Accepted by the carrier, no delivery report yet."},"delivered":{"type":"integer","description":"Confirmed delivered."},"failed":{"type":"integer","description":"Failed."},"skipped":{"type":"integer","description":"Not sent because the person opted out first, or because the campaign was stopped."}}},"creditsRefunded":{"type":"integer","description":"Credits given back for texts that failed before reaching the carrier or were skipped."},"unsubs":{"type":"integer","description":"People who opted out within 3 days of getting it."},"clicks":{"type":"object","description":"Link clicks. All zero when the campaign had no links or link tracking was off.","required":["clicks","people","links","byUrl"],"properties":{"clicks":{"type":"integer","description":"Clicks on its tracked links, by people (link scanners and previews are not counted)."},"people":{"type":"integer","description":"People who clicked at least once."},"links":{"type":"integer","description":"Different links in the message."},"byUrl":{"type":"array","items":{"type":"object","required":["url","clicks","people"],"properties":{"url":{"type":"string","description":"The original link."},"clicks":{"type":"integer","description":"Clicks on it."},"people":{"type":"integer","description":"People who clicked it."}}},"description":"Each link, most clicked first."}}}}},"CampaignInput":{"type":"object","required":["body"],"properties":{"name":{"type":"string","description":"Name, for you only, up to 120 characters. Default \"Untitled campaign\"."},"body":{"type":"string","description":"The message, up to 1,600 characters. Personalise it with `{first_name}`, `{last_name}`, or a fallback such as `{first_name|there}` for contacts with no name on file. Marketing texts should say how to opt out (\"Reply STOP to opt out\").","maxLength":1600},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"https addresses of pictures. Any picture makes every text an MMS costing 3 credits."},"fromNumberId":{"type":"string","format":"uuid","description":"The sending number to use. Leave it out for your first approved number."},"audience":{"$ref":"#/components/schemas/Audience"},"trackLinks":{"type":"boolean","description":"Default `true`: links in the body become a short tracking link per person, so clicks are counted. Send `false` to keep links exactly as written."}}},"UpdateCampaignRequest":{"type":"object","description":"Only the fields you send change.","properties":{"name":{"type":"string","description":"Name, for you only, up to 120 characters."},"body":{"type":"string","description":"The message, up to 1,600 characters, with any personalisation tags.","maxLength":1600},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"https addresses of pictures, replacing the current ones (`[]` for none)."},"fromNumberId":{"type":"string","format":"uuid","description":"The sending number to use."},"audience":{"$ref":"#/components/schemas/Audience"},"trackLinks":{"type":"boolean","description":"Whether links become tracked short links."}}},"CampaignWithPreview":{"type":"object","required":["campaign","preview"],"properties":{"campaign":{"$ref":"#/components/schemas/Campaign"},"preview":{"$ref":"#/components/schemas/MessagePreview"}}},"Recurrence":{"type":"object","description":"When a recurring campaign goes out.","required":["freq","time"],"properties":{"freq":{"type":"string","enum":["daily","weekly","monthly"],"description":"How often."},"interval":{"type":"integer","description":"Every 1 to 12 days, weeks or months. Default 1.","minimum":1,"maximum":12},"time":{"type":"string","description":"Local time in your account's time zone, `HH:MM`, between `08:00` and `20:59` (when texts may be sent).","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"weekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"description":"Weekly only: the days of the week, 0 = Sunday to 6 = Saturday. At least one."},"monthday":{"type":"integer","description":"Monthly only: the day of the month, 1 to 28 (so it exists in every month).","minimum":1,"maximum":28},"startDate":{"type":"string","description":"The first day it may go out, `YYYY-MM-DD` in your account's time zone; weeks and months are counted from it. Default today.","format":"date"},"endDate":{"type":["string","null"],"format":"date","description":"The last day it may go out, `YYYY-MM-DD`. Empty for no end."}}},"SetRecurringRequest":{"type":"object","required":["recurrence"],"properties":{"recurrence":{"$ref":"#/components/schemas/Recurrence"}}},"CampaignEstimateRequest":{"type":"object","properties":{"audience":{"$ref":"#/components/schemas/Audience"},"body":{"type":"string","description":"The message, with any personalisation tags. Without one, each recipient is counted as 1 credit."},"mediaUrls":{"type":"array","items":{"type":"string"},"description":"Any non-empty list prices it as a picture message (3 credits each)."}}},"CampaignEstimate":{"type":"object","description":"Who a campaign would reach and what it would cost. Link tracking is not counted here; the credits taken when it is sent are worked out on the final texts.","required":["recipients","credits","balance","preview"],"properties":{"recipients":{"type":"integer","description":"Subscribed people in the audience now (numbers blocked on SMSBlast are left out)."},"credits":{"type":"integer","description":"Credits it would cost, with each person's personalisation filled in."},"balance":{"type":"integer","description":"Your credit balance now."},"preview":{"$ref":"#/components/schemas/MessagePreview"}}},"CampaignSendRequest":{"type":"object","properties":{"sendAt":{"type":["string","null"],"format":"date-time","description":"Schedule it, up to a year ahead, for example `2026-11-28T17:00:00Z`. Leave it out (or send no body) to send now."}}},"CampaignCancelResult":{"type":"object","required":["campaign","canceled","creditsReturned"],"properties":{"campaign":{"$ref":"#/components/schemas/Campaign"},"canceled":{"type":"integer","description":"Texts that had not gone out yet and now never will (they are `skipped`)."},"creditsReturned":{"type":"integer","description":"Credits given back for those texts."}}},"CampaignSendResult":{"type":"object","required":["campaign","recipients","credits","balanceAfter"],"properties":{"campaign":{"$ref":"#/components/schemas/Campaign"},"recipients":{"type":"integer","description":"People it is going to."},"credits":{"type":"integer","description":"Credits taken."},"balanceAfter":{"type":"integer","description":"Your credit balance afterwards."}}},"TestSendRequest":{"type":"object","required":["to","body"],"properties":{"to":{"type":"string","description":"Where to send the test: a teammate's own mobile number (as saved in their dashboard profile) or a subscribed contact. A US or Canada mobile number in any common format (`+14155550101`, `(415) 555-0101`, `415-555-0101`). Stored and returned in E.164 (`+14155550101`)."},"body":{"type":"string","description":"The message. Personalisation is filled in with the name Sam Rivera."},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"Up to 10 https addresses of pictures (makes it a 3-credit MMS).","maxItems":10}}},"TestSendResult":{"type":"object","required":["messageId","credits"],"properties":{"messageId":{"type":"string","format":"uuid","description":"The test text. Look it up with `GET /v1/messages/{id}`."},"credits":{"type":"integer","description":"Credits it cost."}}},"Workflow":{"type":"object","description":"An automatic series of texts and list changes that each person goes through once (birthday workflows: once a year). Field names are camelCase.","required":["id","name","enabled","trigger","steps","createdAt","updatedAt","stats"],"properties":{"id":{"type":"string","format":"uuid","description":"The workflow id."},"name":{"type":"string","description":"Name, for you only."},"enabled":{"type":"boolean","description":"Whether it is switched on. Switched off, it starts nobody new and the people part way through wait where they are until it is switched back on."},"trigger":{"$ref":"#/components/schemas/WorkflowTrigger"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"},"description":"What happens, in order. Up to 30 steps."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."},"updatedAt":{"type":"string","format":"date-time","description":"When it was last changed."},"stats":{"type":"object","description":"Counts of runs (one per person) and texts.","required":["active","completed","exited","failed","sent"],"properties":{"active":{"type":"integer","description":"People part way through."},"completed":{"type":"integer","description":"People who went through every step."},"exited":{"type":"integer","description":"People who stopped early (opted out, or were deleted)."},"failed":{"type":"integer","description":"People whose run failed (no approved number, not enough credits, or no plan after the free trial)."},"sent":{"type":"integer","description":"Workflow texts sent or delivered."}}}}},"WorkflowTrigger":{"description":"What starts a workflow for a contact:\n\n- `subscribed`: they become a subscriber: added with `POST /v1/contacts` (or by hand in the dashboard), sign up with a signup form, text a signup keyword for the first time (or after opting out), or text START to rejoin. Imports do not start workflows.\n- `list_added`: they are added to the list `listId`: with `POST /v1/contacts/bulk` (`add_to_list`), `POST /v1/contacts` with `listId`, a signup keyword or signup form that adds to the list, or another workflow's `add_to_list` step. Imports do not start workflows.\n- `keyword`: they text `word`, and that word is set up as a signup keyword under Keywords.\n- `birthday`: it is their birthday. Once a day, at `hour` (8 to 20, default 10) in your account's time zone, every subscribed contact whose custom field `birthday` is today (written `MM/DD`, `MM/DD/YYYY` or `YYYY-MM-DD`) starts the workflow. This repeats every year; 29 February birthdays count on 28 February in other years. Signup forms that ask for a birthday fill in that field.\n\nOnly subscribed contacts start. Each person goes through a workflow once, except birthday workflows, which they go through again each year (their run from the year before is replaced).","oneOf":[{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"subscribed"}},"title":"subscribed"},{"type":"object","required":["type","listId"],"properties":{"type":{"type":"string","const":"list_added"},"listId":{"type":"string","format":"uuid","description":"The list."}},"title":"list_added"},{"type":"object","required":["type","word"],"properties":{"type":{"type":"string","const":"keyword"},"word":{"type":"string","description":"A keyword that is set up under Keywords (`POST /v1/keywords`), stored upper case without punctuation (`join!` becomes `JOIN`). An unknown word is refused with 400 `invalid_trigger`."}},"title":"keyword"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"birthday"},"hour":{"type":"integer","description":"The local hour (in your account's time zone) it runs each day, 8 to 20. Default 10.","minimum":8,"maximum":20}},"title":"birthday"}]},"WorkflowStep":{"description":"One step. Steps run one after another without delay until a `wait`:\n\n- `send`: queue a text (`body` up to 1,600 characters, with personalisation tags, and/or `mediaUrls`, https only). It costs credits like any text, goes out from your first approved number, waits for 8am to 9pm in the contact's time zone like a campaign, and its links become tracked short links. If it cannot be queued (no approved number, not enough credits, or no plan after the free trial), the person's run fails.\n- `wait`: pause for `amount` `minutes`, `hours` or `days` (a whole number, up to a year in total for the step).\n- `add_to_list` / `remove_from_list`: put the contact on, or take them off, the list `listId`.","oneOf":[{"type":"object","required":["type","body"],"properties":{"type":{"type":"string","const":"send"},"body":{"type":"string","description":"The text, with any personalisation tags. May be empty when `mediaUrls` is given.","maxLength":1600},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"https addresses of pictures (makes it a 3-credit MMS)."}},"title":"send"},{"type":"object","required":["type","amount","unit"],"properties":{"type":{"type":"string","const":"wait"},"amount":{"type":"integer","description":"How many units to wait, at least 1.","minimum":1},"unit":{"type":"string","enum":["minutes","hours","days"],"description":"The unit."}},"title":"wait"},{"type":"object","required":["type","listId"],"properties":{"type":{"type":"string","const":"add_to_list"},"listId":{"type":"string","format":"uuid","description":"The list."}},"title":"add_to_list"},{"type":"object","required":["type","listId"],"properties":{"type":{"type":"string","const":"remove_from_list"},"listId":{"type":"string","format":"uuid","description":"The list."}},"title":"remove_from_list"}]},"CreateWorkflowRequest":{"type":"object","required":["trigger"],"properties":{"name":{"type":"string","description":"Name, up to 120 characters. Default \"Untitled workflow\"."},"trigger":{"$ref":"#/components/schemas/WorkflowTrigger"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"},"description":"Up to 30 steps. Default none.","maxItems":30},"enabled":{"type":"boolean","description":"`true` switches it on at once (it needs at least one step). Default `false`."}}},"UpdateWorkflowRequest":{"type":"object","description":"Only the fields you send change.","properties":{"name":{"type":"string","description":"New name."},"trigger":{"$ref":"#/components/schemas/WorkflowTrigger"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"},"description":"The full new list of steps, replacing the old one.","maxItems":30},"enabled":{"type":"boolean","description":"Switch it on (it needs at least one step) or off."}}},"WorkflowRun":{"type":"object","description":"One person going through one workflow.","required":["id","status","step","nextRunAt","detail","createdAt","finishedAt","contact"],"properties":{"id":{"type":"string","format":"uuid","description":"The run id."},"status":{"type":"string","enum":["active","completed","exited","failed"],"description":"`active`: part way through. `completed`: went through every step. `exited`: stopped early because the contact opted out or was deleted (or the workflow was). `failed`: a text could not be queued (no approved number, not enough credits, or the account cannot send: the free trial is over and there is no plan); `detail` says which."},"step":{"type":"integer","description":"The next step to run, counted from 0. Equal to the number of steps once completed."},"nextRunAt":{"type":["string","null"],"format":"date-time","description":"When the run moves on next (the end of a wait). Empty while it is being processed or once it has ended."},"detail":{"type":["string","null"],"description":"Why it exited or failed, such as \"The contact opted out\", \"Not enough credits\" or \"Your 14-day free trial has ended. Choose a plan on the Billing page to keep sending.\""},"createdAt":{"type":"string","format":"date-time","description":"When the person started the workflow."},"finishedAt":{"type":["string","null"],"format":"date-time","description":"When the run ended."},"contact":{"type":"object","description":"Who it is (snake_case, like contacts).","required":["id","phone","first_name","last_name"],"properties":{"id":{"type":"string","format":"uuid","description":"The contact id."},"phone":{"type":"string","description":"Their number, E.164."},"first_name":{"type":["string","null"],"description":"First name."},"last_name":{"type":["string","null"],"description":"Last name."}}}}},"EnrollRequest":{"type":"object","description":"Send `contactIds` (a list) or `audience` (an object). Without either, the request is refused with `no_audience`. Note that an audience with no lists or segments, such as `{}`, means everyone subscribed, the same as `{\"all\": true}`.","properties":{"contactIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Specific contacts to start. When this is a list, `audience` is ignored."},"audience":{"$ref":"#/components/schemas/Audience"}}},"EnrollResult":{"type":"object","required":["started"],"properties":{"started":{"type":"integer","description":"People who started the workflow now: subscribed contacts that were not in it before."}}},"Form":{"type":"object","description":"A signup form. Field names are camelCase.","required":["id","publicId","name","title","description","buttonLabel","successMessage","fields","consentText","listId","welcomeText","popup","style","enabled","views","submissions","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"The form id."},"publicId":{"type":"string","description":"The short public id in the hosted page address (`https://app.smsblast.net/f/{publicId}`), the embed code and the public form endpoints."},"name":{"type":"string","description":"Name, for you only. It is also recorded as the source of contacts who sign up (`form:<name>`)."},"title":{"type":"string","description":"The heading people see."},"description":{"type":["string","null"],"description":"The text under the heading."},"buttonLabel":{"type":"string","description":"The button text."},"successMessage":{"type":"string","description":"What people see after signing up."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"},"description":"The fields asked for besides the mobile number (always asked)."},"consentText":{"type":"string","description":"The consent wording shown beside the button. It must say how to stop the texts (mention STOP). The exact wording is stored with every signup as proof of consent."},"listId":{"type":["string","null"],"format":"uuid","description":"The list people who sign up are put on."},"welcomeText":{"type":["string","null"],"description":"The text sent right after someone new signs up (empty: none), when your account can send. Your business name is put in front when it does not already mention it. It costs credits like any text."},"popup":{"$ref":"#/components/schemas/FormPopup"},"style":{"$ref":"#/components/schemas/FormStyle"},"enabled":{"type":"boolean","description":"Whether the form takes signups. A form that is switched off is not shown anywhere."},"views":{"type":"integer","description":"Times the form was shown."},"submissions":{"type":"integer","description":"Signups received (including people who were already subscribed)."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."},"updatedAt":{"type":"string","format":"date-time","description":"When it was last changed."}}},"FormField":{"type":"string","enum":["first_name","last_name","email","birthday","zip"],"description":"An optional field a form can ask for. `birthday` and `zip` are kept as custom fields on the contact."},"FormPopup":{"type":"object","description":"How the popup version behaves (embed code with `data-mode=\"popup\"`).","required":["delaySeconds","exitIntent","showOnMobile","frequencyDays"],"properties":{"delaySeconds":{"type":"integer","description":"Seconds after the page opens before the popup shows, 0 to 600. Default 5.","minimum":0,"maximum":600},"exitIntent":{"type":"boolean","description":"Also show it when the visitor moves to leave the page. Default `true`."},"showOnMobile":{"type":"boolean","description":"Show it on phones too. Default `true`."},"frequencyDays":{"type":"integer","description":"Days before showing it again to someone who closed it, 0 to 365. Default 7.","minimum":0,"maximum":365}}},"FormStyle":{"type":"object","description":"How the form looks.","required":["accent","theme"],"properties":{"accent":{"type":"string","description":"Button and accent colour, `#RRGGBB`. Default `#0297DE`; anything else is replaced by the default.","pattern":"^#[0-9a-fA-F]{6}$"},"theme":{"type":"string","enum":["light","dark"],"description":"Light or dark. Default `light`."}}},"FormInput":{"type":"object","description":"Every field is optional. On create, missing fields get their defaults; on update, only the fields you send change.","properties":{"name":{"type":"string","description":"Name, for you, up to 120 characters. Default \"Signup form\"."},"title":{"type":"string","description":"Heading, up to 120 characters. Default \"Get texts from <your business name>\"."},"description":{"type":["string","null"],"description":"Text under the heading, up to 500 characters; empty for none. Default \"Be the first to hear about deals and news.\""},"buttonLabel":{"type":"string","description":"Button text, up to 40 characters. Default \"Sign up\"."},"successMessage":{"type":"string","description":"Shown after signing up, up to 300 characters. Default \"You're in! Watch for a text from us shortly.\""},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"},"description":"Fields to ask for besides the mobile number. Default `[\"first_name\"]`."},"consentText":{"type":"string","description":"Consent wording, up to 1,000 characters. It must mention STOP. Default: a standard wording naming your business (\"By signing up, you agree to receive recurring automated marketing text messages from ... Reply HELP for help and STOP to cancel.\")."},"listId":{"type":["string","null"],"format":"uuid","description":"Put people who sign up on this list; `null` for none."},"welcomeText":{"type":["string","null"],"description":"Text sent right after signing up, up to 640 characters; it must mention STOP. `null` or empty for none. Default \"<business>: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.\""},"popup":{"type":"object","description":"Popup settings. When sent, settings you leave out go back to their defaults (not to their current values), so send all four.","properties":{"delaySeconds":{"type":"integer","description":"0 to 600."},"exitIntent":{"type":"boolean","description":"Show when leaving the page."},"showOnMobile":{"type":"boolean","description":"Show on phones."},"frequencyDays":{"type":"integer","description":"0 to 365."}}},"style":{"type":"object","description":"Look. When sent, a value left out goes back to its default.","properties":{"accent":{"type":"string","description":"`#RRGGBB`."},"theme":{"type":"string","enum":["light","dark"],"description":"Theme."}}},"enabled":{"type":"boolean","description":"`false` switches the form off. Default `true`."}}},"PublicForm":{"type":"object","description":"What a page needs to show a form: no private details.","required":["publicId","business","title","description","buttonLabel","successMessage","fields","consentText","termsUrl","privacyUrl","popup","style"],"properties":{"publicId":{"type":"string","description":"The form's public id."},"business":{"type":"string","description":"Your business name."},"title":{"type":"string","description":"The heading."},"description":{"type":["string","null"],"description":"The text under the heading."},"buttonLabel":{"type":"string","description":"The button text."},"successMessage":{"type":"string","description":"What to show after signing up."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"},"description":"Fields to ask for besides the mobile number."},"consentText":{"type":"string","description":"The consent wording to show beside the button. Show it exactly: it is what the person agrees to."},"termsUrl":{"type":["string","null"],"description":"Your SMS terms page, from your number registration."},"privacyUrl":{"type":["string","null"],"description":"Your privacy policy page, from your number registration."},"popup":{"$ref":"#/components/schemas/FormPopup"},"style":{"$ref":"#/components/schemas/FormStyle"}}},"FormSubmitRequest":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"A US or Canada mobile number in any common format (`+14155550101`, `(415) 555-0101`, `415-555-0101`). Stored and returned in E.164 (`+14155550101`)."},"first_name":{"type":"string","description":"First name, up to 80 characters (`firstName` also works). Kept only when the form asks for it."},"last_name":{"type":"string","description":"Last name, up to 80 characters (`lastName` also works). Kept only when the form asks for it."},"email":{"type":"string","description":"Email address. Kept only when the form asks for it; one that does not look valid is refused."},"birthday":{"type":"string","description":"Birthday as the person typed it, up to 20 characters. Kept (as a custom field) only when the form asks for it."},"zip":{"type":"string","description":"ZIP or postal code, up to 12 characters. Kept (as a custom field) only when the form asks for it."},"page":{"type":"string","description":"The address of the page the form was on, kept with the proof of consent. Default: the `Referer` header."}}},"FormSubmitResult":{"type":"object","required":["status","message"],"properties":{"status":{"type":"string","enum":["subscribed","already_subscribed","opted_out"],"description":"`subscribed`: they joined now. `already_subscribed`: they were already subscribed. `opted_out`: the number opted out earlier and was not resubscribed; they need to text START from their phone."},"message":{"type":"string","description":"What to show the person: the form's success message, \"You're already signed up. Thanks!\", or for `opted_out` \"This number unsubscribed from <business> texts earlier. To rejoin, text START to (415) 555-0100 from your phone.\""}}},"Conversation":{"type":"object","description":"The thread of texts with one phone number, as the inbox shows it. Field names are snake_case.","required":["id","phone","contact_id","first_name","last_name","contact_status","status","assigned_user_id","assigned_name","unread","last_message_at","last_message_preview","last_direction"],"properties":{"id":{"type":"string","format":"uuid","description":"The conversation id."},"phone":{"type":"string","description":"The person's number, E.164. There is one conversation per number."},"contact_id":{"type":["string","null"],"format":"uuid","description":"Their contact, when they are one."},"first_name":{"type":["string","null"],"description":"The contact's first name."},"last_name":{"type":["string","null"],"description":"The contact's last name."},"contact_status":{"type":["string","null"],"enum":["subscribed","unsubscribed",null],"description":"The contact's status, when there is a contact. Only subscribed contacts can be texted."},"status":{"type":"string","enum":["open","pending","closed"],"description":"Your team's status for it. A closed conversation opens again when the person texts."},"assigned_user_id":{"type":["string","null"],"format":"uuid","description":"The teammate it is assigned to."},"assigned_name":{"type":["string","null"],"description":"That teammate's name."},"unread":{"type":"integer","description":"Incoming texts not read yet."},"last_message_at":{"type":"string","format":"date-time","description":"When the last text came in or went out."},"last_message_preview":{"type":["string","null"],"description":"The start of the last text (up to 160 characters)."},"last_direction":{"type":["string","null"],"enum":["inbound","outbound",null],"description":"Whether the last text came in or went out."}}},"ConversationMessage":{"type":"object","description":"A text in a conversation.","required":["id","direction","kind","body","status","created_at","user_name","campaign_name"],"properties":{"id":{"type":"string","format":"uuid","description":"The message id."},"direction":{"type":"string","enum":["outbound","inbound"],"description":"Sent or received."},"kind":{"type":"string","description":"What sent it, as in `Message.kind`."},"body":{"type":"string","description":"The text."},"status":{"type":"string","description":"Its status, as in `Message.status` (skipped texts are left out)."},"created_at":{"type":"string","format":"date-time","description":"When it was created or received."},"user_name":{"type":["string","null"],"description":"The teammate who sent it from the dashboard inbox."},"campaign_name":{"type":["string","null"],"description":"The campaign it was part of."}}},"ConversationDetail":{"type":"object","required":["conversation","messages"],"properties":{"conversation":{"$ref":"#/components/schemas/Conversation"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessage"},"description":"The latest 200 texts with this number (from any of your numbers), oldest first."}}},"ConversationCounts":{"type":"object","description":"How many conversations each inbox folder holds.","required":["all","unread","open","pending","closed","unassigned","mine","mine_unread","mine_open","mine_pending"],"properties":{"all":{"type":"integer","description":"All conversations."},"unread":{"type":"integer","description":"With unread texts."},"open":{"type":"integer","description":"Open."},"pending":{"type":"integer","description":"Pending."},"closed":{"type":"integer","description":"Closed."},"unassigned":{"type":"integer","description":"Not assigned to anyone and not closed."},"mine":{"type":"integer","description":"Assigned to you. Always 0 with an API key, which belongs to no teammate."},"mine_unread":{"type":"integer","description":"Assigned to you and unread. Always 0 with an API key."},"mine_open":{"type":"integer","description":"Assigned to you and open. Always 0 with an API key."},"mine_pending":{"type":"integer","description":"Assigned to you and pending. Always 0 with an API key."}}},"StartConversationRequest":{"type":"object","required":["phone","body"],"properties":{"phone":{"type":"string","description":"Who to text. A US or Canada mobile number in any common format (`+14155550101`, `(415) 555-0101`, `415-555-0101`). Stored and returned in E.164 (`+14155550101`). They must be a subscribed contact."},"body":{"type":"string","description":"The text, up to 1,600 characters. Text only, no pictures or personalisation.","maxLength":1600}}},"ReplyRequest":{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The text, up to 1,600 characters. Text only.","maxLength":1600}}},"ConversationSendResult":{"type":"object","required":["messageId","conversationId","credits"],"properties":{"messageId":{"type":"string","format":"uuid","description":"The text, queued to go out now. Look it up with `GET /v1/messages/{id}`."},"conversationId":{"type":"string","format":"uuid","description":"The conversation it is in."},"credits":{"type":"integer","description":"Credits it cost."}}},"UpdateConversationRequest":{"type":"object","description":"Only the fields you send change. Values that are not one of the allowed ones are ignored.","properties":{"status":{"type":"string","enum":["open","pending","closed"],"description":"The new status."},"assignedUserId":{"type":["string","null"],"format":"uuid","description":"A teammate's user id, or `null` to unassign. Teammate ids appear as `assigned_user_id` on conversations and in `GET /v1/analytics/inbox`."},"read":{"type":"boolean","const":true,"description":"`true` marks every text in it as read."}}},"Keyword":{"type":"object","description":"A signup keyword. Field names are snake_case.","required":["id","word","reply","list_id","list_name","number","signups","created_at"],"properties":{"id":{"type":"string","format":"uuid","description":"The keyword id."},"word":{"type":"string","description":"The keyword, upper case without punctuation, such as `JOIN`."},"reply":{"type":"string","description":"The text people get back."},"list_id":{"type":["string","null"],"format":"uuid","description":"The list people who text it are put on."},"list_name":{"type":["string","null"],"description":"That list's name."},"number":{"type":"string","description":"The sending number it works on, E.164."},"signups":{"type":"integer","description":"Contacts who joined by texting it."},"created_at":{"type":"string","format":"date-time","description":"When it was set up."}}},"KeywordInput":{"type":"object","required":["word","reply"],"properties":{"word":{"type":"string","description":"One word of up to 20 letters or numbers. It is stored upper case without punctuation and matches a text that is exactly that word, in any case."},"reply":{"type":"string","description":"The text people get back. It is their first text from you, so say who you are, that message and data rates may apply, and how to opt out."},"numberId":{"type":"string","format":"uuid","description":"The sending number it works on. Leave it out for your first number."},"listId":{"type":["string","null"],"format":"uuid","description":"Put people who text it on this list."}}},"KeywordSaveResult":{"type":"object","required":["keyword","warnings"],"properties":{"keyword":{"type":"object","required":["id","word","reply","list_id"],"properties":{"id":{"type":"string","format":"uuid","description":"The keyword id."},"word":{"type":"string","description":"The keyword as stored."},"reply":{"type":"string","description":"The reply."},"list_id":{"type":["string","null"],"format":"uuid","description":"The list people are put on."}}},"warnings":{"type":"array","items":{"type":"string"},"description":"Advice about the reply: carriers expect the first text after a signup to mention \"Msg & data rates may apply\" and how to opt out (STOP)."}}},"EventType":{"type":"string","enum":["message.received","message.sent","message.delivered","message.failed","contact.created","contact.opted_in","contact.opted_out","campaign.sending","campaign.sent","link.clicked"],"description":"An event a webhook endpoint can subscribe to. (`webhook.test` is only sent by `POST /v1/webhooks/{id}/test`.)"},"WebhookEndpoint":{"type":"object","description":"A place your own system receives events. Field names are camelCase.","required":["id","url","description","events","enabled","disabledReason","lastSuccessAt","lastFailureAt","createdAt"],"properties":{"id":{"type":"string","format":"uuid","description":"The webhook id."},"url":{"type":"string","description":"Where events are posted: a public https address.","format":"uri"},"description":{"type":["string","null"],"description":"A note, for you."},"events":{"type":"array","items":{"type":"string"},"description":"The event types it gets (see `EventType`), or `[\"*\"]` for all of them."},"enabled":{"type":"boolean","description":"Whether events are sent to it. It is switched off by you, or automatically after 100 failed deliveries in a row."},"disabledReason":{"type":["string","null"],"description":"Why it was switched off automatically."},"lastSuccessAt":{"type":["string","null"],"format":"date-time","description":"The last delivery it answered with a 2xx."},"lastFailureAt":{"type":["string","null"],"format":"date-time","description":"The last delivery that failed."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."},"secret":{"type":"string","description":"The signing secret (`whsec_...`) used for the `SMSBlast-Signature` header. Included when you create, fetch, update or rotate a webhook; not in the list."}}},"CreateWebhookRequest":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A public https address. Addresses inside private networks, `localhost` and addresses with a user name or password are refused.","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"Event types (see `EventType`), or `[\"*\"]` for all. Default `[\"*\"]`.","minItems":1},"description":{"type":["string","null"],"description":"A note, up to 200 characters."}}},"UpdateWebhookRequest":{"type":"object","description":"Only the fields you send change.","properties":{"url":{"type":"string","description":"A new public https address.","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"The new event types, or `[\"*\"]`.","minItems":1},"description":{"type":["string","null"],"description":"A new note."},"enabled":{"type":"boolean","description":"`false` switches it off; `true` switches it back on and clears `disabledReason` and the failure count."}}},"WebhookDelivery":{"type":"object","description":"One event sent (or to be sent) to one endpoint. Kept for 30 days.","required":["id","eventId","eventType","status","attempts","nextAttemptAt","lastStatus","lastError","lastResponse","createdAt","deliveredAt","payload"],"properties":{"id":{"type":"string","format":"uuid","description":"The delivery id."},"eventId":{"type":"string","description":"The event id (`evt_...`)."},"eventType":{"type":"string","description":"The event type."},"status":{"type":"string","enum":["pending","sending","delivered","failed","canceled"],"description":"`pending`: waiting for its first try or a retry. `sending`: being posted. `delivered`: your endpoint answered 2xx. `failed`: every attempt failed (or, for a test event, the one attempt). `canceled`: not sent because the webhook was switched off or deleted."},"attempts":{"type":"integer","description":"Attempts so far."},"nextAttemptAt":{"type":["string","null"],"format":"date-time","description":"When it will be tried next, while `pending`."},"lastStatus":{"type":["integer","null"],"description":"The HTTP status your endpoint last answered with. Empty when it could not be reached."},"lastError":{"type":["string","null"],"description":"What went wrong last time, such as \"Answered 500\", \"No answer within 10 seconds\" or \"Redirected (301); webhooks do not follow redirects\"."},"lastResponse":{"type":["string","null"],"description":"The first 500 characters of your endpoint's last answer."},"createdAt":{"type":"string","format":"date-time","description":"When the event was recorded for this endpoint."},"deliveredAt":{"type":["string","null"],"format":"date-time","description":"When it was delivered."},"payload":{"$ref":"#/components/schemas/WebhookEvent"}}},"WebhookTestResult":{"type":"object","required":["deliveryId","eventId"],"properties":{"deliveryId":{"type":"string","format":"uuid","description":"The delivery. Watch it in `GET /v1/webhooks/{id}/deliveries`."},"eventId":{"type":"string","description":"The test event id."}}},"WebhookEvent":{"description":"What a webhook delivery posts: an envelope with the event id, type and time, and the event's `data`.","oneOf":[{"$ref":"#/components/schemas/MessageReceivedEvent"},{"$ref":"#/components/schemas/MessageSentEvent"},{"$ref":"#/components/schemas/MessageDeliveredEvent"},{"$ref":"#/components/schemas/MessageFailedEvent"},{"$ref":"#/components/schemas/ContactCreatedEvent"},{"$ref":"#/components/schemas/ContactOptedInEvent"},{"$ref":"#/components/schemas/ContactOptedOutEvent"},{"$ref":"#/components/schemas/CampaignSendingEvent"},{"$ref":"#/components/schemas/CampaignSentEvent"},{"$ref":"#/components/schemas/LinkClickedEvent"},{"$ref":"#/components/schemas/WebhookTestEvent"}],"discriminator":{"propertyName":"type","mapping":{"message.received":"#/components/schemas/MessageReceivedEvent","message.sent":"#/components/schemas/MessageSentEvent","message.delivered":"#/components/schemas/MessageDeliveredEvent","message.failed":"#/components/schemas/MessageFailedEvent","contact.created":"#/components/schemas/ContactCreatedEvent","contact.opted_in":"#/components/schemas/ContactOptedInEvent","contact.opted_out":"#/components/schemas/ContactOptedOutEvent","campaign.sending":"#/components/schemas/CampaignSendingEvent","campaign.sent":"#/components/schemas/CampaignSentEvent","link.clicked":"#/components/schemas/LinkClickedEvent","webhook.test":"#/components/schemas/WebhookTestEvent"}}},"MessageReceivedEvent":{"type":"object","description":"Someone texted one of your numbers. Sent for every incoming text, including STOP, HELP and keywords.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"message.received","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The text as `GET /v1/messages/{id}` returned it at the time of the event.","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}}}}},"MessageSentEvent":{"type":"object","description":"The carrier accepted an outgoing text (of any kind: campaign, API, inbox, workflow, keyword reply, compliance answer or test).","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"message.sent","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The text as `GET /v1/messages/{id}` returned it at the time of the event.","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}}}}},"MessageDeliveredEvent":{"type":"object","description":"The carrier confirmed an outgoing text reached the phone.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"message.delivered","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The text as `GET /v1/messages/{id}` returned it at the time of the event.","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}}}}},"MessageFailedEvent":{"type":"object","description":"An outgoing text could not be sent, or the carrier reported it undelivered. `data.message.error` says why. (Skipped texts send no event.)","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"message.failed","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The text as `GET /v1/messages/{id}` returned it at the time of the event.","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}}}}},"ContactCreatedEvent":{"type":"object","description":"A contact was added with `POST /v1/contacts` (or by hand in the dashboard), joined by texting a signup keyword or with a signup form, or was recorded as an opt-out when an unknown number texted STOP. Imports do not send this event.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"contact.created","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The contact as `GET /v1/contacts/{id}` returns it, at the time of the event.","required":["contact"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"}}}}},"ContactOptedInEvent":{"type":"object","description":"A contact agreed to get your texts: added with consent through `POST /v1/contacts` (or by hand), texted a signup keyword, signed up with a signup form, or texted START after opting out. Imports do not send this event.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"contact.opted_in","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The contact as `GET /v1/contacts/{id}` returns it, at the time of the event.","required":["contact","source"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"source":{"type":"string","description":"Where they opted in: the consent source given to `POST /v1/contacts` (default `manual`), `keyword:JOIN`, `form:Rk4xT9vQ` (a signup form's `publicId`) or `sms:START` (the word they texted)."}}}}},"ContactOptedOutEvent":{"type":"object","description":"A contact opted out: they texted STOP (or a similar word or phrase), or you unsubscribed them. Stop texting them from your own systems too.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"contact.opted_out","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","description":"The contact as `GET /v1/contacts/{id}` returns it, at the time of the event.","required":["contact","source"],"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"source":{"type":"string","description":"How they opted out: `sms:STOP` (the words they texted, normalised, such as `sms:PLEASE STOP`) or `manual` (unsubscribed with `POST /v1/contacts/bulk` or in the dashboard)."}}}}},"CampaignSendingEvent":{"type":"object","description":"A campaign was sent or scheduled and its texts are queued.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"campaign.sending","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","required":["campaign"],"properties":{"campaign":{"type":"object","required":["id","name","recipients","credits","startedAt","status","scheduledFor"],"properties":{"id":{"type":"string","format":"uuid","description":"The campaign id."},"name":{"type":"string","description":"The campaign name."},"recipients":{"type":"integer","description":"How many people it was sent to."},"credits":{"type":"integer","description":"Credits taken for it."},"startedAt":{"type":"string","format":"date-time","description":"When sending started, or the time it was scheduled for."},"status":{"type":"string","const":"sending"},"scheduledFor":{"type":["string","null"],"format":"date-time","description":"The time it is scheduled for, or empty when it goes now."}}}}}}},"CampaignSentEvent":{"type":"object","description":"Every text of a campaign has gone out or ended.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"campaign.sent","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","required":["campaign"],"properties":{"campaign":{"type":"object","required":["id","name","recipients","credits","startedAt","status","finishedAt","results"],"properties":{"id":{"type":"string","format":"uuid","description":"The campaign id."},"name":{"type":"string","description":"The campaign name."},"recipients":{"type":"integer","description":"How many people it was sent to."},"credits":{"type":"integer","description":"Credits taken for it."},"startedAt":{"type":"string","format":"date-time","description":"When sending started, or the time it was scheduled for."},"status":{"type":"string","const":"sent"},"finishedAt":{"type":"string","format":"date-time","description":"When the last text went out or ended."},"results":{"type":"object","description":"Results at the moment it finished. Delivery reports can still arrive later.","required":["sent","delivered","failed","skipped"],"properties":{"sent":{"type":"integer","description":"Texts the carrier accepted (including the delivered ones)."},"delivered":{"type":"integer","description":"Texts confirmed delivered so far."},"failed":{"type":"integer","description":"Texts that failed."},"skipped":{"type":"integer","description":"Texts not sent because the person opted out first."}}}}}}}}},"LinkClickedEvent":{"type":"object","description":"A person opened a tracked link for the first time. Later clicks on the same link by the same person, and visits by link previewers and scanners, send no event.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"link.clicked","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","required":["link","contact"],"properties":{"link":{"type":"object","required":["url","campaignId","workflowId","clickedAt"],"properties":{"url":{"type":"string","description":"The original link."},"campaignId":{"type":["string","null"],"format":"uuid","description":"The campaign the text was part of."},"workflowId":{"type":["string","null"],"format":"uuid","description":"The workflow the text was part of."},"clickedAt":{"type":"string","format":"date-time","description":"When it was clicked."}}},"contact":{"description":"Who clicked, when the text went to a contact.","oneOf":[{"type":"object","required":["id","phone","first_name","last_name","status"],"properties":{"id":{"type":"string","format":"uuid","description":"The contact id."},"phone":{"type":"string","description":"Their number, E.164."},"first_name":{"type":["string","null"],"description":"First name."},"last_name":{"type":["string","null"],"description":"Last name."},"status":{"type":"string","enum":["subscribed","unsubscribed"],"description":"Their status now."}}},{"type":"null"}]}}}}},"WebhookTestEvent":{"type":"object","description":"A test event sent by `POST /v1/webhooks/{id}/test`, even to a webhook that is switched off. It is tried once and never retried.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"The event id, `evt_` and 16 characters. The same event can be delivered more than once (a retry, or a manual resend): use the id to ignore repeats. Also sent in the `SMSBlast-Event-Id` header."},"type":{"type":"string","const":"webhook.test","description":"The event type. Also sent in the `SMSBlast-Event-Type` header."},"created":{"type":"string","format":"date-time","description":"When the event happened."},"data":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Always \"This is a test event from SMSBlast. If you can read it, your endpoint works.\""}}}}},"Account":{"type":"object","description":"Your account. Field names are snake_case.","required":["id","name","timezone","support_contact"],"properties":{"id":{"type":"string","format":"uuid","description":"Your account id."},"name":{"type":"string","description":"Your business name. It starts the automatic answers to STOP, HELP and START (\"Corner Bakery: You are unsubscribed...\")."},"timezone":{"type":"string","description":"IANA time zone, used for sending hours when a contact has none and for analytics days."},"support_contact":{"type":["string","null"],"description":"How people reach you for help (an email address or phone number). It is included in the automatic answer to HELP."}}},"SendingNumber":{"type":"object","description":"A number you send from.","required":["id","account_id","e164","kind","provider","status"],"properties":{"id":{"type":"string","format":"uuid","description":"The number id (the `fromNumberId` of campaigns, the `numberId` of keywords)."},"account_id":{"type":"string","format":"uuid","description":"Your account id."},"e164":{"type":"string","description":"The number, E.164 (or 5 to 6 digits for a short code)."},"kind":{"type":"string","enum":["toll_free","10dlc","short_code"],"description":"The kind of number."},"provider":{"type":"string","description":"The carrier network partner that sends from it, such as `telnyx`."},"status":{"type":"string","enum":["pending","active","suspended"],"description":"Only `active` numbers send. A number is `pending` until its carrier registration is approved."}}},"AccountDetails":{"type":"object","required":["account","credits","numbers"],"properties":{"account":{"$ref":"#/components/schemas/Account"},"credits":{"type":"integer","description":"Your credit balance."},"numbers":{"type":"array","items":{"$ref":"#/components/schemas/SendingNumber"},"description":"Your sending numbers, oldest first."}}},"UpdateAccountRequest":{"type":"object","description":"Only the fields you send change.","properties":{"name":{"type":"string","description":"Your business name, up to 120 characters. Empty values are ignored."},"timezone":{"type":"string","description":"IANA time zone, such as `America/Los_Angeles`."},"supportContact":{"type":"string","description":"How people reach you for help, up to 160 characters. An empty string clears it."}}},"AnalyticsOverview":{"type":"object","description":"Headline numbers.","required":["contacts","subscribed","unsubscribed","unread","unreadMine"],"properties":{"contacts":{"type":"integer","description":"All contacts."},"subscribed":{"type":"integer","description":"Subscribed contacts."},"unsubscribed":{"type":"integer","description":"Unsubscribed contacts."},"unread":{"type":"integer","description":"Conversations with unread texts."},"unreadMine":{"type":"integer","description":"Of those, conversations assigned to you. Always 0 with an API key."}}},"AudienceAnalytics":{"type":"object","required":["timezone","totals","bySource","byStatus","series"],"properties":{"timezone":{"type":"string","description":"The time zone days are counted in (your account's)."},"totals":{"type":"object","required":["contacts","subscribed","newInRange","netGrowth","subscribes","unsubscribes"],"properties":{"contacts":{"type":"integer","description":"All contacts now."},"subscribed":{"type":"integer","description":"Subscribed contacts now."},"newInRange":{"type":"integer","description":"Contacts added during the range."},"netGrowth":{"type":"integer","description":"Contacts at the end of the range, less those before it began (deleted contacts are not counted at all)."},"subscribes":{"type":"integer","description":"Opt-ins during the range."},"unsubscribes":{"type":"integer","description":"Opt-outs during the range."}}},"bySource":{"type":"array","items":{"type":"object","required":["source","n"],"properties":{"source":{"type":"string","enum":["import","manual","keyword","inbox","api","web_form"],"description":"Where contacts came from (`inbox`: first heard from by text)."},"n":{"type":"integer","description":"Contacts now."}}},"description":"All contacts now, by source, largest first."},"byStatus":{"type":"array","items":{"type":"object","required":["status","n"],"properties":{"status":{"type":"string","enum":["subscribed","unsubscribed"],"description":"Status."},"n":{"type":"integer","description":"Contacts now."}}},"description":"All contacts now, by status."},"series":{"type":"array","items":{"type":"object","required":["d","subscribes","unsubscribes","total","bySource"],"properties":{"d":{"type":"string","description":"The day, `YYYY-MM-DD`.","format":"date"},"subscribes":{"type":"integer","description":"Opt-ins that day."},"unsubscribes":{"type":"integer","description":"Opt-outs that day."},"total":{"type":"integer","description":"Contacts at the end of that day."},"bySource":{"type":"object","additionalProperties":{"type":"integer"},"description":"New contacts that day, by source group (only groups with any)."}}},"description":"One entry per day of the range."}}},"CampaignAnalytics":{"type":"object","required":["timezone","series","totals"],"properties":{"timezone":{"type":"string","description":"The time zone days are counted in."},"series":{"type":"array","items":{"type":"object","required":["d","campaigns","messages"],"properties":{"d":{"type":"string","description":"The day, `YYYY-MM-DD`.","format":"date"},"campaigns":{"type":"integer","description":"Campaigns started (or scheduled to start) that day."},"messages":{"type":"integer","description":"Their recipients."}}},"description":"One entry per day of the range."},"totals":{"type":"object","required":["campaigns","sent","delivered","failed"],"properties":{"campaigns":{"type":"integer","description":"Campaigns started in the range."},"sent":{"type":"integer","description":"Their texts that left the queue (sent, delivered or failed)."},"delivered":{"type":"integer","description":"Their texts confirmed delivered."},"failed":{"type":"integer","description":"Their texts that failed."}}}}},"MessagingAnalytics":{"type":"object","required":["timezone","series","totals"],"properties":{"timezone":{"type":"string","description":"The time zone days are counted in."},"series":{"type":"array","items":{"type":"object","required":["d","outbound","inbound","delivered","failed","credits"],"properties":{"d":{"type":"string","description":"The day, `YYYY-MM-DD`.","format":"date"},"outbound":{"type":"integer","description":"Texts created that day that left the queue (sent, delivered or failed)."},"inbound":{"type":"integer","description":"Texts received."},"delivered":{"type":"integer","description":"Texts confirmed delivered."},"failed":{"type":"integer","description":"Texts that failed."},"credits":{"type":"integer","description":"Credits used by texts that went out (sent or delivered)."}}},"description":"One entry per day of the range, by the day each text was created."},"totals":{"type":"object","required":["outbound","inbound","delivered","failed","credits"],"properties":{"outbound":{"type":"integer","description":"Sum over the range."},"inbound":{"type":"integer","description":"Sum over the range."},"delivered":{"type":"integer","description":"Sum over the range."},"failed":{"type":"integer","description":"Sum over the range."},"credits":{"type":"integer","description":"Sum over the range."}}}}},"InboxAnalytics":{"type":"object","required":["counts","byTeammate"],"properties":{"counts":{"type":"object","required":["open","pending","closed","unassigned","unread"],"properties":{"open":{"type":"integer","description":"Open conversations."},"pending":{"type":"integer","description":"Pending conversations."},"closed":{"type":"integer","description":"Closed conversations."},"unassigned":{"type":"integer","description":"Not assigned and not closed."},"unread":{"type":"integer","description":"With unread texts."}}},"byTeammate":{"type":"array","items":{"type":"object","required":["id","name","total","open","pending"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The teammate's user id; empty for the unassigned row."},"name":{"type":"string","description":"Their name, or \"Unassigned\"."},"total":{"type":"integer","description":"Conversations assigned."},"open":{"type":"integer","description":"Of those, open."},"pending":{"type":"integer","description":"Of those, pending."}}},"description":"Conversations per teammate, most first."}}},"MessageStatus":{"type":"string","enum":["queued","sending","sent","delivered","failed","skipped","received"],"description":"A message status (see `Message.status`)."},"MessageKind":{"type":"string","enum":["campaign","api","conversation","workflow","welcome","reply","compliance","test","inbound"],"description":"A message kind (see `Message.kind`)."}}}}