POST /whatsapp/accounts/{id}/messages

Send a LIVE WhatsApp message to to (phone), recipient (BSUID) or the participant of conversationId. Free-form types need the person to have written within 24 hours; templates are always allowed (409 outside_messaging_window before calling Meta). 403 approval_required while approval applies. Emits message.sent; statuses follow as message.status

POST
/whatsapp/accounts/{id}/messages

Authorization

BearerAuth
headerAuthorizationBearer <token>

API key sk_...

Path Parameters

id*string

WhatsApp account id

Request Body

application/json
  1. body

Exactly one of to, recipient or conversationId

to?string

Phone number in international format

recipient?string

Business-scoped user id (BSUID)

conversationId?string

WhatsApp conversation of this account

replyTo?string

wamid of the quoted message

type*string
text*string
Lengthlength <= 4096
previewUrl?boolean

Response Body

{message, conversation}

application/json
  1. response
message?
conversation?
Example Request
curl -X POST 'https://example.com/api/v1/whatsapp/accounts/string/messages' \  -H 'Content-Type: application/json' \  -d '{  "type": "text",  "text": "string"}'
Example Response
{  "message": {    "id": "string",    "conversationId": "string",    "platformMessageId": "string",    "direction": "inbound",    "type": "text",    "text": "string",    "attachments": [      {        "type": "string",        "url": "string"      }    ],    "postback": {      "title": "string",      "payload": "string"    },    "reactions": [      {        "emoji": "string",        "by": "participant"      }    ],    "replyToMid": "string",    "isEcho": true,    "isDeleted": true,    "status": "received",    "tag": "HUMAN_AGENT",    "sentAt": "2019-08-24T14:15:22Z",    "deliveredAt": "2019-08-24T14:15:22Z",    "readAt": "2019-08-24T14:15:22Z",    "source": "webhook",    "content": null,    "pricing": null,    "error": "string",    "failedAt": "2019-08-24T14:15:22Z"  },  "conversation": {    "id": "string",    "accountId": "string",    "platform": "instagram",    "platformConversationId": "string",    "participant": {      "id": "string",      "username": "string",      "name": "string",      "pictureUrl": "string",      "phone": "string",      "userId": "string",      "parentUserId": "string"    },    "lastMessage": {      "text": "string",      "direction": "inbound",      "at": "2019-08-24T14:15:22Z"    },    "unreadCount": 0,    "lastReadAt": "2019-08-24T14:15:22Z",    "participantReadAt": "2019-08-24T14:15:22Z",    "status": "active",    "messagingWindow": {      "open": true,      "closesAt": "2019-08-24T14:15:22Z",      "humanAgentClosesAt": "2019-08-24T14:15:22Z"    },    "syncedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}