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
| URL | https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging |
| Method | POST |
| Type | application/json |
Headers
| Name | Description | Type | Requirements |
|---|---|---|---|
| Content-Type | application/json | String | Required |
| Authorization | Messaging token in the format Bearer {token} (with one space). See Generate authentication token. | String | Required |
| Msg-Priority | Priority of the message in the sending queue. Possible values:
| String |
|
Common fields
Every message includes these fields in the request body:
| Name | Description | Type | Requirements |
|---|---|---|---|
| from | Phone number (with country code) the message is sent from. | String | Required. |
| to | Phone 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. | String | Required. |
| type | Message type. Possible values:
| String | Required. |
| recipient_type | Recipient type. Possible values: individual or group. See the Groups section for details. | String |
|
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.
| Name | Description | Type | Requirements |
|---|---|---|---|
| category | Message category, for example UTILITY or MARKETING. Required for ttl_seconds and direct_send_config to take effect. | String | Optional. |
| ttl_seconds | Message time to live in seconds. Only applied when category is set. Validated against the allowed minimum and maximum. | Integer | Optional. |
| direct_send_config.template_name | Template name used for MM Lite direct send. Only applied when category is set. | String | Optional. |
| bid_spec.per_message_bid_multiplier | Per-message bid multiplier for MM Lite marketing messages. | Number | Optional. |
Response
HTTP status codes:
200on success,400on validation errors,401on authentication errors,500on internal errors.
| Name | Description | Type |
|---|---|---|
| id | ID of the sent message. | String |
| code | Response code if an error occurs. For details, see Error codes. | Number |
| detail | Message describing the response code. | String |
Successful response example
[{"id": "gBGHUhVUByKUHwIJCSIVo3YWvs8i"}]
Error response example
{"code": 3009,"detail": "JWT token expired"}
