{"openapi":"3.1.0","info":{"title":"WhatsApp Platform API","version":"1.0.0","description":"Send WhatsApp messages from your own systems. Authenticate with an API key created in the dashboard (Settings → Developers). All ids are UUIDs. Times are ISO 8601 UTC."},"servers":[{"url":"http://chatlineapi.codecano.com/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Messages","description":"Send template or session messages and read their delivery status"},{"name":"Media","description":"Upload files to attach to messages"},{"name":"Templates","description":"Approved message templates of your WhatsApp account"},{"name":"Contacts","description":"Your contact list"},{"name":"Numbers","description":"Connected phone numbers"},{"name":"Events","description":"Things that happened in your systems — an order paid, a trial ending — which can start an automation"},{"name":"Calls","description":"WhatsApp voice calls on your numbers: who called whom, who took it, how long it lasted"},{"name":"Webhooks","description":"Events we POST to your server (configured in the dashboard)"}],"paths":{"/phone-numbers":{"get":{"tags":["Numbers"],"summary":"List connected numbers","operationId":"listPhoneNumbers","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumber"}}}}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"tags":["Messages"],"summary":"Send a message","operationId":"sendMessage","description":"Template messages can be sent any time. Session messages (text, media, location) are only accepted within 24 hours of the customer's last message; otherwise the API answers 409 with details.code = \"window_closed\". Marketing templates to opted-out contacts answer 409 \"opted_out\". The message is queued and sent asynchronously; poll GET /messages/{id} or subscribe to the message.status webhook.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessage"}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"window_closed | opted_out | number_inactive | account_disconnected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}":{"get":{"tags":["Messages"],"summary":"Get message status","operationId":"getMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media":{"post":{"tags":["Media"],"summary":"Upload a file","operationId":"uploadMedia","description":"multipart/form-data with a single field \"file\". Images ≤ 5 MB, video/audio ≤ 16 MB, documents ≤ 100 MB (WhatsApp limits). Use the returned id as mediaId.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Stored","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"tags":["Templates"],"summary":"List templates","operationId":"listTemplates","parameters":[{"name":"status","in":"query","required":false,"description":"APPROVED, PENDING, REJECTED, PAUSED …","schema":{"description":"APPROVED, PENDING, REJECTED, PAUSED …","type":"string","maxLength":30}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":true,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}}}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates/{id}":{"get":{"tags":["Templates"],"summary":"Get a template","operationId":"getTemplate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"post":{"tags":["Events"],"summary":"Record an event","operationId":"recordEvent","description":"Tell us something happened in your systems. The contact is named by contactId, or by phone — in which case they are created if new, unless createContact is false. Send an idempotencyKey and a retried delivery lands once: the second call answers 200 with created = false instead of 201, and starts no automation. Events with a matching trigger start a flow; the payload becomes the variables of that flow.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordEvent"}}}},"responses":{"200":{"description":"Already recorded under this idempotencyKey (created = false)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"201":{"description":"Recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Events"],"summary":"List events","operationId":"listEvents","parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"contactId","in":"query","required":false,"schema":{"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":"days","in":"query","required":true,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}},{"name":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":true,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EventListItem"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}}}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calls":{"get":{"tags":["Calls"],"summary":"List calls","operationId":"listCalls","description":"Newest first. Calls are answered and placed by people in the dashboard; this is their log. Subscribe to the call.received and call.ended webhooks to hear about them as they happen.","parameters":[{"name":"direction","in":"query","required":false,"description":"inbound = the customer called; outbound = your team called","schema":{"description":"inbound = the customer called; outbound = your team called","type":"string","enum":["inbound","outbound"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["ringing","connecting","in_progress","completed","missed","rejected","failed"]}},{"name":"contactId","in":"query","required":false,"schema":{"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":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":true,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}}}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calls/{id}":{"get":{"tags":["Calls"],"summary":"Get a call","operationId":"getCall","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts":{"get":{"tags":["Contacts"],"summary":"List contacts","operationId":"listContacts","parameters":[{"name":"search","in":"query","required":false,"description":"Name or phone","schema":{"description":"Name or phone","type":"string","maxLength":100}},{"name":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":true,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}}}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Contacts"],"summary":"Create a contact","operationId":"createContact","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContact"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Number already exists (details.contactId)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts/{id}":{"get":{"tags":["Contacts"],"summary":"Get a contact","operationId":"getContact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Contacts"],"summary":"Update a contact","operationId":"updateContact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContact"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Contacts"],"summary":"Delete a contact","operationId":"deleteContact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Validation error or business rule (details.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope missing or feature not in plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"message.received":{"post":{"tags":["Webhooks"],"summary":"message.received event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"message.status":{"post":{"tags":["Webhooks"],"summary":"message.status event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"template.status":{"post":{"tags":["Webhooks"],"summary":"template.status event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"contact.opted_out":{"post":{"tags":["Webhooks"],"summary":"contact.opted_out event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"account.alert":{"post":{"tags":["Webhooks"],"summary":"account.alert event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"call.received":{"post":{"tags":["Webhooks"],"summary":"call.received event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"call.ended":{"post":{"tags":["Webhooks"],"summary":"call.ended event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"ping":{"post":{"tags":["Webhooks"],"summary":"ping event","description":"POST to your endpoint with headers X-Webhook-Id, X-Webhook-Event, X-Webhook-Timestamp and X-Webhook-Signature (t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>). Answer 2xx within 10 seconds; anything else is retried with backoff (1 min, 5 min, 30 min, 2 h, 12 h).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"wa_live_…","description":"Authorization: Bearer wa_live_… (create keys in the dashboard; scopes limit what a key can do)"}},"schemas":{"SendMessage":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"template"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"description":"Approved template name"},"language":{"description":"Template language code (en_US). Optional when the name is unique.","type":"string","minLength":2,"maxLength":16},"header":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","maxLength":1024},"parameterName":{"description":"For templates with named parameters","type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"currency"},"fallbackValue":{"type":"string"},"code":{"type":"string","minLength":3,"maxLength":3},"amount1000":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","fallbackValue","code","amount1000"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"date_time"},"fallbackValue":{"type":"string"}},"required":["type","fallbackValue"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["image","video","document"]},"mediaId":{"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)$","description":"Id returned by POST /v1/media"}},"required":["type","mediaId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"payload"},"payload":{"type":"string","maxLength":256}},"required":["type","payload"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"coupon_code"},"couponCode":{"type":"string","maxLength":15}},"required":["type","couponCode"],"additionalProperties":false}],"description":"Template parameter"}},"body":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","maxLength":1024},"parameterName":{"description":"For templates with named parameters","type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"currency"},"fallbackValue":{"type":"string"},"code":{"type":"string","minLength":3,"maxLength":3},"amount1000":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","fallbackValue","code","amount1000"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"date_time"},"fallbackValue":{"type":"string"}},"required":["type","fallbackValue"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["image","video","document"]},"mediaId":{"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)$","description":"Id returned by POST /v1/media"}},"required":["type","mediaId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"payload"},"payload":{"type":"string","maxLength":256}},"required":["type","payload"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"coupon_code"},"couponCode":{"type":"string","maxLength":15}},"required":["type","couponCode"],"additionalProperties":false}],"description":"Template parameter"}},"buttons":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9},"subType":{"type":"string","enum":["quick_reply","url","copy_code"]},"parameters":{"minItems":1,"maxItems":1,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","maxLength":1024},"parameterName":{"description":"For templates with named parameters","type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"currency"},"fallbackValue":{"type":"string"},"code":{"type":"string","minLength":3,"maxLength":3},"amount1000":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","fallbackValue","code","amount1000"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"date_time"},"fallbackValue":{"type":"string"}},"required":["type","fallbackValue"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["image","video","document"]},"mediaId":{"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)$","description":"Id returned by POST /v1/media"}},"required":["type","mediaId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"payload"},"payload":{"type":"string","maxLength":256}},"required":["type","payload"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"coupon_code"},"couponCode":{"type":"string","maxLength":15}},"required":["type","couponCode"],"additionalProperties":false}],"description":"Template parameter"}}},"required":["index","subType","parameters"],"additionalProperties":false}}},"required":["name"],"additionalProperties":false}},"required":["to","type","template"],"additionalProperties":false},{"oneOf":[{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"text"},"text":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4096},"previewUrl":{"type":"boolean"}},"required":["body"],"additionalProperties":false}},"required":["to","type","text"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"image"},"image":{"type":"object","properties":{"mediaId":{"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)$","description":"Id returned by POST /v1/media"},"caption":{"type":"string","maxLength":1024},"filename":{"type":"string","maxLength":240}},"required":["mediaId"],"additionalProperties":false}},"required":["to","type","image"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"video"},"video":{"type":"object","properties":{"mediaId":{"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)$","description":"Id returned by POST /v1/media"},"caption":{"type":"string","maxLength":1024},"filename":{"type":"string","maxLength":240}},"required":["mediaId"],"additionalProperties":false}},"required":["to","type","video"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"audio"},"audio":{"type":"object","properties":{"mediaId":{"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)$","description":"Id returned by POST /v1/media"},"filename":{"type":"string","maxLength":240}},"required":["mediaId"],"additionalProperties":false}},"required":["to","type","audio"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"document"},"document":{"type":"object","properties":{"mediaId":{"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)$","description":"Id returned by POST /v1/media"},"caption":{"type":"string","maxLength":1024},"filename":{"type":"string","maxLength":240}},"required":["mediaId"],"additionalProperties":false}},"required":["to","type","document"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"type":{"type":"string","const":"sticker"},"sticker":{"type":"object","properties":{"mediaId":{"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)$","description":"Id returned by POST /v1/media"},"filename":{"type":"string","maxLength":240}},"required":["mediaId"],"additionalProperties":false}},"required":["to","type","sticker"],"additionalProperties":false},{"type":"object","properties":{"to":{"type":"string","minLength":6,"maxLength":30,"description":"Recipient phone number in E.164 (+919876543210). Digits without + are interpreted in the workspace country."},"from":{"description":"Sender: the phone number id from GET /v1/phone-numbers (our id or the Meta phone_number_id). Optional when the workspace has one active number.","type":"string","minLength":6,"maxLength":64},"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","maxLength":200},"address":{"type":"string","maxLength":300}},"required":["latitude","longitude"],"additionalProperties":false}},"required":["to","type","location"],"additionalProperties":false}]}],"description":"A template message (allowed any time) or a session message (only within 24 hours of the customer's last message)."},"Message":{"$schema":"https://json-schema.org/draft/2020-12/schema","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)$"},"status":{"type":"string","enum":["queued","sending","accepted","held","paused","sent","delivered","read","played","failed"],"description":"queued → accepted → sent → delivered → read; failed carries errorCode"},"type":{"type":"string"},"to":{"type":"string","description":"WhatsApp id of the recipient (digits)"},"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)$"},"contactId":{"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)$"},"wamid":{"description":"Meta message id once accepted","type":["string","null"]},"errorCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"errorMessage":{"type":["string","null"]},"createdAt":{"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))$"},"sentAt":{"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"}]},"deliveredAt":{"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"}]},"readAt":{"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"}]},"failedAt":{"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"}]}},"required":["id","status","type","to","conversationId","contactId","wamid","errorCode","errorMessage","createdAt","sentAt","deliveredAt","readAt","failedAt"],"additionalProperties":false},"Media":{"$schema":"https://json-schema.org/draft/2020-12/schema","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)$","description":"Use as mediaId when sending"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"originalName":{"type":["string","null"]},"createdAt":{"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))$"}},"required":["id","mimeType","sizeBytes","originalName","createdAt"],"additionalProperties":false},"Template":{"$schema":"https://json-schema.org/draft/2020-12/schema","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"},"status":{"type":"string"},"parameterFormat":{"type":"string","enum":["POSITIONAL","NAMED"]},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Meta template components (HEADER/BODY/FOOTER/BUTTONS)"},"qualityScore":{"type":["string","null"]},"updatedAt":{"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))$"}},"required":["id","name","language","category","status","parameterFormat","components","qualityScore","updatedAt"],"additionalProperties":false},"Contact":{"$schema":"https://json-schema.org/draft/2020-12/schema","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)$"},"waId":{"type":"string"},"phoneE164":{"type":"string"},"name":{"type":["string","null"]},"profileName":{"type":["string","null"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"tags":{"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"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"optIn":{"type":"boolean"},"optedOut":{"type":"boolean"},"optOutSource":{"type":["string","null"]},"lastInboundAt":{"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"}]},"createdAt":{"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))$"}},"required":["id","waId","phoneE164","name","profileName","attributes","tags","optIn","optedOut","optOutSource","lastInboundAt","createdAt"],"additionalProperties":false},"Call":{"$schema":"https://json-schema.org/draft/2020-12/schema","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)$"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["ringing","connecting","in_progress","completed","missed","rejected","failed"],"description":"missed = nobody answered (either direction); rejected = declined"},"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)$"},"name":{"type":["string","null"]},"phoneE164":{"type":"string"}},"required":["id","name","phoneE164"],"additionalProperties":false},"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)$","description":"Which of your numbers the call was on"},"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"}]},"userId":{"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"}],"description":"The teammate who answered or placed the call"},"userName":{"type":["string","null"]},"startedAt":{"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))$","description":"When it started ringing"},"answeredAt":{"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"}]},"endedAt":{"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"}]},"durationSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Null when the call was never answered"},"errorCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Meta error code when the call failed"},"errorMessage":{"type":["string","null"]},"hasRecording":{"type":"boolean"}},"required":["id","direction","status","contact","phoneNumberId","conversationId","userId","userName","startedAt","answeredAt","endedAt","durationSeconds","errorCode","errorMessage","hasRecording"],"additionalProperties":false},"CreateContact":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":30,"description":"Phone number (E.164 or local digits of the workspace country)"},"name":{"type":"string","maxLength":120},"attributes":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-zA-Z0-9_]{1,40}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Free-form attributes used as template variables in campaigns"},"optIn":{"description":"Record marketing consent collected by you","type":"boolean"},"optInSource":{"type":"string","maxLength":40}},"required":["phone"],"additionalProperties":false},"RecordEvent":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"payload":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"idempotencyKey":{"type":"string","minLength":6,"maxLength":120},"occurredAt":{"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)))$"},"contactId":{"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":["name","payload","contactId"],"additionalProperties":false},{"type":"object","properties":{"name":{"allOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"string","maxLength":120}]},"payload":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"idempotencyKey":{"type":"string","minLength":6,"maxLength":120},"occurredAt":{"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)))$"},"phone":{"type":"string","minLength":6,"maxLength":20},"createContact":{"default":true,"type":"boolean"}},"required":["name","payload","phone","createContact"],"additionalProperties":false}]},"Event":{"$schema":"https://json-schema.org/draft/2020-12/schema","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","description":"Normalised: lower-cased, spaces collapsed"},"contactId":{"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)$"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"occurredAt":{"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))$"},"created":{"type":"boolean","description":"False when an idempotencyKey matched an event we already had"}},"required":["id","name","contactId","payload","occurredAt","created"],"additionalProperties":false},"EventListItem":{"$schema":"https://json-schema.org/draft/2020-12/schema","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"},"contactId":{"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)$"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"occurredAt":{"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))$"},"createdAt":{"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))$"}},"required":["id","name","contactId","payload","occurredAt","createdAt"],"additionalProperties":false},"UpdateContact":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"attributes":{"description":"Replaces all attributes","type":"object","propertyNames":{"type":"string","pattern":"^[a-zA-Z0-9_]{1,40}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"optIn":{"type":"boolean"},"optInSource":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"optedOut":{"description":"true = exclude from marketing; false clears keyword/manual/api opt-outs only","type":"boolean"}},"additionalProperties":false},"PhoneNumber":{"$schema":"https://json-schema.org/draft/2020-12/schema","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)$","description":"Use as \"from\""},"phoneNumberId":{"type":"string","description":"Meta phone_number_id (also accepted as \"from\")"},"displayPhoneNumber":{"type":"string"},"verifiedName":{"type":["string","null"]},"isActive":{"type":"boolean"},"qualityRating":{"type":["string","null"]}},"required":["id","phoneNumberId","displayPhoneNumber","verifiedName","isActive","qualityRating"],"additionalProperties":false},"WebhookPayload":{"type":"object","required":["id","event","createdAt","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id (idempotency key: retries reuse it)"},"event":{"type":"string","enum":["message.received","message.status","template.status","contact.opted_out","account.alert","call.received","call.ended","ping"]},"createdAt":{"type":"string","format":"date-time"},"organizationId":{"type":"string","format":"uuid"},"data":{"type":"object","description":"Event-specific body (see the docs page)"}}},"Error":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"bad_request | unauthorized | forbidden | not_found | conflict | rate_limited | …"},"message":{"type":"string"},"details":{"description":"Field-level details, e.g. { code: \"window_closed\" }"},"requestId":{"type":"string"}},"required":["code","message","requestId"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}