Skip to main content
POST

Authorizations

X-API-Key
string
header
required

Body

application/json

Set type, then choose the matching message schema branch below. Each branch shows the common fields plus the matching content field required for that message type. At least one of to or recipient is required. If both are provided, to takes precedence and recipient is ignored.

from
string
required

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

Example:

"+16315551111"

type
enum<string>
required

Must be template for this request body variant.

Available options:
template
Example:

"template"

template
object
required

The WhatsApp template message object containing the template name, language, and optional component parameters for variable substitution in the template.

to
string

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

Example:

"+16315551111"

recipient
string

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

Example:

"US.1234"

customerProfile
object

The recipient's profile information. Used to persist WhatsApp username in username-only or BSUID send scenarios.

context
object

Used to mention a specific message you are replying to. The reply can be any message type.

externalId
string

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
enum<string>

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.

Available options:
utility,
authentication
Example:

"utility"

ttlSeconds
integer

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). An explicit value overrides the template TTL. If omitted, YCloud inherits a positive template TTL up to 43200 seconds; otherwise, Meta uses its default TTL. An inherited value below 30 seconds fails validation.

Required range: 30 <= x <= 43200
Example:

600

useDirectSend
boolean
default:false

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

Set this to true to send the message through Direct Send. Utility Direct Send is in public beta; no allowlist or access application is required. See Utility 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
templateName
string

Optional. Business-defined template name for a Utility Direct Send message submitted through synchronous POST /v2/whatsapp/messages/sendDirectly or asynchronous POST /v2/whatsapp/messages. The value is case-sensitive and may contain only lowercase letters, digits, and underscores. It does not enable Direct Send by itself. When Direct Send is not selected, this field is ignored. The name must not already be used by a non-Direct-Send template in the sender WABA. A conflict is rejected before the synchronous provider call or asynchronous acceptance, so an asynchronous conflict does not return a message ID. This field is not supported for Authentication Direct Send.

Example:

"order_update_ds"

filterUnsubscribed
boolean

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.

filterBlocked
boolean

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.

WhatsApp outbound message object.

id
string
required

Unique ID of the message.

wabaId
string
required

WhatsApp Business Account ID.

Example:

"whatsapp-business-account-id"

from
string
required

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

Example:

"+16315551111"

wamid
string

The original message ID on WhatsApp's platform.

Example:

"wamid.BgNODYxN..."

to
string

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

Example:

"+16315551111"

recipient
string

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

Example:

"US.1234"

recipientUserId
string

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

Example:

"US.1234"

toUserId
string

Alias of recipientUserId kept for compatibility.

Example:

"US.1234"

parentRecipientUserId
string

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

Example:

"US.ENT.1234"

toParentUserId
string

Alias of parentRecipientUserId kept for compatibility.

Example:

"US.ENT.1234"

customerProfile
object

The recipient's profile information, including WhatsApp username when available.

conversation
object

WhatsApp defines a conversation as a 24-hour session of messaging between a person and a business. This field is present after the message status changes to sent. See also Conversation-Based Pricing.

type
enum<string>

WhatsApp outbound message type. See also WhatsApp messages.

Available options:
template,
text,
image,
audio,
video,
document,
sticker,
location,
interactive,
contacts,
reaction
template
object

Use for sending a WhatsApp template message.

text
object

WhatsApp Message Text Object.

image
object

Use for image, gif, video, audio, document, or sticker messages. See also Supported Media Types.

Note: Either id or link must be provided, but not both. These parameters are mutually exclusive.

Reference: WhatsApp Cloud API Media Object

video
object

Use for image, gif, video, audio, document, or sticker messages. See also Supported Media Types.

Note: Either id or link must be provided, but not both. These parameters are mutually exclusive.

Reference: WhatsApp Cloud API Media Object

audio
object

Use for image, gif, video, audio, document, or sticker messages. See also Supported Media Types.

Note: Either id or link must be provided, but not both. These parameters are mutually exclusive.

Reference: WhatsApp Cloud API Media Object

document
object

Use for image, gif, video, audio, document, or sticker messages. See also Supported Media Types.

Note: Either id or link must be provided, but not both. These parameters are mutually exclusive.

Reference: WhatsApp Cloud API Media Object

sticker
object

Use for image, gif, video, audio, document, or sticker messages. See also Supported Media Types.

Note: Either id or link must be provided, but not both. These parameters are mutually exclusive.

Reference: WhatsApp Cloud API Media Object

location
object

Use for location messages.

interactive
object

Use for interactive messages.

contacts
object[]
reaction
object

When a user reacts to messages with an emoji, the message type is set to reaction, and this field is included.

context
object

Used to mention a specific message you are replying to. The reply can be any message type.

externalId
string

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
string

The Direct Send category, such as utility or authentication, when applicable.

Example:

"utility"

ttlSeconds
integer

The configured Direct Send message lifetime in seconds, when applicable.

Example:

600

status
enum<string>

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.
Available options:
accepted,
failed,
sent,
delivered,
read
errorCode
string

Error code when the message status is failed.

Example:

"INTERNAL_SERVER_ERROR"

errorMessage
string

Error message when the message status is failed.

createTime
string<date-time>

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

Example:

"2022-06-01T12:00:00.000Z"

updateTime
string<date-time>

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

Example:

"2022-06-01T12:00:00.000Z"

sendTime
string<date-time>

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

Example:

"2022-06-01T12:00:00.000Z"

deliverTime
string<date-time>

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

Example:

"2022-06-01T12:00:00.000Z"

readTime
string<date-time>

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

Example:

"2022-06-01T12:00:00.000Z"

totalPrice
number<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.

Example:

0.05

currency
string

Price currency. ISO 4217 currency code.

Example:

"USD"

regionCode
string

The region code of the recipient phone number.

Example:

"US"

pricingCategory
enum<string>

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

Available options:
referral_conversion,
authentication,
authentication_international,
marketing,
marketing_lite,
utility,
service
pricingModel
enum<string>

The pricing model of the message.

  • PMP: Per-message pricing applies.
  • CBP: Conversation-based pricing applies.
Available options:
PMP,
CBP
pricingType
enum<string>

The pricing type of the message. 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.
Available options:
regular,
free_customer_service,
free_entry_point
whatsappApiError
object

The original error object returned by WhatsApp. See Handling Errors, Cloud API Error Codes.

bizType
string

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.
Example:

"whatsapp"

verificationId
string

The verification ID. Included only when bizType is verify.

Example:

"VERIFICATION-ID"