API usage alerts
API usage alerts provide critical visibility into your API usage, allowing you to proactively detect unexpected traffic. By setting up these alerts to track key API request volumes, you can receive real-time notifications and address problems before they impact your marketing campaigns.
About API usage alerts
You can use API usage alerts to monitor request volumes for the following categories:
API Category | Details |
---|---|
REST API Endpoints | Tracks usage of all REST API calls made to Braze’s backend, such as sending messages, creating campaigns, or exporting users. |
SDK API Requests | Tracks API requests made from Braze SDKs in client apps, such as triggering in-app messages or syncing user data. *Only available to customers who have purchased Monthly Active Users – CY 24–25. |
Creating an API usage alert
To create an API usage alert:
- Go to Settings > APIs and Identifiers > API Usage Alerts, then create a new alert.
- Enter a name for your alert and choose the REST API endpoints and API keys you’d like to be alerted for.
- Define your alert criteria by choosing one or more response codes and specifying the alert thresholds.
- When you’re finished, toggle Alert enabled.
Alert thresholds
When you define your alert criteria you can adjust the following thresholds:
Field | Description |
---|---|
Threshold condition |
Defines the conditions leading up to the threshold volume that you’d like to be alerted on. The following are supported:
|
Threshold volume | Used in conjunction with threshold condition. |
Within | The time window for alert evaluation. |
Setting up alert notifications
You can set up an email alert, a webhook alert or both. Webhook alerts can be very useful for use cases such as sending an alert to external platforms, such as a Slack channel. For an example, see our documentation on integrating alerts with Slack for our notification preferences.
Sample payload
The following is a sample payload for the body of an API Usage Alert webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"data": {
"alert_name": "My First API Usage Alert",
"alert_type": "API Usage Alert",
"alert_criteria": [
"response_codes": ["201", "202", "203"],
"threshold_condition: "Increased by %",
"threshold_volume": 50,
"within": "1 day"
],
"timeframe_start": 2025-03-20T15:35:00Z,
"timeframe_end": 2025-03-20T16:35:00Z,
"volume": 1500,
"previous_timeframe_start": 2025-03-20T14:35:00Z,
"previous_timeframe_end": 2025-03-20T15:35:00Z,
"previous_volume": 1000
},
"text": "Your My First API Usage Alert alert has triggered. You can view your alert and usage here: <link>. Note that this alert will reset in 1 day, as each alert will only send one notification per 8 hours."
}
Example alerts
Here are some ways to set up your API usage alert configurations to be notified in the following scenarios.
You can set up alerts to monitor the general health of your API. For example, you can set up these alerts when API errors increase drastically, such as 20% from the previous hour.
Endpoint | API key | Response code | Threshold condition | Threshold volume | Within |
---|---|---|---|---|---|
All endpoints | All API keys | 4XX and 5XX |
Increased by 10% | 10 | 1 hour |
Be alerted when your workspace reaches its rate limit for /users/track
endpoint. You can also apply this configuration for other Braze endpoints.
Endpoint | API key | Response code | Threshold condition | Threshold volume | Within |
---|---|---|---|---|---|
/users/track |
All API keys | 429 |
Greater than or equal to | 100 | 1 hour |
This alert configuration notifies you when errors occur for API triggered campaigns and Canvases, some of which may be high-priority.
Endpoint | API key | Response code | Threshold condition | Threshold volume | Within |
---|---|---|---|---|---|
|
All API keys | 4XX and 5XX |
Greated than or equal to | 1 | 1 hour |
Use the following alert configuration to be alerted when a partner integration stops sending data to Braze.
Endpoint | API key | Response code | Threshold condition | Threshold volume | Within |
---|---|---|---|---|---|
All endpoints | The API key used for your partner integration | All response codes | Less than or equal to | 0 | 1 day |
Considerations
- Each active alert will only send an email or webhook notification once every 8 hours. This is to prevent too many notifications from a single alert. If your alert is notifying you prematurely, consider editing the alert criteria to better match your use case.
- You can have up to 10 alerts per workspace.