curl --request PUT \
--url https://api.wsapi.chat/newsletters/{id}/subscription \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"subscribed": true
}
'{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 403,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Newsletters
Subscribe or unsubscribe from a newsletter
Set the subscription state for a newsletter. Set subscribed to true to follow/subscribe, or false to unfollow/unsubscribe.
PUT
/
newsletters
/
{id}
/
subscription
curl --request PUT \
--url https://api.wsapi.chat/newsletters/{id}/subscription \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"subscribed": true
}
'{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 403,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
Instance or customer-level API key. Either the instance's own API key or the customer's API key is accepted. Must be paired with the X-Instance-Id header to identify the target instance.
Headers
The ID of the WhatsApp instance to use
Path Parameters
Newsletter JID
Body
application/json
True to subscribe, false to unsubscribe
Response
Subscription state updated
⌘I