Braze provides a high-performance REST API to allow you to track users, send messages, export data, and more. This reference article covers what a REST API is, the terminology, a brief overview of API keys, and API limits.
What is a REST API?
A REST API is a way to programmatically transfer information over the web using a predefined schema. Braze has created many different endpoints which perform various actions and/or return various data.
Customers using Braze’s EU database should use
https://rest.fra-01.braze.eu/. For more information on REST API endpoints for customers using Braze’s EU database see our EU/US Implementation Differences documentation.
Below is some terminology that you may see in the Braze REST API documentation and what it means.
Braze manages a number of different instances for our Dashboard and REST Endpoints. When your account is provisioned you will log in to one of the corresponding URLs below. Use the correct REST Endpoint based on which instance you are provisioned to. If you are unsure, open a support ticket or use the table below to match the URL of the dashboard you use to the correct REST Endpoint.
|Instance||URL||REST Endpoint||SDK Endpoint|
When using endpoints for API calls, use the “REST Endpoint” located on this page.
For SDK integration, use the “SDK Endpoint”, not the “REST Endpoint”.
Company Secret Explanation
company_secret was formerly included with all API requests but has been deprecated as of October 2014. This field will be ignored for all future API requests to ensure backward compatibility.
App Group REST API Keys
api_key included in each request acts as an authentication key that allows your server code to utilize our REST APIs. Within your company, each app group will have a unique set of REST API Keys. They can be found within the Braze dashboard by navigating to the Developer Console section for each app group. To use the REST API for any given App Group, you must create keys and give them permissions.
API Key Permissions
API Keys are used to authenticate an API call. When you create a new REST API Key, you need to give it access to specific endpoints. By assigning specific permissions to an API Key, you can limit exactly which calls an API Key can authenticate.
A good security practice is to assign a user only as much access as is necessary to complete his or her job: this principle can also be applied to API Keys by assigning permissions to each key. These permissions give you better security and control over the different areas of your account.
Given that REST API Keys allow access to potentially sensitive REST API endpoints, please ensure they are stored and used securely. For example, do not use this key to make AJAX calls from your website or expose it in any other public manner.
API IP Whitelisting
For additional security, you can specify a whitelist of IP addresses and subnets which are allowed to make REST API requests for a given REST API Key. To whitelist specific IP addresses or subnets, add them to the API IP Whitelisting section when creating a new REST API Key:
Creating and Managing REST API Keys
To create a new REST API Key, visit the Developer Console on your Braze Dashboard. This page displays your existing API Keys. To create a new key, click the “Create New API Key” button.
You will then be able to:
- Give your new key a name for easy identification
- Select which permissions you would like to be associated with your new key
- Specify whitelisted IP addresses and subnets for the new key
Existing REST API Keys can be Viewed or Deleted by clicking the gear icon and selecting the corresponding option.
Keep in mind that once you create a new API Key, you cannot edit the scope of permissions or the whitelisted IPs. This limitation is in place for security reasons. If you need to change the scope of a key, create a new key with the updated permissions and implement that key in place of the old one. Once you’ve completed your implementation, go ahead and delete the old key.
External User ID Explanation
external_id serves as a unique user identifier for whom you are submitting data. This identifier should be the same as the one you set in the Braze SDK in order to avoid creating multiple profiles for the same user.
Braze User ID Explanation
braze_id serves as a unique user identifier that is set by Braze. This identifier can be used to delete users through the REST API in addition to external_ids.
For more information see:
The Braze API infrastructure is designed to handle high volumes of data across our customer base. We enforce API rate limits in order to ensure responsible use of the API. All messages should follow UTF-8 encoding.
|Default API Rate Limit||Value|
|Requests to the
||User Track has a base speed limit of 50,000 requests per minute for customers who start with Braze after June 2, 2020. These limits are subject to change and can be increased upon request. Please reach out to your Customer Success Manager for more information.|
|Batching with the
||75 Events, 75 Purchases, and 75 Attributes per API request.|
|Requests to the Send endpoint specifying a Segment or Connected Audience||250 per minute.|
|Send Identifier Creation||100 per day.|
|Requests of any other kind||250,000 per hour.|
API Rate Limits and their Values (limited or unlimited) are subject to change depending on the proper usage of our system. We encourage sensible limits when making an API call to prevent damage or misuse.
REST API rate limit increases are considered based on need for customers who are making use of the API batching capabilities. Please batch requests to our API endpoints:
/users/trackrequest can contain up to 75 Purchases, 75 Events, and 75 Attribute updates. These can belong to different users, that is, each of the 75 Events in a request can belong to 75 different users.
- A single request to the Messaging endpoints can reach any one of the following:
- Up to 50 specific
external_ids, each with individual message parameters
- A segment of any size created in the Braze dashboard, specified by its
- An ad-hoc audience segment of any size, defined in the request as a Connected Audience object
- Up to 50 specific
The response headers for any valid request include the current rate limit status:
||The maximum number of requests that the consumer is permitted to make per hour.|
||The number of requests remaining in the current rate limit window.|
||The time at which the current rate limit window resets in UTC epoch seconds.|
If you have questions about API limits please contact your Customer Success Manager or please open a support ticket.
Optimal Delay Between Endpoints
Understanding Optimal Delay between endpoints is crucial when making consecutive calls to the Braze API. Problems arise when endpoints depend on the successful processing of other endpoints, and if called too soon, could raise errors. For example, if you’re assigning users an alias via our New User Alias endpoint, and then hitting that alias to send a custom event via our Usertrack endpoint, how long should you wait?
Under normal conditions, the time for our data eventual-consistency to occur is 10-100 ms (1/10 of a second). However, there can be some cases where it takes longer for that consistency to occur. Therefore, we recommend that customers allow a 5 minute delay between making subsequent calls to minimize the probability of error.