Skip to content
Check out our new developer portal and join the Braze developer community!

Update user’s subscription group status

post

/v2/subscription/status/set

Use this endpoint to batch update the subscription state of up to 50 users on the Braze dashboard. You can access a subscription group’s subscription_group_id by navigating to the Subscriptions Group page.

Request body

1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
8
9
10
11
{
  "subscription_groups":[
    {
      "subscription_group_id": (required, string),
      "subscription_state": (required, string)
      "external_ids": (required*, array of strings),
      "emails": (required*, array of strings),
      "phones": (required*, array of strings in E.164 format),
    }
  ]
}

Request parameters

Parameter Required Data Type Description
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_ids Required* Array of strings The external_id of the user or users, may include up to 50 ids.
emails Required* String or array of strings The email address of the user, can be passed as an array of strings. Must include at least one email address (with a max of 50).

If multiple users (external_id) in the same app group share the same email address, all users that share the email address are updated with the subscription group changes.
phones Required* String in E.164 format The phone numbers of the user, can be passed as an array of strings. Must include at least one phone number (with a max of 50).

Example request for email and SMS

The following example uses external_id to make one API call for email and SMS.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --location --request POST 'https://rest.iad-01.braze.com/v2/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_groups":[
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "external_ids":["example-user","[email protected]"]
    },
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "external_ids":["example-user","[email protected]"]
    }
  ]
}

Example request email

1
2
3
4
5
6
7
8
9
10
11
12
curl --location --request POST 'https://rest.iad-01.braze.com/v2/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_groups":[
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "emails":["[email protected]","[email protected]"]
    }
  ]
}

Example request SMS

1
2
3
4
5
6
7
8
9
10
11
12
curl --location --request POST 'https://rest.iad-01.braze.com/v2/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_groups":[
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "phones":["+12223334444","+15556667777"]
    }
  ]
}
WAS THIS PAGE HELPFUL?
New Stuff!