v1

latestOpenAPI 3.0.02026-07-2491237338.9 KB
WhatsApp Messages

Enqueue a message

Enqueues an outbound WhatsApp message for sending.

Queued messages will be submitted to the WhatsApp Business API asynchronously.

For WhatsApp template messages, the referenced template must be in APPROVED status. ARCHIVED templates cannot be sent.

post/whatsapp/messages

Request body

fromstring required

The sender's phone number in E.164 format.

tostring

The recipient's phone number in E.164 format. Required when recipient is not provided.

recipientstring

The recipient's WhatsApp Business-scoped user ID (BSUID) or parent BSUID. Required when to is not provided.

type'template' | 'text' | 'image' | 'audio' | 'video' | 'document' | 'sticker' | 'location' | 'interactive' | 'contacts' | 'reaction' required

WhatsApp outbound message type. See also WhatsApp messages.

externalIdstring

A unique (recommended) string to reference the object. This can be an order number or similar, and can be used to reconcile the object with your internal systems.

category'utility' | 'authentication'

Optional. Indicates the category of the message to be sent with Direct Send. Supported values are utility and authentication.

Use utility for business-initiated utility messages. Messages sent with utility are charged at utility rates.

Use authentication for business-initiated authentication messages. Messages sent with authentication are charged at authentication rates. Authentication Direct Send only supports text messages.

ttlSecondsinteger

Optional. Message time-to-live in seconds for Direct Send utility or authentication messages.

The supported range is 30 seconds to 43200 seconds (12 hours). If omitted, the default Direct Send TTL is used.

useDirectSendboolean

Optional. Whether to send the message through Direct Send. Defaults to false.

Set this to true to send the message through Direct Send when the sender WABA is enabled for Direct Send.

For template messages, the template must be convertible to a Direct Send message type. Supported Direct Send message types for template conversion are:

  • Text messages
  • Interactive Call-to-Action URL button messages
  • Interactive reply button messages
filterUnsubscribedboolean

Optional. If set to true, the message will not be sent to users who have unsubscribed from your account. Defaults to false.

Only use for POST /v2/whatsapp/messages. If the user has unsubscribed, we will push webhook notifications with whatsappMessage.errorCode set to RECIPIENT_UNSUBSCRIBED.

Not applicable to POST /v2/whatsapp/messages/sendDirectly.

filterBlockedboolean

Optional. If set to true, the message will not be sent to users in your block list. Defaults to false.

Only use for POST /v2/whatsapp/messages. If the user is in your block list, we will push webhook notifications with whatsappMessage.errorCode set to RECIPIENT_IN_BLOCK_LIST.

Not applicable to POST /v2/whatsapp/messages/sendDirectly.

Response

The request is successfully accepted.

idstring required

Unique ID of the message.

wamidstring

The original message ID on WhatsApp's platform.

wabaIdstring required

WhatsApp Business Account ID.

fromstring required

The sender's phone number in E.164 format.

tostring

The recipient's phone number in E.164 format.

recipientstring

The recipient value submitted in the request when a BSUID or parent BSUID was used.

recipientUserIdstring

The recipient's WhatsApp Business-scoped user ID (BSUID).

toUserIdstring

Alias of recipientUserId kept for compatibility.

parentRecipientUserIdstring

The recipient's parent WhatsApp Business-scoped user ID.

toParentUserIdstring

Alias of parentRecipientUserId kept for compatibility.

type'template' | 'text' | 'image' | 'audio' | 'video' | 'document' | 'sticker' | 'location' | 'interactive' | 'contacts' | 'reaction'

WhatsApp outbound message type. See also WhatsApp messages.

externalIdstring

A unique (recommended) string to reference the object. This can be an order number or similar, and can be used to reconcile the object with your internal systems.

status'accepted' | 'failed' | 'sent' | 'delivered' | 'read'

WhatsApp message status. One of accepted, failed, sent, delivered, read.

  • accepted: The messaging request is accepted by our system.
  • failed: A message sent by your business failed to send.
  • sent: A message sent by your business is in transit within WhatsApp's systems.
  • delivered: A message sent by your business was delivered to the user's device.
  • read: A message sent by your business was read by the user.
errorCodestring

Error code when the message status is failed.

errorMessagestring

Error message when the message status is failed.

createTimestring date-time

The time at which this message is created, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

updateTimestring date-time

The time at which this message is updated, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

sendTimestring date-time

The time at which this message status changed to sent, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

deliverTimestring date-time

The time at which this message status changed to delivered, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

readTimestring date-time

The time at which this message status changed to read, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

totalPricenumber double

Total price of this message. Note: It's only an estimated price when the status is accepted or sent. It becomes the final price after the message is delivered, i.e., the status is delivered or read.

currencystring

Price currency. ISO 4217 currency code.

regionCodestring

The region code of the recipient phone number.

pricingCategory'referral_conversion' | 'authentication' | 'authentication_international' | 'marketing' | 'marketing_lite' | 'utility' | 'service'

WhatsApp pricing category.

  • referral_conversion: Indicates a free entry point conversation.
  • authentication: Indicates the conversation was billed at authentication rate.
  • authentication_international: Indicates the conversation was conversation was billed at the authentication-international rate.
  • marketing: Indicates the conversation was billed at authentication rate.
  • marketing_lite: Indicates the conversation was billed at marketing-lite rate.
  • utility: Indicates the conversation was billed at utility rate.
  • service: Indicates the conversation was billed at service rate.

See also Conversation-Based Pricing.

pricingModel'PMP' | 'CBP'

WhatsApp pricing model.

  • PMP: Per-message pricing applies.
  • CBP: Conversation-based pricing applies.
pricingType'regular' | 'free_customer_service' | 'free_entry_point'

WhatsApp pricing type. This field is only available in PMP (Per-Message Pricing) mode.

  • regular: Indicates the message is billable.
  • free_customer_service: Indicates the message is free because it was either a utility template message or non-template message sent within a customer service window.
  • free_entry_point: Indicates the message is free because it is part of a free-entry point conversation.
bizTypestring

This can be either empty or one of whatsapp, or verify. Defaults to whatsapp.

  • whatsapp: Indicates that the message is sent via the WhatsApp product.
  • verify: Indicates that the message is sent via the Verify product.
verificationIdstring

The verification ID. Included only when bizType is verify.