Update Users’ Subscription Group Status

post

/subscription/status/set

Use the endpoints below to update the subscription state of a user on the Braze dashboard. You can access a subscription groups subscription_group_id by navigating to it on the Subscription Group page.

If you want to see examples or test this endpoint for Email Subscription Groups:

If you want to see examples or test this endpoint for SMS Subscription Groups:

Request Body

1
2
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
1
2
3
4
5
6
7
8
9
10
{
   "subscription_group_id": (required, string) the id of your subscription group,
   "subscription_state": (required, string) available values are “unsubscribed” (not in subscription group) or “subscribed” (in subscription group),
   "external_id": (required*, string) the external_id of the user,
   "email": (required*, string) the email address of the user
   //one of external_id or email is required
   //can be passed as an array of string with a max of 50
   //endpoint only accepts email or phone value, not both
   "phone": (optional, string in E.164 format) The phone number of the user (must include at least one phone number and at most 50 phone numbers).
 }

* SMS subscription groups: Only external_id or phone is accepted.
* Email subscription groups: Either email or external_id is required.

Request Parameters

Parameter Required Data Type Description
subscription_group_id Yes String The id of your subscription group,
subscription_state Yes String Available values are “unsubscribed” (not in subscription group) or “subscribed” (in subscription group)
external_id Yes* String The external_id of the user
email Yes* String The email address of the user
phone Optional String in E.164 format Tags must already exist.

Using Email

1
2
3
4
5
6
{
  "subscription_group_id": "pto81fff-734f-80e5-b7b2-b880562888ww",
  "subscription_state": "unsubscribed",
  "email": "your.user@email.com"
}

Using Phone Number

1
2
3
4
5
6
{
  "subscription_group_id": "pto81fff-734f-80e5-b7b2-b880562888ww",
  "subscription_state": "unsubscribed",
  "phone": "+12223334444"
}

Example Requests Email

1
2
3
4
5
6
7
8
9
10
curl --location --request POST 'https://rest.iad-01.braze.com/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "subscription_group_id": "pto81fff-734f-80e5-b7b2-b880562888ww",
  "subscription_state": "unsubscribed",
  "external_id": "user123",
  "email": "your.user@email.com"
}
'

Example Requests SMS

1
2
3
4
5
6
7
8
9
10
curl --location --request POST 'https://rest.iad-01.braze.com/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "subscription_group_id": "pto81fff-734f-80e5-b7b2-b880562888ww",
  "subscription_state": "unsubscribed",
  "external_id": "user123",
  "phone": "+12223334444"
}
'

Example Successful Response

Response: (status 201)

1
2
3
{
    "message": "success"
}
WAS THIS PAGE HELPFUL?
New Stuff!