Change User’s Email Subscription Status
This endpoint allows you to set the email subscription state for your users. Users can be opted_in
, unsubscribed
, or subscribed
(not specifically opted in or out).
You can set the email subscription state for an email address that is not yet associated with any of your users within Braze. When that email address is subsequently associated with a user, the email subscription state that you uploaded will be automatically set.
Looking for the api_key
parameter?
As of May 2020, Braze has changed how we read API keys to be more secure. Now API keys must be passed as a request header, please see YOUR_REST_API_KEY
within the Example Request below.
Braze will continue to support the api_key
being passed through the request body and URL parameters, but will eventually be sunset. Please update your API calls accordingly.
Request Body
1
2
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
1
2
3
4
{
"email": "example@123.com",
"subscription_state": "subscribed"
}
Request Parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
email |
Yes | String or Array | String email address to modify, or an Array of up to 50 email addresses to modify. |
subscription_state |
Yes | String | Either “subscribed”, “unsubscribed”, or “opted_in”. |
Example Request
1
2
3
4
5
6
7
curl --location --request POST 'https://rest.iad-01.braze.com/email/status' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
"email": "example@123.com",
"subscription_state": "subscribed"
}'