{"openapi":"3.1.0","info":{"title":"BlazeChats API","version":"1.0.0","description":"REST API for sending WhatsApp messages, managing contacts and running broadcasts from your workspace. Available on plans that include the API (Pro and Agency); other plans get 403 plan_upgrade_required. Authenticate with a workspace API key as a Bearer token. Each key is limited to 120 requests per minute."},"servers":[{"url":"https://blazechats.yoorie.com/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Workspace"},{"name":"Messages"},{"name":"Contacts"},{"name":"Templates"},{"name":"Conversations"},{"name":"Broadcasts"}],"paths":{"/me":{"get":{"operationId":"getMe","tags":["Workspace"],"summary":"Get the current workspace","description":"Returns the workspace the key belongs to, the key's scopes and the connected WhatsApp numbers. Works with any valid key.","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"plan":{"type":"string"},"status":{"type":"string"}},"required":["id","name","plan","status"],"additionalProperties":false},"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","name","scopes"],"additionalProperties":false},"numbers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_phone_number":{"type":["string","null"]},"verified_name":{"type":["string","null"]},"status":{"type":"string"},"quality_rating":{"type":["string","null"]},"messaging_limit":{"type":["string","null"]}},"required":["id","display_phone_number","verified_name","status","quality_rating","messaging_limit"],"additionalProperties":false}}},"required":["workspace","key","numbers"],"additionalProperties":false}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"operationId":"getUsage","tags":["Workspace"],"summary":"Get this month's usage","description":"Message counts for the current calendar month (UTC): sent and received, failed, conversations with activity, billable messages by Meta pricing category, broadcasts created, plus the total number of contacts. Works with any valid key. Meta bills conversation charges directly; these are counts, not amounts.","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"],"additionalProperties":false},"plan":{"type":"string"},"messages":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sent","received","failed"],"additionalProperties":false},"billable_by_category":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Billable outgoing messages by Meta pricing category (marketing, utility, authentication, service…)"},"conversations_active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"broadcasts_created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacts_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["period","plan","messages","billable_by_category","conversations_active","broadcasts_created","contacts_total"],"additionalProperties":false}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"operationId":"sendMessage","tags":["Messages"],"summary":"Send a message","description":"Queues a text or template message from the workspace's connected number and returns it with status `queued` (202). Text messages are only allowed while the customer service window is open (24 hours after the contact's last message); outside it, send an approved template. Templates are never sent to opted-out contacts.","x-scope":"messages:send","security":[{"bearerAuth":["messages:send"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"to":{"description":"Recipient phone number. Creates the contact if it's new.","type":"string","minLength":6,"maxLength":24},"contact_id":{"description":"Recipient contact id (instead of `to`)","type":"string","format":"uuid"},"text":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4096},"preview_url":{"default":true,"description":"Show a link preview for the first URL","type":"boolean"}},"required":["body"]}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"template"},"to":{"description":"Recipient phone number. Creates the contact if it's new.","type":"string","minLength":6,"maxLength":24},"contact_id":{"description":"Recipient contact id (instead of `to`)","type":"string","format":"uuid"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name as approved by Meta"},"language":{"type":"string","minLength":2,"maxLength":15,"description":"Template language code, e.g. en or en_US"},"variables":{"default":[],"description":"Values for {{1}}, {{2}}… in order","maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":1024}},"header_media_url":{"description":"Public https link for an IMAGE, VIDEO or DOCUMENT header","type":"string","format":"uri"}},"required":["name","language"]}},"required":["type","template"]}]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Contact opted out (templates)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"No connected number, window closed, or template not approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Sending paused or queue unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}":{"get":{"operationId":"getMessage","tags":["Messages"],"summary":"Get a message","description":"Poll this, or subscribe to the message.status webhook, to follow a message from queued to sent, delivered and read.","x-scope":"messages:read","security":[{"bearerAuth":["messages:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts":{"get":{"operationId":"listContacts","tags":["Contacts"],"summary":"List contacts","description":"Newest first. Filter by search text, tag or opt-out state.","x-scope":"contacts:read","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–100)","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Matches name, profile name, phone or email","schema":{"type":"string","maxLength":100}},{"name":"tag","in":"query","required":false,"description":"Only contacts with this tag","schema":{"type":"string","maxLength":40}},{"name":"opted_out","in":"query","required":false,"description":"Filter by opt-out state","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"}},"required":["data","page","limit","total","has_more"],"additionalProperties":false}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createContact","tags":["Contacts"],"summary":"Create or update a contact","description":"Upserts by phone number: if the number already exists in the workspace, the given fields are merged into it (tags are added, not replaced) and 200 is returned instead of 201.","x-scope":"contacts:write","security":[{"bearerAuth":["contacts:write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":24,"description":"Phone number with country code, e.g. +91 98765 43210 or 919876543210"},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","format":"email"},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"attributes":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":"string","maxLength":500},"description":"Custom key/value fields"},"opted_out":{"type":"boolean"}},"required":["phone"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Invalid phone number or fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts/{id}":{"get":{"operationId":"getContact","tags":["Contacts"],"summary":"Get a contact","x-scope":"contacts:read","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateContact","tags":["Contacts"],"summary":"Update a contact","description":"Only the fields you send change. `tags` and `attributes` replace the stored values; send null for name or email to clear them.","x-scope":"contacts:write","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource id","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"attributes":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":"string","maxLength":500},"description":"Custom key/value fields"},"opted_out":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"operationId":"listTemplates","tags":["Templates"],"summary":"List message templates","description":"Templates synced from Meta for this workspace's numbers (refreshed every 6 hours, on status webhooks, and when you press Sync in the app).","x-scope":"templates:read","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–100)","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["APPROVED","PENDING","REJECTED","PAUSED","DISABLED"]}},{"name":"language","in":"query","required":false,"schema":{"type":"string","maxLength":15}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"}},"required":["data","page","limit","total","has_more"],"additionalProperties":false}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations":{"get":{"operationId":"listConversations","tags":["Conversations"],"summary":"List conversations","description":"One conversation per contact and number, most recent activity first.","x-scope":"messages:read","security":[{"bearerAuth":["messages:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–100)","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","pending","snoozed","closed"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"}},"required":["data","page","limit","total","has_more"],"additionalProperties":false}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{id}/messages":{"get":{"operationId":"listConversationMessages","tags":["Conversations"],"summary":"List messages in a conversation","description":"Newest first.","x-scope":"messages:read","security":[{"bearerAuth":["messages:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource id","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number, from 1","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–100)","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"}},"required":["data","page","limit","total","has_more"],"additionalProperties":false}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/broadcasts":{"post":{"operationId":"createBroadcast","tags":["Broadcasts"],"summary":"Create a broadcast","description":"Sends an approved template to many contacts. Opted-out contacts are skipped when the audience is resolved. Sends go through the platform's rate-limited broadcast queue (20 messages per second by default), and Meta's own per-number messaging limit still applies. Variables may use {{name}} and {{phone}}, filled per contact.","x-scope":"broadcasts:write","security":[{"bearerAuth":["broadcasts:write"]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name as approved by Meta"},"language":{"type":"string","minLength":2,"maxLength":15,"description":"Template language code, e.g. en or en_US"},"variables":{"default":[],"description":"Values for {{1}}, {{2}}… in order","maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":1024}},"header_media_url":{"description":"Public https link for an IMAGE, VIDEO or DOCUMENT header","type":"string","format":"uri"}},"required":["name","language"]},"audience":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"]},{"type":"object","properties":{"tag":{"type":"string","minLength":1,"maxLength":40}},"required":["tag"]},{"type":"object","properties":{"contact_ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["contact_ids"]}],"description":"Exactly one of: { all: true }, { tag }, or { contact_ids }"}},"required":["template","audience"]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"No connected number, template not approved, or no matching contacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/broadcasts/{id}":{"get":{"operationId":"getBroadcast","tags":["Broadcasts"],"summary":"Get a broadcast","description":"Includes per-status recipient counts.","x-scope":"broadcasts:write","security":[{"bearerAuth":["broadcasts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource id","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the required scope, the workspace is suspended, or its plan doesn't include the API (plan_upgrade_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"message.received":{"post":{"summary":"message.received","description":"Signed with HMAC-SHA256; see the X-BlazeChats-Signature header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"message.received"},"created_at":{"type":"string"},"workspace_id":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds"}}}},"message.status":{"post":{"summary":"message.status","description":"Signed with HMAC-SHA256; see the X-BlazeChats-Signature header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"message.status"},"created_at":{"type":"string"},"workspace_id":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds"}}}},"order.created":{"post":{"summary":"order.created","description":"Signed with HMAC-SHA256; see the X-BlazeChats-Signature header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.created"},"created_at":{"type":"string"},"workspace_id":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds"}}}},"order.updated":{"post":{"summary":"order.updated","description":"Signed with HMAC-SHA256; see the X-BlazeChats-Signature header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.updated"},"created_at":{"type":"string"},"workspace_id":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds"}}}},"cart.abandoned":{"post":{"summary":"cart.abandoned","description":"Signed with HMAC-SHA256; see the X-BlazeChats-Signature header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"cart.abandoned"},"created_at":{"type":"string"},"workspace_id":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds"}}}},"call.ended":{"post":{"summary":"call.ended","description":"Signed with HMAC-SHA256; see the X-BlazeChats-Signature header.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"call.ended"},"created_at":{"type":"string"},"workspace_id":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"bc_live_…","description":"Scopes: contacts:read (Read contacts), contacts:write (Create and update contacts), messages:read (Read conversations and messages), messages:send (Send messages), templates:read (Read templates), broadcasts:write (Create and read broadcasts)"}},"schemas":{"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"direction":{"type":"string","enum":["in","out"]},"type":{"type":"string","description":"text, template, image, video, audio, document, sticker, location, interactive, button, reaction…"},"text":{"description":"Text body or media caption","type":["string","null"]},"template":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"language":{"type":"string"}},"required":["name","language"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"mime":{"type":"string"},"filename":{"type":"string"},"caption":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["queued","sent","delivered","read","failed","received"]},{"type":"string"}]},"error":{"type":["string","null"]},"wa_message_id":{"description":"Meta's message id (wamid), once sent","type":["string","null"]},"broadcast_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sent_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"read_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"}},"required":["id","conversation_id","contact_id","direction","type","text","template","media","status","error","wa_message_id","broadcast_id","sent_at","delivered_at","read_at","created_at"],"additionalProperties":false},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phone":{"type":"string","description":"WhatsApp ID: international number without '+', e.g. 919876543210"},"name":{"type":["string","null"]},"profile_name":{"description":"Name from the customer's WhatsApp profile","type":["string","null"]},"email":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"opted_out":{"type":"boolean","description":"True after the contact replied STOP, or when set by you. Opted-out contacts never receive templates or broadcasts."},"source":{"type":"string","description":"whatsapp, manual, csv or api"},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"}},"required":["id","phone","name","profile_name","email","tags","attributes","opted_out","source","last_inbound_at","created_at"],"additionalProperties":false},"Template":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"language":{"type":"string"},"category":{"description":"MARKETING, UTILITY or AUTHENTICATION","type":["string","null"]},"status":{"type":"string","description":"APPROVED, PENDING, REJECTED, PAUSED or DISABLED"},"body":{"type":"string","description":"Body text with {{1}}, {{2}} placeholders"},"variables":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of body placeholders to fill when sending"},"header_format":{"description":"TEXT, IMAGE, VIDEO or DOCUMENT when the template has a header","type":["string","null"]},"rejected_reason":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"}},"required":["id","name","language","category","status","body","variables","header_format","rejected_reason","updated_at"],"additionalProperties":false},"Conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"anyOf":[{"type":"string","enum":["open","closed"]},{"type":"string"}]},"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"preview":{"type":["string","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"window_open":{"type":"boolean","description":"True while free-form replies are allowed (24 hours after the customer's last message)"},"contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phone":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","phone","name"],"additionalProperties":false}},"required":["id","status","unread","preview","last_message_at","last_inbound_at","window_open","contact"],"additionalProperties":false},"Broadcast":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"template":{"type":"object","properties":{"name":{"type":"string"},"language":{"type":"string"}},"required":["name","language"],"additionalProperties":false},"status":{"type":"string","description":"queued, sending, completed or cancelled"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stats":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pending","sent","delivered","read","failed","skipped"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},"started_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp (UTC)"},{"type":"null"}]}},"required":["id","name","template","status","total","stats","created_at","started_at","completed_at"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code"},"message":{"type":"string","description":"Human-readable explanation"},"details":{"description":"Per-field problems for validation_error","type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}