logo
enes

HTTP connection

Last update: 6 hours ago by Irais Aguirre

All non-template, template and interactive messages are sent with this endpoint. This page describes, once, the request, the headers, the common body fields and the response. The fields specific to each message type are on its own page.

Request

URLhttps://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging
MethodPOST
Typeapplication/json

Headers

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationMessaging token in the format Bearer {token} (with one space). See Generate authentication token.StringRequired
Msg-PriorityPriority of the message in the sending queue. Possible values:
  • LOW
  • MEDIUM
  • HIGH
Any other value is treated as MEDIUM.
String
  • Optional.
  • Default: MEDIUM.

Common fields

Every message includes these fields in the request body:

NameDescriptionTypeRequirements
fromPhone number (with country code) the message is sent from.StringRequired.
toPhone number (with country code) of the customer receiving the message. 7 to 20 characters; + is only allowed as the first character. Hyphens (-), parentheses ((,)), and spaces are also allowed. You can also use the user's BSUID, for example, US.13491208655302741918. The phone format check does not apply when recipient_type is group.StringRequired.
typeMessage type. Possible values:
  • text
  • image
  • audio
  • video
  • document
  • sticker
  • location
  • contacts
  • reaction
  • template
  • interactive
  • pin (only in Groups)
Each message type states the value it uses.
StringRequired.
recipient_typeRecipient type. Possible values: individual or group. See the Groups section for details.String
  • Optional.
  • Default: individual.

Marketing Messages Lite (MM Lite) fields

These fields apply only to messages sent from WABAs with Marketing Messages Lite (MM Lite) enabled. They are forwarded to Meta.

NameDescriptionTypeRequirements
categoryMessage category, for example UTILITY or MARKETING. Required for ttl_seconds and direct_send_config to take effect.StringOptional.
ttl_secondsMessage time to live in seconds. Only applied when category is set. Validated against the allowed minimum and maximum.IntegerOptional.
direct_send_config.template_nameTemplate name used for MM Lite direct send. Only applied when category is set.StringOptional.
bid_spec.per_message_bid_multiplierPer-message bid multiplier for MM Lite marketing messages.NumberOptional.

Response

HTTP status codes: 200 on success, 400 on validation errors, 401 on authentication errors, 500 on internal errors.

NameDescriptionType
idID of the sent message.String
codeResponse code if an error occurs. For details, see Error codes.Number
detailMessage describing the response code.String

Successful response example

[
{
"id": "gBGHUhVUByKUHwIJCSIVo3YWvs8i"
}
]

Error response example

{
"code": 3009,
"detail": "JWT token expired"
}
WhatsApp — Previous
Messaging
Next — WhatsApp
Non-template messages