{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Coussema Public API","version":"v1","summary":"Programmable SMS and WhatsApp delivery, campaign orchestration, contacts, API keys, and webhook endpoints.","description":"Coussema expose une API publique pour envoyer des SMS et des messages WhatsApp durables, consulter les ressources WhatsApp, gérer les contacts, créer des campagnes et configurer des webhooks sur la même logique métier que le dashboard."},"servers":[{"url":"/v1","description":"Relative base path on the API host."}],"tags":[{"name":"Platform","description":"Service discovery, health, and machine-readable API metadata."},{"name":"SMS","description":"Single-recipient SMS sends from the developer API."},{"name":"WhatsApp","description":"Coussema WhatsApp template sends, service-window replies (text, files by link, buttons, lists, locations), and customer-safe read collections."},{"name":"Account","description":"Organization account state, entitlements, and invoice-ready usage history."},{"name":"Contacts","description":"Organization-scoped contact management."},{"name":"Campaigns","description":"Create and list outbound SMS campaigns."},{"name":"Sender IDs","description":"List approved sender identities and request new ones for review."},{"name":"API Keys","description":"Manage organization API keys for the developer product."},{"name":"Webhooks","description":"Manage outbound event delivery endpoints."},{"name":"Sub-accounts","description":"Reseller management: create sub-accounts, move SMS units, read statements and manage sub-account API keys. Requires a reseller key with sub_accounts scopes; each sub-account sends with its own keys."}],"paths":{"/":{"get":{"tags":["Platform"],"operationId":"getApiIndex","summary":"Get API entrypoint metadata","description":"Returns the current API version, the public docs path, and the machine-readable OpenAPI document path.","responses":{"200":{"description":"API discovery metadata with docs and health paths.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiIndexResponse"}}}}}}},"/health":{"get":{"tags":["Platform"],"operationId":"getHealth","summary":"Get API health","description":"Lightweight health probe for uptime and platform status checks.","responses":{"200":{"description":"Current API health snapshot.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/openapi.json":{"get":{"tags":["Platform"],"operationId":"getOpenApiDocument","summary":"Get the OpenAPI 3.1 document","description":"Returns the machine-readable OpenAPI 3.1 contract generated from the shared Zod schemas.","responses":{"200":{"description":"The current OpenAPI 3.1 document for the public API.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"type":"object","description":"OpenAPI 3.1 document"}}}}}}},"/sms/send":{"post":{"tags":["SMS"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sms:send"],"operationId":"sendSms","summary":"Send one SMS","description":"Enqueues and dispatches one SMS through the active supplier resolution flow for the authenticated organization. With `whatsappFirst` (the `whatsapp:send` scope too), the approved WhatsApp template is queued first and the SMS (at most 4 SMS) is created only if Meta reports the number is not on WhatsApp: the response then names the WhatsApp message (`channel: whatsapp_first`), and `GET /v1/whatsapp/messages/{messageId}` reports the SMS in `relay`. A WhatsApp that is sent but not delivered (a phone off) is not relayed.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"},{"$ref":"#/components/parameters/RequiredIdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"Single-recipient SMS payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendSmsRequest"},"examples":{"basic":{"summary":"Transactional send","value":{"to":"243837509125","message":"Votre code de verification est 1234.","senderId":"11111111-1111-4111-8111-111111111111","clientReference":"txn-2026-0001"}},"template":{"summary":"Send a saved SMS template","value":{"to":"243837509125","templateId":"22222222-2222-4222-8222-222222222222","variables":{"Prénom":"Mireille","Code":"482913"},"clientReference":"txn-2026-0002"}},"whatsappFirst":{"summary":"A code on WhatsApp first, by SMS if the number is not on WhatsApp","value":{"to":"243837509125","message":"Votre code de verification est 482913.","senderId":"11111111-1111-4111-8111-111111111111","whatsappFirst":{"phoneNumberId":"33333333-3333-4333-8333-333333333333","templateId":"44444444-4444-4444-8444-444444444444","fieldValues":{"Code":"482913"}},"clientReference":"txn-2026-0003"}}}}}},"responses":{"202":{"description":"SMS accepted by the platform and queued for supplier dispatch; with `whatsappFirst`, the WhatsApp message queued first.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendSmsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientQuota"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/messages":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"listWhatsAppMessages","summary":"List WhatsApp messages","description":"Returns cursor-paginated WhatsApp message history for the authenticated organization. Provider message IDs, operator errors, and raw upstream payloads are never returned.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/WhatsAppMessageStatusQuery"},{"$ref":"#/components/parameters/WhatsAppBillingCategoryQuery"},{"$ref":"#/components/parameters/WhatsAppTemplateNameQuery"},{"$ref":"#/components/parameters/WhatsAppRecipientQuery"},{"$ref":"#/components/parameters/DateFromQuery"},{"$ref":"#/components/parameters/DateToQuery"}],"responses":{"200":{"description":"Paginated customer-safe WhatsApp messages.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWhatsAppMessagesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:send"],"operationId":"sendWhatsAppMessage","summary":"Send a WhatsApp message","description":"Accepts an approved utility, marketing or authentication template send at any time, or, inside the 24-hour customer service window of a conversation the customer opened (`conversationId`), a free-form reply: `text`, `image`, `video`, `document` or `audio` by a public https link in `media.url` (with `media.caption` for an image, video or document and `media.filename` for a document), `interactive` reply buttons (up to 3) or a list (up to 10 rows), or a `location` (latitude, longitude, optional name and address). A free-form reply outside the window is refused with `whatsapp_service_window_closed`. A template with a file at the top sends the file kept when it was created in Coussema unless `template.media.url` names another public https link; a template with personalized link buttons takes the end of each link in `template.urlParameters`. Promotions take `template.couponCode`, `template.offerExpiresAt` and `template.cards` when their template has a code to copy, an offer end or a carousel. A template send may add `smsFallback` (the `sms:send` scope too, and an idempotency key): one SMS of at most 4 SMS, sent only if Meta reports the number is not on WhatsApp, reported in `relay` by `GET /v1/whatsapp/messages/{messageId}`. The public response returns the Coussema message id and keeps provider message ids hidden.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"},{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"WhatsApp send payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppPublicApiSendRequest"},"examples":{"template":{"summary":"Utility template send","value":{"type":"template","to":"+243980395067","phoneNumberId":"11111111-1111-4111-8111-111111111111","template":{"name":"payment_notice","language":"fr","category":"utility","parameters":["12345"]},"clientReference":"invoice-12345"}},"smsFallback":{"summary":"Template send with an SMS if the number is not on WhatsApp","value":{"type":"template","to":"+243980395067","phoneNumberId":"11111111-1111-4111-8111-111111111111","template":{"name":"code_connexion","language":"fr","category":"authentication","parameters":["482913"]},"smsFallback":{"senderId":"22222222-2222-4222-8222-222222222222"},"clientReference":"login-482913"}},"document":{"summary":"Service-window document by link","value":{"type":"document","to":"+243980395067","phoneNumberId":"11111111-1111-4111-8111-111111111111","conversationId":"22222222-2222-4222-8222-222222222222","media":{"url":"https://example.com/invoices/12345.pdf","filename":"Facture-12345.pdf","caption":"Votre facture"}}},"buttons":{"summary":"Service-window reply buttons","value":{"type":"interactive","to":"+243980395067","phoneNumberId":"11111111-1111-4111-8111-111111111111","conversationId":"22222222-2222-4222-8222-222222222222","interactive":{"type":"button","bodyText":"Confirmez-vous le rendez-vous de demain à 10 h ?","buttons":[{"id":"confirm","title":"Je confirme"},{"id":"reschedule","title":"Changer"}]}}},"location":{"summary":"Service-window location","value":{"type":"location","to":"+243980395067","phoneNumberId":"11111111-1111-4111-8111-111111111111","conversationId":"22222222-2222-4222-8222-222222222222","location":{"latitude":-4.3217,"longitude":15.3125,"name":"Agence Gombe","address":"Boulevard du 30 Juin, Kinshasa"}}}}}}},"responses":{"202":{"description":"WhatsApp message accepted by the platform.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppSendResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/messages/{messageId}":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"getWhatsAppMessage","summary":"Get a WhatsApp message","description":"Returns one customer-safe WhatsApp message belonging to the authenticated organization. Provider identifiers and raw upstream evidence are never returned.","parameters":[{"$ref":"#/components/parameters/WhatsAppMessageIdPath"}],"responses":{"200":{"description":"Customer-safe WhatsApp message.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWhatsAppMessageResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/templates":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"listWhatsAppTemplates","summary":"List WhatsApp templates","description":"Returns cursor-paginated WhatsApp templates available to the authenticated organization, with local Coussema disabled templates excluded.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/WhatsAppTemplateStatusQuery"},{"$ref":"#/components/parameters/WhatsAppTemplateCategoryQuery"},{"$ref":"#/components/parameters/WhatsAppTemplateNameQuery"},{"$ref":"#/components/parameters/DateFromQuery"},{"$ref":"#/components/parameters/DateToQuery"}],"responses":{"200":{"description":"Paginated WhatsApp template collection.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWhatsAppTemplatesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:send"],"operationId":"createWhatsAppTemplate","summary":"Submit a WhatsApp template to Meta","description":"Submits a utility (notification), marketing (promotion) or authentication (verification code) template to Meta for review, on the WhatsApp Business account of your own number. Write the message with {{1}}, {{2}}… for what changes at each send and give one example each. At the top, a `title` or a `media` file (image, video or document) by a public https example link that Coussema keeps for every send; a `website` button may end with {{1}} and an `example` for a personalized link. Promotions also take a `copy_code` button, a limited-time `offer` and a `cards` carousel (2 to 10 cards). The name and language are the template identity: the same pair is refused while under review or approved, and a rejected template is sent again for review. 201 returns Meta's review state (usually `pending`); 202 means Meta's answer is being confirmed (`draft`): read the template again with its id.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"}],"requestBody":{"required":true,"description":"Template in plain fields: title, message, examples, footer, buttons.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsAppTemplateRequest"},"examples":{"notification":{"summary":"Notification with a field and a button","value":{"name":"invoice_ready","language":"fr","category":"utility","title":"Votre facture","message":"Bonjour {{1}}, votre facture {{2}} est disponible.","examples":["Mireille","F-2026-114"],"footer":"Atlas Logistics","buttons":[{"type":"website","text":"Voir la facture","url":"https://example.com/invoices"}]}},"promotion":{"summary":"Promotion with an image and a personalized link","value":{"name":"weekend_offer","language":"fr","category":"marketing","media":{"type":"image","url":"https://example.com/images/collection.jpg"},"message":"Bonjour {{1}}, -20 % ce week-end sur la nouvelle collection.","examples":["Mireille"],"buttons":[{"type":"website","text":"Voir l’offre","url":"https://example.com/offers/{{1}}","example":"red-dress"}]}},"verificationCode":{"summary":"Verification code","value":{"name":"login_code","language":"fr","category":"authentication","verificationCode":{"securityNotice":true,"expiresInMinutes":10}}}}}}},"responses":{"201":{"description":"Template submitted; Meta's review state.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateResponse"}}}},"202":{"description":"Template submitted; Meta's answer is being confirmed (`draft`).","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/templates/{templateId}":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"getWhatsAppTemplate","summary":"Get a WhatsApp template","description":"Returns one template of the authenticated organization with Meta's current review state (`draft`, `pending`, `approved`, `rejected`, `paused`) and a customer-safe refusal reason.","parameters":[{"$ref":"#/components/parameters/WhatsAppTemplateIdPath"}],"responses":{"200":{"description":"WhatsApp template.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/conversations":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"listWhatsAppConversations","summary":"List WhatsApp conversations","description":"Returns cursor-paginated WhatsApp conversations with service-window timestamps for the authenticated organization.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/WhatsAppConversationStatusQuery"},{"$ref":"#/components/parameters/WhatsAppRecipientQuery"},{"$ref":"#/components/parameters/DateFromQuery"},{"$ref":"#/components/parameters/DateToQuery"}],"responses":{"200":{"description":"Paginated WhatsApp conversation collection.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWhatsAppConversationsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/phone-numbers":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"getWhatsAppPhoneNumberHealth","summary":"Get WhatsApp phone-number health","description":"Returns the customer-safe connection, quality, messaging-tier, and credential-health projection for WhatsApp numbers owned by the authenticated organization.","responses":{"200":{"description":"WhatsApp phone-number health projection.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWhatsAppPhoneNumberHealthResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/campaigns":{"post":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:send"],"operationId":"createWhatsAppCampaign","summary":"Create a WhatsApp campaign, with an optional SMS relay","description":"Creates a campaign of one approved template for the authenticated organization, with the same rules as the dashboard: recipients need an active opt-in for the template category (or `declaredConsent`, recorded as opt-ins with the API key as author), every personalized part takes the recipient value or its `defaults` text, and the campaign is sent now or at `scheduledAt`. With `smsRelay`, the numbers Meta reports without WhatsApp get one SMS each from an approved Sender ID, billed on the SMS balance; this needs the `sms:send` scope as well, an SMS template's fields take the WhatsApp values of the same name, a field the WhatsApp template does not have takes its `smsRelay.fieldValues` value (the same for the whole campaign), and a carousel needs an SMS template. Limits: at most 2 000 recipients per request (split larger lists), 200 characters per personalized value, a 5 MiB request body. `dryRun` checks everything and returns the counts and the most SMS the relay may send, without creating anything: use it to pre-validate a list. A creation needs an `Idempotency-Key` header or a `clientReference`: a replay returns the same campaign. Follow the campaign with `GET /v1/whatsapp/campaigns/{campaignId}` and webhooks.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"},{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"WhatsApp campaign payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsAppCampaignRequest"},"examples":{"relay":{"summary":"Campaign with an SMS relay","value":{"name":"Rappel fin d'abonnement","templateId":"22222222-2222-4222-8222-222222222222","recipients":[{"phone":"+243980395067","values":["Mireille","31/10/2026"]},{"phone":"+243810000000","values":["Jean","02/11/2026"]}],"defaults":["cher client","bientôt"],"smsRelay":{"senderId":"33333333-3333-4333-8333-333333333333","smsTemplateId":"44444444-4444-4444-8444-444444444444","fieldValues":{"Bouquet":"Famille"}},"clientReference":"rappels-2026-10-29"}}}}}},"responses":{"200":{"description":"Dry run: everything checked, nothing created.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsAppCampaignResponse"}}}},"202":{"description":"WhatsApp campaign created and scheduled.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsAppCampaignResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/campaigns/{campaignId}":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"getWhatsAppCampaignStatus","summary":"Get WhatsApp campaign status","description":"Returns aggregate delivery counts for one WhatsApp campaign owned by the authenticated organization, and its SMS relay counts when it asked for one, without provider identifiers or supplier cost evidence.","parameters":[{"$ref":"#/components/parameters/WhatsAppCampaignIdPath"}],"responses":{"200":{"description":"Customer-safe WhatsApp campaign status.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWhatsAppCampaignStatusResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/wallet":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"getWhatsAppWalletSummary","summary":"Get WhatsApp wallet summary","description":"Returns available, reserved, consumed, and total WhatsApp wallet amounts for the authenticated organization.","responses":{"200":{"description":"WhatsApp wallet summary.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWhatsAppWalletSummaryResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/opt-ins":{"get":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:read"],"operationId":"listWhatsAppOptIns","summary":"List WhatsApp opt-ins","description":"Returns cursor-paginated recipient opt-ins of the authenticated organization, newest first. Active opt-ins by default; `status=opted_out` or `all` include the closed ones, which are kept as evidence.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/WhatsAppOptInStatusQuery"},{"$ref":"#/components/parameters/WhatsAppOptInPhoneQuery"},{"$ref":"#/components/parameters/WhatsAppOptInCategoryQuery"}],"responses":{"200":{"description":"Paginated WhatsApp opt-ins.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWhatsAppOptInsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:send"],"operationId":"recordWhatsAppOptIns","summary":"Record WhatsApp opt-ins","description":"Records that each recipient agreed to receive the business's WhatsApp templates of the given categories (`utility` when none is given). A template send needs an active opt-in for its category. Idempotent: an active opt-in for the same number and category is returned as `existing` and never rewritten. Up to 500 numbers per call; the whole batch is refused when one entry is invalid.","requestBody":{"required":true,"description":"Opt-ins to record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordWhatsAppOptInsRequest"},"examples":{"basic":{"summary":"One customer, utility and authentication","value":{"optIns":[{"phone":"+243980395067","categories":["utility","authentication"],"proof":"Case cochée sur le formulaire de commande du 20/10/2026","reference":"order-12345"}]}}}}}},"responses":{"200":{"description":"Recorded or existing opt-ins.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordWhatsAppOptInsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whatsapp/opt-ins/opt-out":{"post":{"tags":["WhatsApp"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["whatsapp:send"],"operationId":"optOutWhatsAppRecipients","summary":"Record WhatsApp opt-outs","description":"Closes the active opt-ins of these numbers (every category unless some are named): their templates are refused from now on, including sends already queued. Idempotent. A recipient who replies STOP on WhatsApp is opted out automatically, and START opts them in for utility templates.","requestBody":{"required":true,"description":"Numbers to opt out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutWhatsAppRecipientsRequest"},"examples":{"basic":{"summary":"One customer, every category","value":{"phones":["+243980395067"]}}}}}},"responses":{"200":{"description":"Opt-ins closed by this call.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutWhatsAppRecipientsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/account":{"get":{"tags":["Account"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["account:read"],"operationId":"getAccountSummary","summary":"Get account commercial summary","description":"Returns the authenticated organization commercial state, current subscription, and remaining quota.","responses":{"200":{"description":"Current organization commercial summary.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountSummaryResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/usage":{"get":{"tags":["Account"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["account:read"],"operationId":"listUsage","summary":"List quota usage ledger entries","description":"Returns cursor-paginated usage and quota adjustment entries for the authenticated organization.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"}],"responses":{"200":{"description":"Paginated commercial usage ledger.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsageResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/contacts":{"get":{"tags":["Contacts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["contacts:read"],"operationId":"listContacts","summary":"List contacts","description":"Returns a cursor-paginated collection of organization contacts.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/ContactTagQuery"}],"responses":{"200":{"description":"Paginated organization contacts.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListContactsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Contacts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["contacts:write"],"operationId":"createContact","summary":"Create a contact","description":"Creates one organization contact and normalizes phone/tags server-side.","requestBody":{"required":true,"description":"Contact creation payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactRequest"},"examples":{"basic":{"summary":"Contact with tags","value":{"name":"Nadine M.","phone":"243837509125","tags":["vip","retail"]}}}}}},"responses":{"200":{"description":"Created contact.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"tags":["Contacts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["contacts:write"],"operationId":"deleteContact","summary":"Delete a contact","description":"Deletes one organization contact by identifier.","parameters":[{"$ref":"#/components/parameters/ContactIdQuery"}],"responses":{"200":{"description":"Contact deleted.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/campaigns":{"get":{"tags":["Campaigns"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["campaigns:read"],"operationId":"listCampaigns","summary":"List campaigns","description":"Returns cursor-paginated campaigns for the authenticated organization.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"}],"responses":{"200":{"description":"Paginated campaign collection.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCampaignsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Campaigns"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["campaigns:write"],"operationId":"createCampaign","summary":"Create a campaign","description":"Creates one immediate or scheduled SMS campaign on the shared organization-centric runtime.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"},{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"Campaign creation payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignRequest"},"examples":{"scheduled":{"summary":"Scheduled campaign","value":{"name":"Promo week-end","message_template":"Bonjour {{name}}, profitez de -15% ce week-end.","scheduled_at":"2026-04-10T08:30:00.000Z","sender_id":"11111111-1111-4111-8111-111111111111","audience_tags":["vip","retail"],"audience_tag_match_mode":"all"}}}}}},"responses":{"201":{"description":"Created campaign.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sms/templates":{"get":{"tags":["SMS"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sms:send"],"operationId":"listSmsTemplates","summary":"List SMS templates","description":"Returns the saved SMS texts of the authenticated organization, the ones also offered in its dashboard.","responses":{"200":{"description":"Saved SMS templates of the organization.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSmsTemplatesResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["SMS"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sms:send"],"operationId":"createSmsTemplate","summary":"Save an SMS template","description":"Saves an SMS text under a name, unique among the organization templates in use. No approval is needed: it can be sent at once with templateId.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"},{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"SMS template payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSmsTemplateRequest"},"examples":{"basic":{"summary":"Appointment reminder","value":{"name":"Rappel de rendez-vous","body":"Votre rendez-vous est confirmé pour demain à 10h."}}}}}},"responses":{"201":{"description":"Saved SMS template.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSmsTemplateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sender-ids":{"get":{"tags":["Sender IDs"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sender_ids:read"],"operationId":"listSenderIds","summary":"List sender IDs","description":"Returns the authenticated organization sender IDs, including approval status and default selection.","responses":{"200":{"description":"Current sender IDs for the organization.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSenderIdsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Sender IDs"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sender_ids:write"],"operationId":"createSenderIdRequest","summary":"Request a sender ID","description":"Creates or reopens a sender ID request for the authenticated organization. Approval remains operator and admin controlled.","parameters":[{"$ref":"#/components/parameters/RequestIdHeader"},{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"Sender ID request payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSenderIdRequest"},"examples":{"basic":{"summary":"Request a branded sender","value":{"value":"TESSA"}}}}}},"responses":{"201":{"description":"Created sender ID request.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSenderIdRequestResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api-keys":{"get":{"tags":["API Keys"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["api_keys:read"],"operationId":"listApiKeys","summary":"List API keys","description":"Lists the organization API keys visible to the authenticated principal, paginated by cursor.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"}],"responses":{"200":{"description":"Paginated API key collection.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["API Keys"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["api_keys:write"],"operationId":"createApiKey","summary":"Create an API key","description":"Creates a scoped organization API key and returns the plaintext secret exactly once. A key may delegate only scopes it already owns, and each organization may keep at most five active keys.","requestBody":{"required":true,"description":"API key creation payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"},"examples":{"basic":{"summary":"Server integration key","value":{"name":"Production backend","scopes":["account:read","sms:send"]}}}}}},"responses":{"200":{"description":"Created API key.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api-keys/{apiKeyId}":{"delete":{"tags":["API Keys"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["api_keys:write"],"operationId":"revokeApiKey","summary":"Revoke an API key","description":"Revokes one organization API key by identifier.","parameters":[{"$ref":"#/components/parameters/ApiKeyIdPath"}],"responses":{"200":{"description":"API key revoked.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/webhooks":{"get":{"tags":["Webhooks"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["webhooks:read"],"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","description":"Lists outbound webhook endpoints configured for the authenticated organization.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"}],"responses":{"200":{"description":"Paginated webhook endpoint collection.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWebhookEndpointsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Webhooks"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["webhooks:write"],"operationId":"createWebhookEndpoint","summary":"Create a webhook endpoint","description":"Registers a webhook endpoint and returns its signing secret once at creation time.","requestBody":{"required":true,"description":"Webhook endpoint creation payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointRequest"},"examples":{"basic":{"summary":"Message lifecycle events","value":{"url":"https://example.com/hooks/coussema","subscribed_events":["message.sent","message.delivered","message.failed"]}},"whatsapp":{"summary":"WhatsApp lifecycle events","value":{"url":"https://example.com/hooks/coussema-whatsapp","subscribed_events":["whatsapp.message.sent","whatsapp.message.delivered","whatsapp.message.read","whatsapp.message.failed","whatsapp.message.received"]}}}}}},"responses":{"200":{"description":"Created webhook endpoint and signing secret.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/webhooks/{webhookEndpointId}":{"delete":{"tags":["Webhooks"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["webhooks:write"],"operationId":"disableWebhookEndpoint","summary":"Disable a webhook endpoint","description":"Disables an existing outbound webhook endpoint by identifier.","parameters":[{"$ref":"#/components/parameters/WebhookEndpointIdPath"}],"responses":{"200":{"description":"Webhook endpoint disabled.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts":{"get":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:read"],"operationId":"listSubAccounts","summary":"List sub-accounts","description":"Returns every sub-account of the calling reseller with its balance, units moved, billable consumption, message outcomes and amount at its resale price for the period (default: last 30 days, at most 400 days).","parameters":[{"$ref":"#/components/parameters/ReportFromQuery"},{"$ref":"#/components/parameters/ReportToQuery"}],"responses":{"200":{"description":"Sub-accounts and their activity for the period.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSubAccountsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"createSubAccount","summary":"Create a sub-account","description":"Creates a sub-account for the calling reseller. The reference is your own identifier and the idempotency key: repeating it returns the existing sub-account with HTTP 200.","requestBody":{"required":true,"description":"Sub-account to create.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubAccountRequest"},"examples":{"basic":{"summary":"A client of the reseller","value":{"name":"Client A","reference":"client-a","resale_price_usd":0.035}}}}}},"responses":{"200":{"description":"Sub-account already existed for this reference.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubAccountResponse"}}}},"201":{"description":"Sub-account created.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubAccountResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}":{"patch":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"updateSubAccount","summary":"Suspend, reactivate or reprice a sub-account","description":"Changes either the status or the resale price, one at a time. A reseller can lift only a suspension it decided; a suspension decided by Coussema returns 409.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"}],"requestBody":{"required":true,"description":"Status or resale price.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubAccountRequest"},"examples":{"suspend":{"summary":"Suspend","value":{"status":"suspended"}},"price":{"summary":"Reprice","value":{"resale_price_usd":0.035}}}}}},"responses":{"200":{"description":"Change applied.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubAccountResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/transfers":{"post":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"createSubAccountTransfer","summary":"Give or take back SMS units","description":"allocation moves units from the reseller balance to the sub-account; reclaim takes back units the reseller allocated and the sub-account has not used. Idempotency-Key is required: a retry with the same key returns the original transfer with HTTP 200.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"},{"$ref":"#/components/parameters/RequiredIdempotencyKeyHeader"}],"requestBody":{"required":true,"description":"Transfer to apply.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccountTransferRequest"},"examples":{"allocation":{"summary":"Give 10 000 SMS","value":{"kind":"allocation","units":10000}}}}}},"responses":{"200":{"description":"Replay of an applied transfer.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccountTransferResponse"}}}},"201":{"description":"Transfer applied.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccountTransferResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/statement":{"get":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:read"],"operationId":"getSubAccountStatement","summary":"Daily statement of a sub-account","description":"One row per day (Africa/Kinshasa) with units moved, billable consumption, message outcomes and the amount at the resale price in force when each SMS was billed.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"},{"$ref":"#/components/parameters/ReportFromQuery"},{"$ref":"#/components/parameters/ReportToQuery"}],"responses":{"200":{"description":"Daily statement.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccountStatementResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/api-keys":{"get":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:read"],"operationId":"listSubAccountApiKeys","summary":"List the API keys of a sub-account","description":"Lists the API keys of one of your sub-accounts, masked and newest first; revoked keys stay listed with revokedAt set.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/SubAccountIdPath"}],"responses":{"200":{"description":"Sub-account API keys.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"createSubAccountApiKey","summary":"Create an API key for a sub-account","description":"Creates a key that sends with the own balance and Sender IDs of the sub-account. The secret is returned once. Sub-account keys hold SMS scopes only: never sub_accounts or WhatsApp scopes.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"}],"requestBody":{"required":true,"description":"Key name and optional scopes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubAccountApiKeyRequest"},"examples":{"sms":{"summary":"SMS sending key","value":{"name":"Production","scopes":["account:read","sender_ids:read","sms:send"]}}}}}},"responses":{"201":{"description":"Key created; plaintext shown once.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/messages":{"get":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:read"],"operationId":"listSubAccountMessages","summary":"Delivery status of the SMS of a sub-account","description":"Lists the SMS of one of your sub-accounts, newest first, with their customer-safe delivery status (DLR). Filter by period, status (repeatable or comma-separated) and phone; paginate with the cursor. Provider identifiers and raw errors are never returned.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/SubAccountIdPath"},{"$ref":"#/components/parameters/ReportFromQuery"},{"$ref":"#/components/parameters/ReportToQuery"},{"$ref":"#/components/parameters/SubAccountMessageStatusQuery"},{"$ref":"#/components/parameters/SubAccountMessagePhoneQuery"}],"responses":{"200":{"description":"Messages and their delivery status.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSubAccountMessagesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/webhooks":{"get":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:read"],"operationId":"listSubAccountWebhooks","summary":"List the webhooks of a sub-account","description":"SMS lifecycle webhook endpoints configured for one of your sub-accounts.","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"},{"$ref":"#/components/parameters/SubAccountIdPath"}],"responses":{"200":{"description":"Webhook endpoints.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWebhookEndpointsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"createSubAccountWebhook","summary":"Receive the delivery events of a sub-account","description":"Registers an HTTPS endpoint that receives the SMS lifecycle events (message.sent, message.delivered, message.failed...) of one sub-account, signed like every Coussema webhook. Point all your sub-accounts to the same URL and route by organization_id, which is the sub-account id. The signing secret is returned once.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"}],"requestBody":{"required":true,"description":"Endpoint URL and SMS events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubAccountWebhookRequest"},"examples":{"dlr":{"summary":"Delivery reports","value":{"url":"https://platform.example.com/webhooks/coussema","subscribed_events":["message.delivered","message.failed"]}}}}}},"responses":{"201":{"description":"Endpoint created; signing secret shown once.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/webhooks/{webhookEndpointId}":{"delete":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"disableSubAccountWebhook","summary":"Disable a webhook of a sub-account","description":"Stops event delivery to one webhook endpoint of one of your sub-accounts.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"},{"$ref":"#/components/parameters/WebhookEndpointIdPath"}],"responses":{"200":{"description":"Endpoint disabled.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/sender-ids":{"get":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:read"],"operationId":"listSubAccountSenderIds","summary":"List the Sender IDs of a sub-account","description":"A sub-account sends only with its own approved Sender IDs.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"}],"responses":{"200":{"description":"Sender IDs of the sub-account.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSenderIdsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"requestSubAccountSenderId","summary":"Request a Sender ID for a sub-account","description":"Submits a Sender ID request on behalf of a sub-account, with the dossier of the end client. Coussema reviews it like any request; the sub-account needs a paid balance, so allocate units first.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"}],"requestBody":{"required":true,"description":"Sender ID request payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSenderIdRequest"},"examples":{"basic":{"summary":"Brand of the end client","value":{"value":"CLIENTA"}}}}}},"responses":{"201":{"description":"Sender ID request created.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSenderIdRequestResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/sub-accounts/{subAccountId}/api-keys/{apiKeyId}":{"delete":{"tags":["Sub-accounts"],"security":[{"bearerApiKey":[]},{"xApiKey":[]}],"x-coussema-required-api-key-scopes":["sub_accounts:write"],"operationId":"revokeSubAccountApiKey","summary":"Revoke a sub-account API key","description":"Revokes one API key of one of your sub-accounts. Revocation is logical and audited; an unknown key or a key of another sub-account returns 404, an already revoked key returns 200.","parameters":[{"$ref":"#/components/parameters/SubAccountIdPath"},{"$ref":"#/components/parameters/ApiKeyIdPath"}],"responses":{"200":{"description":"Key revoked.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"securitySchemes":{"bearerApiKey":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Send your Coussema API key as Authorization: Bearer <api-key>."},"xApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Alternative header for clients that cannot send Authorization."}},"parameters":{"RequestIdHeader":{"name":"x-request-id","in":"header","required":false,"description":"Optional caller-supplied correlation identifier. The API always echoes a request id in responses.","schema":{"type":"string","minLength":1,"maxLength":255}},"IdempotencyKeyHeader":{"name":"Idempotency-Key","in":"header","required":false,"description":"Recommended for POST requests. Reusing the same key with the same payload replays the stored response.","schema":{"type":"string","minLength":1,"maxLength":255}},"RequiredIdempotencyKeyHeader":{"name":"Idempotency-Key","in":"header","required":true,"description":"Required for SMS sends. Reusing the same key with the same payload replays the stored response and prevents duplicate enqueue on client retries.","schema":{"type":"string","minLength":1,"maxLength":255}},"LimitQuery":{"name":"limit","in":"query","required":false,"description":"Maximum number of items to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},"CursorQuery":{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page.","schema":{"type":"string","minLength":1}},"DateFromQuery":{"name":"dateFrom","in":"query","required":false,"description":"Inclusive lower bound on the resource creation timestamp.","schema":{"type":"string","format":"date-time"}},"DateToQuery":{"name":"dateTo","in":"query","required":false,"description":"Inclusive upper bound on the resource creation timestamp.","schema":{"type":"string","format":"date-time"}},"WhatsAppTemplateStatusQuery":{"name":"status","in":"query","required":false,"description":"Filter WhatsApp templates by Coussema template status.","schema":{"type":"string","enum":["draft","pending","approved","rejected","paused","disabled"]}},"WhatsAppTemplateCategoryQuery":{"name":"category","in":"query","required":false,"description":"Filter WhatsApp templates by template category.","schema":{"type":"string","enum":["authentication","utility","marketing"]}},"WhatsAppConversationStatusQuery":{"name":"status","in":"query","required":false,"description":"Filter WhatsApp conversations by conversation state.","schema":{"type":"string","enum":["open","pending","needs_human","closed","blocked"]}},"WhatsAppMessageStatusQuery":{"name":"status","in":"query","required":false,"description":"Filter WhatsApp messages by delivery state.","schema":{"type":"string","enum":["funding","accepted","queued","sent","delivered","read","failed","cancelled","ambiguous"]}},"WhatsAppBillingCategoryQuery":{"name":"category","in":"query","required":false,"description":"Filter WhatsApp messages by billing/conversation category.","schema":{"type":"string","enum":["authentication","utility","marketing","service"]}},"WhatsAppTemplateNameQuery":{"name":"template","in":"query","required":false,"description":"Filter by WhatsApp template name.","schema":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[a-z0-9_]+$"}},"WhatsAppOptInStatusQuery":{"name":"status","in":"query","required":false,"description":"Active opt-ins (default), closed ones, or all.","schema":{"type":"string","enum":["active","opted_out","all"]}},"WhatsAppOptInPhoneQuery":{"name":"phone","in":"query","required":false,"description":"Filter by recipient phone number in E.164 format.","schema":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"}},"WhatsAppOptInCategoryQuery":{"name":"category","in":"query","required":false,"description":"Filter by template category.","schema":{"type":"string","enum":["authentication","utility","marketing","service"]}},"WhatsAppRecipientQuery":{"name":"recipient","in":"query","required":false,"description":"Filter by recipient phone number in E.164 format.","schema":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"}},"SubAccountMessageStatusQuery":{"name":"status","in":"query","required":false,"description":"Delivery status filter; repeat the parameter or separate values with commas.","schema":{"type":"array","items":{"type":"string","enum":["scheduled","queued","processing","retry","sent","delivered","failed","delivery_unconfirmed"]}},"style":"form","explode":true},"SubAccountMessagePhoneQuery":{"name":"phone","in":"query","required":false,"description":"Recipient phone number or digits contained in it.","schema":{"type":"string","pattern":"^\\+?[0-9]{3,15}$"}},"SubAccountIdPath":{"name":"subAccountId","in":"path","required":true,"description":"Coussema sub-account identifier.","schema":{"type":"string","format":"uuid"}},"ReportFromQuery":{"name":"from","in":"query","required":false,"description":"Period start (ISO 8601 with offset). Defaults to 30 days before `to`.","schema":{"type":"string","format":"date-time"}},"ReportToQuery":{"name":"to","in":"query","required":false,"description":"Period end, exclusive (ISO 8601 with offset). Defaults to now.","schema":{"type":"string","format":"date-time"}},"WhatsAppTemplateIdPath":{"name":"templateId","in":"path","required":true,"description":"Coussema WhatsApp template identifier.","schema":{"type":"string","format":"uuid"}},"WhatsAppMessageIdPath":{"name":"messageId","in":"path","required":true,"description":"Coussema WhatsApp message identifier.","schema":{"type":"string","format":"uuid"}},"WhatsAppCampaignIdPath":{"name":"campaignId","in":"path","required":true,"description":"Coussema WhatsApp campaign identifier.","schema":{"type":"string","format":"uuid"}},"ContactTagQuery":{"name":"tag","in":"query","required":false,"description":"Filter contacts to a single tag value.","schema":{"type":"string","minLength":1,"maxLength":64}},"ContactIdQuery":{"name":"id","in":"query","required":true,"description":"Contact identifier.","schema":{"type":"string","format":"uuid"}},"ApiKeyIdPath":{"name":"apiKeyId","in":"path","required":true,"description":"API key identifier.","schema":{"type":"string","format":"uuid"}},"WebhookEndpointIdPath":{"name":"webhookEndpointId","in":"path","required":true,"description":"Webhook endpoint identifier.","schema":{"type":"string","format":"uuid"}}},"headers":{"XRequestId":{"description":"Unique request correlation id generated or echoed by the API.","schema":{"type":"string"}},"XRateLimitLimit":{"description":"Rate limit budget allocated to the authenticated API key window.","schema":{"type":"integer","minimum":0}},"XRateLimitRemaining":{"description":"Remaining requests in the current API key window.","schema":{"type":"integer","minimum":0}},"XRateLimitReset":{"description":"Unix timestamp at which the current rate-limit window resets.","schema":{"type":"integer","minimum":0}},"RetryAfter":{"description":"Seconds to wait before retrying after a rate-limit rejection.","schema":{"type":"integer","minimum":0}}},"responses":{"BadRequest":{"description":"Invalid request payload, query, or header values.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"Unauthorized":{"description":"Missing or invalid API key authentication.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Authenticated principal cannot access the requested organization resource.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Requested resource was not found.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InsufficientQuota":{"description":"The SMS balance cannot cover this send. Nothing was queued or debited. Recharge, then send again with a new Idempotency-Key.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Conflict":{"description":"The request conflicts with current state or a prior idempotent request.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConflictErrorResponse"}}}},"RateLimited":{"description":"The authenticated API key exceeded its request budget for the current window.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Unexpected server-side failure.","headers":{"x-request-id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ApiIndexResponse":{"type":"object","properties":{"service":{"type":"string","const":"coussema-api"},"version":{"type":"string","const":"v1"},"status":{"type":"string","const":"available"},"docsPath":{"type":"string","const":"/docs/api"},"healthPath":{"type":"string","const":"/v1/health"},"openApiPath":{"type":"string","const":"/v1/openapi.json"}},"required":["service","version","status","docsPath","healthPath","openApiPath"],"additionalProperties":false},"HealthResponse":{"type":"object","properties":{"service":{"type":"string","const":"coussema-api"},"version":{"type":"string","const":"v1"},"status":{"type":"string","const":"ok"},"timestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"release":{"type":"object","properties":{"manifestVersion":{"type":"number","const":1},"service":{"type":"string","const":"coussema-api"},"commitSha":{"anyOf":[{"type":"string","const":"unknown"},{"type":"string","pattern":"^[0-9a-f]{40}$"}]},"builtAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"environment":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"source":{"type":"string","enum":["explicit","vercel","github","unconfigured"]},"schemaVersion":{"type":"string","const":"20261030180000"},"schemaCompatibility":{"type":"object","properties":{"minimum":{"type":"string","const":"20260717020000"},"maximum":{"type":"string","const":"20261030180000"}},"required":["minimum","maximum"],"additionalProperties":false},"complete":{"type":"boolean"}},"required":["manifestVersion","service","commitSha","builtAt","environment","source","schemaVersion","schemaCompatibility","complete"],"additionalProperties":false}},"required":["service","version","status","timestamp","release"],"additionalProperties":false},"AccountSummaryResponse":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationName":{"type":"string","minLength":1},"organizationSlug":{"type":"string","minLength":1},"billingEmail":{"type":["string","null"]},"defaultSenderName":{"type":["string","null"]},"status":{"type":"string","minLength":1},"canSend":{"type":"boolean"},"createdAt":{"type":"string"},"plan":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"includedSms":{"type":"integer","minimum":0,"maximum":9007199254740991},"priceUsd":{"type":"number","minimum":0},"isActive":{"type":"boolean"},"overageEnabled":{"type":"boolean"},"overageLimitSms":{"type":"integer","minimum":0,"maximum":9007199254740991},"overagePriceUsdPerSms":{"type":"number","minimum":0},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","code","name","description","includedSms","priceUsd","isActive","overageEnabled","overageLimitSms","overagePriceUsdPerSms","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"subscription":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"planId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string","minLength":1},"smsLimit":{"type":"integer","minimum":0,"maximum":9007199254740991},"priceUsd":{"type":"number","minimum":0},"startsAt":{"type":"string"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":["string","null"]},"overageEnabled":{"type":"boolean"},"overageLimitSms":{"type":"integer","minimum":0,"maximum":9007199254740991},"overagePriceUsdPerSms":{"type":"number","minimum":0}},"required":["id","planId","status","smsLimit","priceUsd","startsAt","expiresAt","createdAt","updatedAt","overageEnabled","overageLimitSms","overagePriceUsdPerSms"],"additionalProperties":false},{"type":"null"}]},"quota":{"type":"object","properties":{"creditUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"debitUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"remainingUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"limitUnits":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["creditUnits","debitUnits","remainingUnits","limitUnits"],"additionalProperties":false},"overage":{"type":"object","properties":{"enabled":{"type":"boolean"},"limitUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"usedUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"remainingUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"billableUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"priceUsdPerSms":{"type":"number","minimum":0}},"required":["enabled","limitUnits","usedUnits","remainingUnits","billableUnits","priceUsdPerSms"],"additionalProperties":false}},"required":["organizationId","organizationName","organizationSlug","billingEmail","defaultSenderName","status","canSend","createdAt","plan","subscription","quota","overage"],"additionalProperties":false},"ListUsageResponse":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"entryType":{"type":"string","minLength":1},"direction":{"type":"string","enum":["credit","debit"]},"units":{"type":"integer","minimum":0,"maximum":9007199254740991},"referenceType":{"type":["string","null"]},"referenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","organizationId","entryType","direction","units","referenceType","referenceId","createdAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["usage","pageInfo"],"additionalProperties":false},"SendSmsRequest":{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":32},"message":{"type":"string","minLength":1,"maxLength":1530},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"variables":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":40},"additionalProperties":{"type":"string","maxLength":120}},"senderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"senderName":{"type":"string","minLength":1,"maxLength":32},"clientReference":{"type":"string","minLength":1,"maxLength":128},"whatsappFirst":{"type":"object","properties":{"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fieldValues":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":40},"additionalProperties":{"type":"string","minLength":1,"maxLength":1024}}},"required":["phoneNumberId","templateId"],"additionalProperties":false}},"required":["to"],"additionalProperties":false},"ListSmsTemplatesResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"body":{"type":"string","minLength":1,"maxLength":1530},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","body","createdAt","updatedAt"],"additionalProperties":false}}},"required":["templates"],"additionalProperties":false},"CreateSmsTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"body":{"type":"string","minLength":1,"maxLength":1530}},"required":["name","body"],"additionalProperties":false},"CreateSmsTemplateResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"template":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"body":{"type":"string","minLength":1,"maxLength":1530},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","body","createdAt","updatedAt"],"additionalProperties":false}},"required":["success","template"],"additionalProperties":false},"SendSmsSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"queued":{"type":"boolean"},"status":{"type":"string","enum":["accepted","sent"]},"count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"remainingQuota":{"type":"integer","minimum":0,"maximum":9007199254740991},"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]}},"required":["id","clientReference"],"additionalProperties":false},"provider":{"type":"object","properties":{"code":{"type":"string","minLength":1},"messageId":{"type":"null"},"httpStatus":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["code","messageId","httpStatus"],"additionalProperties":false}},"required":["success","count","remainingQuota","message","provider"],"additionalProperties":false},"SendSmsResponse":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true},"queued":{"type":"boolean"},"status":{"type":"string","enum":["accepted","sent"]},"count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"remainingQuota":{"type":"integer","minimum":0,"maximum":9007199254740991},"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]}},"required":["id","clientReference"],"additionalProperties":false},"provider":{"type":"object","properties":{"code":{"type":"string","minLength":1},"messageId":{"type":"null"},"httpStatus":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["code","messageId","httpStatus"],"additionalProperties":false}},"required":["success","count","remainingQuota","message","provider"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true},"queued":{"type":"boolean","const":true},"status":{"type":"string","const":"accepted"},"channel":{"type":"string","const":"whatsapp_first"},"count":{"type":"number","const":1},"remainingQuota":{"type":"integer","minimum":0,"maximum":9007199254740991},"whatsapp":{"type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId"],"additionalProperties":false},"sms":{"type":"object","properties":{"messageId":{"type":"null"},"billableUnits":{"type":"integer","minimum":1,"maximum":4}},"required":["messageId","billableUnits"],"additionalProperties":false},"clientReference":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"provider":{"type":"object","properties":{"code":{"type":"string","minLength":1},"messageId":{"type":"null"},"httpStatus":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["code","messageId","httpStatus"],"additionalProperties":false}},"required":["success","queued","status","channel","count","remainingQuota","whatsapp","sms","clientReference","provider"],"additionalProperties":false}]},"WhatsAppPublicApiSendRequest":{"oneOf":[{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","const":"template"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[a-z0-9_]+$"},"language":{"type":"string","minLength":2,"maxLength":16},"category":{"type":"string","enum":["authentication","utility","marketing"]},"parameters":{"default":[],"maxItems":32,"type":"array","items":{"type":"string","maxLength":1024}},"media":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"},"filename":{"type":"string","minLength":1,"maxLength":240}},"required":["url"],"additionalProperties":false},"urlParameters":{"maxItems":2,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"couponCode":{"type":"string","minLength":1,"maxLength":20},"offerExpiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"cards":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"media":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"}},"required":["url"],"additionalProperties":false},"parameters":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"urlParameters":{"maxItems":2,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}},"additionalProperties":false}}},"required":["name","language","category","parameters"],"additionalProperties":false},"smsFallback":{"type":"object","properties":{"senderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"smsTemplateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":1530},"fieldValues":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":40},"additionalProperties":{"type":"string","minLength":1,"maxLength":60}}},"required":["senderId"],"additionalProperties":false}},"required":["to","phoneNumberId","type","template"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","const":"text"},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["to","phoneNumberId","type","conversationId","text"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"image"},"media":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"},"caption":{"type":"string","minLength":1,"maxLength":1024}},"required":["url"],"additionalProperties":false}},"required":["to","phoneNumberId","conversationId","type","media"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"video"},"media":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"},"caption":{"type":"string","minLength":1,"maxLength":1024}},"required":["url"],"additionalProperties":false}},"required":["to","phoneNumberId","conversationId","type","media"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"document"},"media":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"},"caption":{"type":"string","minLength":1,"maxLength":1024},"filename":{"type":"string","minLength":1,"maxLength":240}},"required":["url"],"additionalProperties":false}},"required":["to","phoneNumberId","conversationId","type","media"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"audio"},"media":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"}},"required":["url"],"additionalProperties":false}},"required":["to","phoneNumberId","conversationId","type","media"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"interactive"},"interactive":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"button"},"bodyText":{"type":"string","minLength":1,"maxLength":1024},"footerText":{"type":"string","maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":256},"title":{"type":"string","minLength":1,"maxLength":20}},"required":["id","title"],"additionalProperties":false}}},"required":["type","bodyText","buttons"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"list"},"bodyText":{"type":"string","minLength":1,"maxLength":1024},"footerText":{"type":"string","maxLength":60},"buttonText":{"type":"string","minLength":1,"maxLength":20},"sections":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","maxLength":24},"rows":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":24},"description":{"type":"string","maxLength":72}},"required":["id","title"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false}}},"required":["type","bodyText","buttonText","sections"],"additionalProperties":false}]}},"required":["to","phoneNumberId","conversationId","type","interactive"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientReference":{"type":"string","minLength":1,"maxLength":128},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"location"},"location":{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"name":{"type":"string","minLength":1,"maxLength":256},"address":{"type":"string","minLength":1,"maxLength":1024}},"required":["latitude","longitude"],"additionalProperties":false}},"required":["to","phoneNumberId","conversationId","type","location"],"additionalProperties":false}]},"WhatsAppSendResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"queued":{"type":"boolean"},"status":{"type":"string","enum":["accepted","queued","sent"]},"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"object","properties":{"code":{"type":"string","const":"whatsapp"},"messageId":{"type":["string","null"]},"httpStatus":{"type":"integer","minimum":100,"maximum":599}},"required":["code","messageId","httpStatus"],"additionalProperties":false}},"required":["success","queued","status","messageId","provider"],"additionalProperties":false},"GetWhatsAppMessageResponse":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"conversationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"direction":{"type":"string","enum":["inbound","outbound"]},"messageType":{"type":"string","enum":["template","text","interactive","image","document","audio","video","location","sticker","unknown"]},"recipientPhoneE164":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"templateName":{"type":["string","null"]},"templateLanguage":{"type":["string","null"]},"category":{"anyOf":[{"type":"string","enum":["authentication","utility","marketing","service"]},{"type":"null"}]},"status":{"type":"string","enum":["funding","accepted","queued","sent","delivered","read","failed","cancelled","ambiguous"]},"bodyPreview":{"type":["string","null"]},"publicErrorCode":{"type":["string","null"]},"failureLabel":{"type":["string","null"]},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"readAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]},"relay":{"type":"object","properties":{"requested":{"type":"boolean"},"status":{"type":"string","enum":["none","queued","refused"]},"reason":{"type":["string","null"]},"sms":{"anyOf":[{"type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["DELIVERED","UNDELIV","EXPIRED","REJECTD","FAILED","PENDING","UNKNOWN"]}},"required":["messageId","status"],"additionalProperties":false},{"type":"null"}]}},"required":["requested","status","reason","sms"],"additionalProperties":false}},"required":["id","conversationId","direction","messageType","recipientPhoneE164","templateName","templateLanguage","category","status","bodyPreview","publicErrorCode","failureLabel","createdAt","sentAt","deliveredAt","readAt","failedAt","relay"],"additionalProperties":false}},"required":["message"],"additionalProperties":false},"GetWhatsAppPhoneNumberHealthResponse":{"type":"object","properties":{"channelStatus":{"type":"string","enum":["ready","attention","unavailable"]},"phoneNumbers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"displayNumberMasked":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"quality":{"type":"string","enum":["good","warning","critical","unknown"]},"messagingTier":{"type":"string","minLength":1},"status":{"type":"string","enum":["connected","restricted","disconnected","unknown"]},"active":{"type":"boolean"},"credentialStatus":{"type":"string","enum":["healthy","expiring","expired","revoked","error","unknown"]},"credentialExpiresAt":{"type":["string","null"]},"credentialLastCheckedAt":{"type":["string","null"]},"webhookStatus":{"type":"string","enum":["healthy","configured","stale","unconfigured","unknown"]},"lastUpdatedAt":{"type":["string","null"]}},"required":["id","phoneNumberId","displayNumberMasked","displayName","quality","messagingTier","status","active","credentialStatus","credentialExpiresAt","credentialLastCheckedAt","webhookStatus","lastUpdatedAt"],"additionalProperties":false}}},"required":["channelStatus","phoneNumbers"],"additionalProperties":false},"GetWhatsAppCampaignStatusResponse":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"status":{"type":"string","minLength":1},"scheduledAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"summary":{"type":"object","properties":{"totalRecipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"acceptedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"sentCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"deliveredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"readCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"failedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"billedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["totalRecipients","acceptedCount","sentCount","deliveredCount","readCount","failedCount","billedCount"],"additionalProperties":false},"smsRelay":{"anyOf":[{"type":"object","properties":{"senderName":{"type":["string","null"]},"relayedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"notRelayedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["senderName","relayedCount","notRelayedCount"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","status","scheduledAt","createdAt","updatedAt","summary","smsRelay"],"additionalProperties":false}},"required":["campaign"],"additionalProperties":false},"CreateWhatsAppCampaignRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recipients":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"values":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":200}}},"required":["phone"],"additionalProperties":false}},"defaults":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":1024}},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"spreadMinutes":{"type":"integer","minimum":0,"maximum":120},"couponCode":{"type":"string","minLength":1,"maxLength":20},"offerExpiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"declaredConsent":{"type":"boolean"},"smsRelay":{"type":"object","properties":{"senderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"smsTemplateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fieldValues":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":40},"additionalProperties":{"type":"string","minLength":1,"maxLength":60}}},"required":["senderId"],"additionalProperties":false},"dryRun":{"type":"boolean"},"clientReference":{"type":"string","minLength":1,"maxLength":200}},"required":["name","templateId","recipients"],"additionalProperties":false},"CreateWhatsAppCampaignResponse":{"type":"object","properties":{"dryRun":{"type":"boolean"},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"status":{"type":"string","minLength":1},"scheduledAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]}},"required":["id","name","status","scheduledAt","createdAt"],"additionalProperties":false},{"type":"null"}]},"recipients":{"type":"object","properties":{"requested":{"type":"integer","minimum":0,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"excluded":{"type":"integer","minimum":0,"maximum":9007199254740991},"excludedRecipients":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"phone":{"type":"string"},"reason":{"type":"string","enum":["invalid_phone","duplicate","missing_opt_in"]}},"required":["phone","reason"],"additionalProperties":false}}},"required":["requested","accepted","excluded","excludedRecipients"],"additionalProperties":false},"smsRelay":{"anyOf":[{"type":"object","properties":{"senderName":{"type":"string","minLength":1},"smsTemplateName":{"type":["string","null"]},"maxSmsUnits":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["senderName","smsTemplateName","maxSmsUnits"],"additionalProperties":false},{"type":"null"}]}},"required":["dryRun","campaign","recipients","smsRelay"],"additionalProperties":false},"GetWhatsAppWalletSummaryResponse":{"type":"object","properties":{"balances":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":8},"availableBalance":{"type":"number","minimum":0},"reservedBalance":{"type":"number","minimum":0},"consumedBalance":{"type":"number","minimum":0},"updatedAt":{"type":"string"}},"required":["currency","availableBalance","reservedBalance","consumedBalance","updatedAt"],"additionalProperties":false}}},"required":["balances"],"additionalProperties":false},"RecordWhatsAppOptInsRequest":{"type":"object","properties":{"optIns":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"categories":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["authentication","utility","marketing"]}},"proof":{"type":"string","minLength":1,"maxLength":1000},"reference":{"type":"string","minLength":1,"maxLength":200}},"required":["phone"],"additionalProperties":false}},"consentTextVersion":{"type":"string","minLength":1,"maxLength":120}},"required":["optIns"],"additionalProperties":false},"RecordWhatsAppOptInsResponse":{"type":"object","properties":{"optIns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"category":{"type":"string","enum":["authentication","utility","marketing","service"]},"source":{"type":"string","minLength":1,"maxLength":32},"reference":{"type":["string","null"]},"consentTextVersion":{"type":"string"},"optedInAt":{"type":"string"},"optedOutAt":{"type":["string","null"]},"createdAt":{"type":"string"},"status":{"type":"string","enum":["created","existing"]}},"required":["id","phone","category","source","reference","consentTextVersion","optedInAt","optedOutAt","createdAt","status"],"additionalProperties":false}}},"required":["optIns"],"additionalProperties":false},"OptOutWhatsAppRecipientsRequest":{"type":"object","properties":{"phones":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"categories":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["authentication","utility","marketing"]}},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["phones"],"additionalProperties":false},"OptOutWhatsAppRecipientsResponse":{"type":"object","properties":{"optedOut":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"category":{"type":"string","enum":["authentication","utility","marketing","service"]},"source":{"type":"string","minLength":1,"maxLength":32},"reference":{"type":["string","null"]},"consentTextVersion":{"type":"string"},"optedInAt":{"type":"string"},"optedOutAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","phone","category","source","reference","consentTextVersion","optedInAt","optedOutAt","createdAt"],"additionalProperties":false}}},"required":["optedOut"],"additionalProperties":false},"ListWhatsAppOptInsResponse":{"type":"object","properties":{"optIns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"category":{"type":"string","enum":["authentication","utility","marketing","service"]},"source":{"type":"string","minLength":1,"maxLength":32},"reference":{"type":["string","null"]},"consentTextVersion":{"type":"string"},"optedInAt":{"type":"string"},"optedOutAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","phone","category","source","reference","consentTextVersion","optedInAt","optedOutAt","createdAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["optIns","pageInfo"],"additionalProperties":false},"ListWhatsAppTemplatesResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","enum":["authentication","utility","marketing"]},"status":{"type":"string","enum":["draft","pending","approved","rejected","paused","disabled"]},"rejectionReason":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","language","category","status","rejectionReason","createdAt","updatedAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["templates","pageInfo"],"additionalProperties":false},"CreateWhatsAppTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[a-z0-9_]+$"},"language":{"type":"string","enum":["af","sq","ar","az","bn","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","en","en_GB","en_US","et","fil","fi","fr","ka","de","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","rw_RW","ko","ky_KG","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","sk","sl","es","es_AR","es_ES","es_MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"]},"category":{"type":"string","enum":["utility","authentication","marketing"]},"phoneNumberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":60},"media":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","document"]},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"},"filename":{"type":"string","minLength":1,"maxLength":240}},"required":["type","url"],"additionalProperties":false},"message":{"type":"string","minLength":1,"maxLength":1024},"examples":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":1024}},"fieldNames":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"quick_reply"},"text":{"type":"string","minLength":1,"maxLength":25}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"website"},"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/[^\\s]+$"},"example":{"type":"string","minLength":1,"maxLength":2000}},"required":["type","text","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"call"},"text":{"type":"string","minLength":1,"maxLength":25},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["type","text","phone"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"copy_code"},"example":{"type":"string","minLength":1,"maxLength":20}},"required":["type","example"],"additionalProperties":false}]}},"offer":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":16},"expires":{"type":"boolean"}},"required":["text"],"additionalProperties":false},"cards":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"media":{"type":"object","properties":{"type":{"type":"string","enum":["image","video"]},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/[^\\s]+$"}},"required":["type"],"additionalProperties":false},"message":{"type":"string","minLength":1,"maxLength":160},"examples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"buttons":{"maxItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"quick_reply"},"text":{"type":"string","minLength":1,"maxLength":25}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"website"},"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/[^\\s]+$"},"example":{"type":"string","minLength":1,"maxLength":2000}},"required":["type","text","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"call"},"text":{"type":"string","minLength":1,"maxLength":25},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["type","text","phone"],"additionalProperties":false}]}}},"required":["media"],"additionalProperties":false}},"verificationCode":{"type":"object","properties":{"securityNotice":{"type":"boolean"},"expiresInMinutes":{"type":"integer","minimum":1,"maximum":90},"buttonText":{"type":"string","minLength":1,"maxLength":25}},"additionalProperties":false}},"required":["name","language","category"],"additionalProperties":false},"WhatsAppTemplateResponse":{"type":"object","properties":{"template":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","enum":["authentication","utility","marketing"]},"status":{"type":"string","enum":["draft","pending","approved","rejected","paused","disabled"]},"rejectionReason":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","language","category","status","rejectionReason","createdAt","updatedAt"],"additionalProperties":false}},"required":["template"],"additionalProperties":false},"ListWhatsAppConversationsResponse":{"type":"object","properties":{"conversations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recipientPhoneE164":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"status":{"type":"string","enum":["open","pending","needs_human","closed","blocked"]},"customerServiceWindowUntil":{"type":["string","null"]},"lastCustomerMessageAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","recipientPhoneE164","status","customerServiceWindowUntil","lastCustomerMessageAt","createdAt","updatedAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["conversations","pageInfo"],"additionalProperties":false},"ListWhatsAppMessagesResponse":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"conversationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"direction":{"type":"string","enum":["inbound","outbound"]},"messageType":{"type":"string","enum":["template","text","interactive","image","document","audio","video","location","sticker","unknown"]},"recipientPhoneE164":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"templateName":{"type":["string","null"]},"templateLanguage":{"type":["string","null"]},"category":{"anyOf":[{"type":"string","enum":["authentication","utility","marketing","service"]},{"type":"null"}]},"status":{"type":"string","enum":["funding","accepted","queued","sent","delivered","read","failed","cancelled","ambiguous"]},"bodyPreview":{"type":["string","null"]},"publicErrorCode":{"type":["string","null"]},"failureLabel":{"type":["string","null"]},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"readAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]}},"required":["id","conversationId","direction","messageType","recipientPhoneE164","templateName","templateLanguage","category","status","bodyPreview","publicErrorCode","failureLabel","createdAt","sentAt","deliveredAt","readAt","failedAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["messages","pageInfo"],"additionalProperties":false},"CreateContactRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","minLength":6,"maxLength":32},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["phone"],"additionalProperties":false},"CreateContactResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]},"phone":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","phone","tags","created_at","updated_at"],"additionalProperties":false}},"required":["success","contact"],"additionalProperties":false},"ListContactsResponse":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]},"phone":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","name","phone","tags","created_at","updated_at"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["contacts","pageInfo"],"additionalProperties":false},"CreateCampaignRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"message_template":{"type":"string","minLength":1,"maxLength":1530},"scheduled_at":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"string","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?:Z))$"}]},{"type":"null"}]},"total_recipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"sender_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sender_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"audience_preset_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"audience_tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"audience_tag_match_mode":{"type":"string","enum":["any","all"]}},"required":["name","message_template"],"additionalProperties":false},"CreateCampaignResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_by_user_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"sender_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sender_name":{"type":["string","null"]},"message_template":{"type":"string"},"audience_preset_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"audience_tags":{"type":"array","items":{"type":"string"}},"audience_tag_match_mode":{"type":"string","enum":["any","all"]},"status":{"type":"string"},"scheduled_at":{"type":["string","null"]},"total_recipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"sent_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"delivered_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","created_by_user_id","name","sender_id","sender_name","message_template","audience_preset_id","audience_tags","audience_tag_match_mode","status","scheduled_at","total_recipients","queued_count","sent_count","delivered_count","failed_count","created_at","updated_at"],"additionalProperties":false}},"required":["success","campaign"],"additionalProperties":false},"ListCampaignsResponse":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"created_by_user_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"sender_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sender_name":{"type":["string","null"]},"message_template":{"type":"string"},"audience_preset_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"audience_tags":{"type":"array","items":{"type":"string"}},"audience_tag_match_mode":{"type":"string","enum":["any","all"]},"status":{"type":"string"},"scheduled_at":{"type":["string","null"]},"total_recipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"queued_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"sent_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"delivered_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","created_by_user_id","name","sender_id","sender_name","message_template","audience_preset_id","audience_tags","audience_tag_match_mode","status","scheduled_at","total_recipients","queued_count","sent_count","delivered_count","failed_count","created_at","updated_at"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["campaigns","pageInfo"],"additionalProperties":false},"CreateSenderIdRequest":{"type":"object","properties":{"value":{"type":"string","minLength":3,"maxLength":11},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["value"],"additionalProperties":false},"CreateSenderIdRequestResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"sender_id":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requested_by_user_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reviewed_by_user_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"value":{"type":"string","minLength":1,"maxLength":32},"normalized_value":{"type":"string","minLength":1,"maxLength":32},"status":{"type":"string","enum":["pending_review","pending_operator","approved","rejected","archived"]},"rejection_reason":{"type":["string","null"]},"operator_reference":{"type":["string","null"]},"is_default":{"type":"boolean"},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"reviewed_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","requested_by_user_id","reviewed_by_user_id","value","normalized_value","status","rejection_reason","operator_reference","is_default","metadata","reviewed_at","created_at","updated_at"],"additionalProperties":false}},"required":["success","sender_id"],"additionalProperties":false},"ListSenderIdsResponse":{"type":"object","properties":{"sender_ids":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requested_by_user_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reviewed_by_user_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"value":{"type":"string","minLength":1,"maxLength":32},"normalized_value":{"type":"string","minLength":1,"maxLength":32},"status":{"type":"string","enum":["pending_review","pending_operator","approved","rejected","archived"]},"rejection_reason":{"type":["string","null"]},"operator_reference":{"type":["string","null"]},"is_default":{"type":"boolean"},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"reviewed_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","requested_by_user_id","reviewed_by_user_id","value","normalized_value","status","rejection_reason","operator_reference","is_default","metadata","reviewed_at","created_at","updated_at"],"additionalProperties":false}}},"required":["sender_ids"],"additionalProperties":false},"CreateApiKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"scopes":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"string","enum":["account:read","sms:send","campaigns:read","campaigns:write","contacts:read","contacts:write","sender_ids:read","sender_ids:write","webhooks:read","webhooks:write","api_keys:read","api_keys:write","whatsapp:read","whatsapp:send","sub_accounts:read","sub_accounts:write"]}}},"required":["name"],"additionalProperties":false},"CreateApiKeyResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"apiKey":{"type":"object","properties":{"apiKeyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"keyPrefix":{"type":"string","minLength":1},"maskedKey":{"type":"string","minLength":1},"plainTextKey":{"type":"string","minLength":1},"scopes":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"string","enum":["account:read","sms:send","campaigns:read","campaigns:write","contacts:read","contacts:write","sender_ids:read","sender_ids:write","webhooks:read","webhooks:write","api_keys:read","api_keys:write","whatsapp:read","whatsapp:send","sub_accounts:read","sub_accounts:write"]}},"lastUsedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["apiKeyId","organizationId","name","keyPrefix","maskedKey","plainTextKey","scopes","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false}},"required":["success","apiKey"],"additionalProperties":false},"ListApiKeysResponse":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"keyPrefix":{"type":"string","minLength":1},"maskedKey":{"type":"string","minLength":1},"scopes":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"string","enum":["account:read","sms:send","campaigns:read","campaigns:write","contacts:read","contacts:write","sender_ids:read","sender_ids:write","webhooks:read","webhooks:write","api_keys:read","api_keys:write","whatsapp:read","whatsapp:send","sub_accounts:read","sub_accounts:write"]}},"lastUsedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","organizationId","name","keyPrefix","maskedKey","scopes","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["apiKeys","pageInfo"],"additionalProperties":false},"CreateWebhookEndpointRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"subscribed_events":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["message.queued","message.sent","message.delivered","message.failed","message.delivery_unconfirmed","balance.low","whatsapp.message.sent","whatsapp.message.delivered","whatsapp.message.read","whatsapp.message.failed","whatsapp.message.received","sub_account.transfer.created","sub_account.balance.low"]}}},"required":["url","subscribed_events"],"additionalProperties":false},"CreateWebhookEndpointResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"webhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string","format":"uri"},"subscribed_events":{"type":"array","items":{"type":"string","enum":["message.queued","message.sent","message.delivered","message.failed","message.delivery_unconfirmed","balance.low","whatsapp.message.sent","whatsapp.message.delivered","whatsapp.message.read","whatsapp.message.failed","whatsapp.message.received","sub_account.transfer.created","sub_account.balance.low"]}},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","url","subscribed_events","status","created_at","updated_at"],"additionalProperties":false},"signingSecret":{"type":"string","minLength":1}},"required":["success","webhookEndpoint","signingSecret"],"additionalProperties":false},"ListWebhookEndpointsResponse":{"type":"object","properties":{"webhookEndpoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string","format":"uri"},"subscribed_events":{"type":"array","items":{"type":"string","enum":["message.queued","message.sent","message.delivered","message.failed","message.delivery_unconfirmed","balance.low","whatsapp.message.sent","whatsapp.message.delivered","whatsapp.message.read","whatsapp.message.failed","whatsapp.message.received","sub_account.transfer.created","sub_account.balance.low"]}},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","url","subscribed_events","status","created_at","updated_at"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["webhookEndpoints","pageInfo"],"additionalProperties":false},"CreateSubAccountRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"reference":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"billing_email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},{"type":"null"}]},"resale_price_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1},{"type":"null"}]}},"required":["name","reference"],"additionalProperties":false},"CreateSubAccountResponse":{"type":"object","properties":{"outcome":{"type":"string","enum":["created","existing"]},"sub_account_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["outcome","sub_account_id"],"additionalProperties":false},"UpdateSubAccountRequest":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["active","suspended"]}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"resale_price_usd":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["resale_price_usd"],"additionalProperties":false},{"type":"object","properties":{"low_balance_threshold_units":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000000},{"type":"null"}]}},"required":["low_balance_threshold_units"],"additionalProperties":false}]},"UpdateSubAccountResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"status":{"anyOf":[{"type":"string","enum":["active","suspended"]},{"type":"null"}]}},"required":["success","status"],"additionalProperties":false},"SubAccountTransferRequest":{"type":"object","properties":{"kind":{"type":"string","enum":["allocation","reclaim"]},"units":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["kind","units"],"additionalProperties":false},"SubAccountTransferResponse":{"type":"object","properties":{"outcome":{"type":"string","enum":["created","replayed"]},"transfer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reseller_remaining_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sub_account_remaining_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["outcome","transfer_id","reseller_remaining_units","sub_account_remaining_units"],"additionalProperties":false},"ListSubAccountsResponse":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"sub_accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"reference":{"type":["string","null"]},"status":{"type":"string"},"suspended_by_reseller":{"type":"boolean"},"remaining_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allocated_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reclaimed_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consumed_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refunded_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"messages":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_submitted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unconfirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","delivered","failed","not_submitted","unconfirmed","pending"],"additionalProperties":false},"resale_unit_price_usd":{"type":["number","null"]},"resale_amount_usd":{"type":"number"},"unpriced_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"low_balance_threshold_units":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","name","reference","status","suspended_by_reseller","remaining_units","allocated_units","reclaimed_units","consumed_units","refunded_units","messages","resale_unit_price_usd","resale_amount_usd","unpriced_units","low_balance_threshold_units","created_at"],"additionalProperties":false}}},"required":["period","sub_accounts"],"additionalProperties":false},"SubAccountStatementResponse":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"sub_account_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"allocated_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reclaimed_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consumed_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refunded_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"messages_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"messages_delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"messages_failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resale_amount_usd":{"type":"number"},"unpriced_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","allocated_units","reclaimed_units","consumed_units","refunded_units","messages_total","messages_delivered","messages_failed","resale_amount_usd","unpriced_units"],"additionalProperties":false}}},"required":["period","sub_account_id","days"],"additionalProperties":false},"CreateSubAccountApiKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"scopes":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","enum":["account:read","sms:send","campaigns:read","campaigns:write","contacts:read","contacts:write","sender_ids:read","sender_ids:write","webhooks:read","webhooks:write","api_keys:read","api_keys:write"]}}},"required":["name"],"additionalProperties":false},"CreateSubAccountWebhookRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"subscribed_events":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","enum":["message.queued","message.sent","message.delivered","message.failed","message.delivery_unconfirmed"]}}},"required":["url","subscribed_events"],"additionalProperties":false},"ListSubAccountMessagesResponse":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"source_surface":{"type":"string"},"recipient_phone":{"type":"string"},"sender_name":{"type":"string"},"status":{"type":"string"},"status_label":{"type":"string"},"is_pending":{"type":"boolean"},"sent_at":{"type":["string","null"]},"delivered_at":{"type":["string","null"]},"failed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","campaign_id","source_surface","recipient_phone","sender_name","status","status_label","is_pending","sent_at","delivered_at","failed_at","created_at"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false}},"required":["messages","pageInfo"],"additionalProperties":false},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"requestId":{"type":"string"}},"required":["error","requestId"],"additionalProperties":true},"ConflictErrorResponse":{"allOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"type":"object","properties":{"remainingQuota":{"type":["integer","null"]}}}]},"ValidationErrorResponse":{"allOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}}}]}}}}