logo
enes

Group messages

Last update: 6 hours ago by Irais Aguirre

Integration summary

  • Base URL: https://{{url}}/whatsapp-bsp-api-endpoint-ws/services
  • Token: messaging token, in the Authorization: Bearer {{wa-msg-api-token}} header (how to generate it). To create and manage groups (admin token), see Administration โ†’ Groups.
  • Endpoints on this page:
    • POST /v1/messaging: Send a message to a group
    • POST /v1/messaging: Pin a message in a group
    • POST /v1/messaging: Unpin a message in a group

Send a message to a group

The request body is similar to a 1:1 conversation, plus the recipient_type: "group" property to indicate the recipient is a group. The supported message types for groups are: text, media (image, audio, video, document, sticker), template, and pin. Location, contacts, reaction and interactive messages are not supported for groups and return RECIPIENT_TYPE_GROUP_NOT_SUPPORTED.

Request

Send a message to a group request:

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

Headers

Send a message to a group headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationMessaging token in the format Bearer {token} (with one space). See Generate authentication token.StringRequired

Body

Send a message to a group body fields:

NameDescriptionTypeRequirements
recipient_typeRecipient type: "group" if the message is sent to a group, or "individual" for a 1:1 conversation. Default: "individual". Any other value returns INVALID_RECIPIENT_TYPE. Accepted wire keys: recipient_type (preferred) and the camelCase alias recipientType; both map to the same field.StringOptional
messaging_productMessaging product identifier. Defaults to "whatsapp" and does not need to be sent โ€” the service always forwards messaging_product: "whatsapp" to Meta. Only include it to match Meta Cloud API payloads verbatim. Accepted wire keys: messaging_product and the camelCase alias messagingProduct.StringOptional

Example

Complete Send a message to a group example:

curl --location 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
--header 'Authorization: Bearer {{wa-msg-api-token}}' \
--header 'Content-Type: application/json' \
--data '{
"from": "{{business_phone_number}}",
"to": "{{group_id}}",
"recipient_type": "group",
"type": "text",
"text": "Hello group!"
}'

Response

Send a message to a group response:

All three messaging operations (send, pin, unpin) return the same response structure as 1:1 messages: the ID of the sent message.

NameDescriptionType
idID of the sent message.String
[
{
"id": "gBGHUhVUByKUHwIJ5zf2vjzVJh-X"
}
]


Pin a message in a group

Pins a message in the group to highlight it. Only the group admin can pin or unpin messages. Up to 3 messages can be pinned at a time; if 3 are already pinned, the oldest one is automatically unpinned.

Request

Pin a message in a group request:

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

Headers

Pin a message in a group headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationMessaging token in the format Bearer {token} (with one space). See Generate authentication token.StringRequired

Body

Pin a message in a group body fields:

NameDescriptionTypeRequirements
recipient_typeRecipient type. For groups, the value must be "group".StringRequired
toID of the group where the message is pinned.StringRequired
typeMessage operation type. To pin or unpin, the value is "pin".StringRequired
pin.typeOperation to perform. To pin, the value is "pin".StringRequired
pin.message_idUnique ID of the message to pin.StringRequired
pin.expiration_daysHow long the message stays pinned, in days (numeric string, e.g. "30"). The 1โ€“30 range is Meta's limit; this API only checks that the field is present, it does not validate the range.StringRequired when pinning

Example

Complete Pin a message in a group example:

curl --location 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
--header 'Authorization: Bearer {{wa-msg-api-token}}' \
--header 'Content-Type: application/json' \
--data '{
"from": "{{business_phone_number}}",
"to": "{{group_id}}",
"recipient_type": "group",
"type": "pin",
"pin": {
"type": "pin",
"message_id": "{{pin_message_id}}",
"expiration_days": "30"
}
}'

Response

Pin a message in a group response:

All three messaging operations (send, pin, unpin) return the same response structure as 1:1 messages: the ID of the sent message.

NameDescriptionType
idID of the sent message.String
[
{
"id": "gBGHUhVUByKUHwIJ5zf2vjzVJh-X"
}
]


Unpin a message in a group

Unpins a previously pinned message. Only the group admin can unpin messages. It uses the same "pin" type, with the "unpin" operation in pin.type; unlike pinning, you don't send expiration_days.

Request

Unpin a message in a group request:

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

Headers

Unpin a message in a group headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationMessaging token in the format Bearer {token} (with one space). See Generate authentication token.StringRequired

Body

Unpin a message in a group body fields:

NameDescriptionTypeRequirements
recipient_typeRecipient type. For groups, the value must be "group".StringRequired
toID of the group where the message is unpinned.StringRequired
typeMessage operation type. To pin or unpin, the value is "pin".StringRequired
pin.typeOperation to perform. To unpin, the value is "unpin".StringRequired
pin.message_idUnique ID of the message to unpin.StringRequired

Example

Complete Unpin a message in a group example:

curl --location 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
--header 'Authorization: Bearer {{wa-msg-api-token}}' \
--header 'Content-Type: application/json' \
--data '{
"from": "{{business_phone_number}}",
"to": "{{group_id}}",
"recipient_type": "group",
"type": "pin",
"pin": {
"type": "unpin",
"message_id": "{{pin_message_id}}"
}
}'

Response

Unpin a message in a group response:

All three messaging operations (send, pin, unpin) return the same response structure as 1:1 messages: the ID of the sent message.

NameDescriptionType
idID of the sent message.String
[
{
"id": "gBGHUhVUByKUHwIJ5zf2vjzVJh-X"
}
]

Previous
Call button (voice call)
Next
Read and typing indicators