Integrating Braze API for Smarter Campaign Automation

Braze API campaign automation lets your own systems decide when a message goes out and to whom, while the content stays in the Braze dashboard. You trigger an existing campaign or Canvas with an API call, pass personalisation values in the request, and let Braze handle delivery. The design work sits in key permissions, recipient handling, rate limits and retries.

Key Takeaways

  • Your system decides the timing and the recipients, and the message content stays in the Braze dashboard.
  • A key's permissions and allowlisted IPs can't be edited after creation, so scope one key per integration before you build.
  • Put the email attribute in the same call as the trigger, because a profile with no email address at the time of the call is retried for up to approximately 2 hours.
  • Keep broadcast in its own code path, because setting it to true by accident may reach a larger-than-expected audience.
  • Broadcast calls are limited to 250 requests per minute across all audiences and 10 per minute per unique audience, and a 429 response tells you when to resume.
  • Braze can't replay calls that failed during an outage, so your own system needs a durable record of what it tried to send.

What does Braze API campaign automation actually do?

API-triggered delivery splits a send into two jobs. The Braze dashboard holds the message content, and your API call decides the timing and the recipients (Braze docs). Marketers keep control of copy and design, and engineers keep control of the moment a send happens.

That split suits events that live outside Braze, such as an order confirmed in a commerce system or a booking changed in a back office. Your system already knows the event happened. The API call tells Braze to act on it.

To send with the campaign endpoint, you need a campaign ID created when you build an API-triggered campaign. For a Canvas, you need a Canvas ID created when you build a Canvas. Build the campaign or Canvas first, then wire up the call.

Which API key permissions does the integration need?

Braze authenticates REST API requests using the REST API key passed as a Bearer token in the Authorization request header. Each permission you assign limits exactly which calls the key can authenticate. That makes the key your first design decision, because it sets how much a leaked credential can do.

The two permissions that matter for triggered sends are listed below.

PermissionEndpointWhat it does
campaigns.trigger.send/campaigns/trigger/sendTrigger the sending of an existing campaign
canvas.trigger.send/canvas/trigger/sendTrigger the sending of an existing Canvas

After you create a key, you can't edit its permissions or its allowlisted IPs. To change a key's scope, create a new key with the updated permissions and use it in place of the old one.

If you don't specify allowlisted IPs, requests can come from any IP address. List your sending servers when you create the key.

A REST API key must remain private. Never expose it in client-side code, public repositories or user applications. Keep it in your server's secret store and read it from an environment variable at runtime.

We recommend giving each integration its own key with only the trigger permission it uses. With one key per integration, you can revoke one system without touching the others.

How do you trigger a campaign from your own systems?

A triggered send is one call to the campaign trigger endpoint, with the campaign ID and the recipients. The example below uses stand-in values only. Replace the endpoint host with the REST endpoint for your workspace's instance, and read the key from an environment variable.

curl --location --request POST "https://YOUR_REST_ENDPOINT/campaigns/trigger/send" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer ${YOUR_API_KEY}" \
  --data-raw '{
    "campaign_id": "YOUR_CAMPAIGN_ID",
    "recipients": [
      {
        "external_user_id": "YOUR_EXTERNAL_USER_ID",
        "trigger_properties": { "product_name": "example" }
      }
    ]
  }'

Values in trigger_properties can be referenced in your message template under the api_trigger_properties namespace. They can be templated into messages, but they aren't automatically stored in the user profile by default. If a value needs to live on the profile, send it as an attribute instead.

The trigger_properties object has a maximum size limit of 50 KB. For a Canvas, use the Canvas entry properties object instead.

How should you send recipients and attributes in one call?

Each recipient takes exactly one identifier: an external user ID, a user alias or an email address. We recommend the external ID your SDK already sets, so the call reaches the profile your app created. By default, Braze sends only to existing users.

You can change that default per recipient. When send_to_existing_only is false and an attributes object is provided, Braze creates a new user if one doesn't exist. The attributes object is processed before the campaign sends, which helps minimise the risk of race conditions.

Email shows why this matters. If you trigger an email-only campaign for a profile with no email address, Braze retries the send for up to approximately 2 hours. Include the email attribute in the recipient's attributes to set the address in the same call.

Creating or updating the profile doesn't guarantee a send. The user must still match the campaign's dashboard target audience and channel send rules, for example opted in for email. We recommend your integration respects opt-in state and never tries to override it.

What does broadcast change?

A request with no recipient list needs broadcast set to true, and it then targets the entire segment configured as the campaign's target audience in the dashboard. Braze advises caution here: unintentionally setting this flag may send your message to a larger-than-expected audience.

We recommend treating that flag as its own code path. Keep the broadcast call in a separate function with a separate review, so a bug in a one-to-one trigger can't become an audience-wide send.

Batching works in the other direction. One request can include up to 50 recipients by default, or a connected audience of any size. A batched request returns a single dispatch ID for the whole set of users.

We recommend storing that dispatch ID beside your own event record, so support can trace a send back to the call that caused it.

How do rate limits shape Braze API campaign automation?

Limits depend on whether you target individuals or an audience. The figures below come from the Braze rate limit page, which says limits are subject to change, so check it again before you size a build.

Call typeLimit
Individual recipients, by external IDIncluded in the shared limit of 250,000 requests per hour
Broadcast, across all audiences250 requests per minute
Broadcast, per unique audience10 requests per minute

The hourly limit resets on the clock hour and doesn't roll. A burst at ten to the hour and another at five past count against different windows.

When a limit is hit, Braze returns a 429 status code. Endpoints subject to standard rate limiting return headers you can read in code, including X-RateLimit-Remaining for the requests left in the window.

If the response includes X-RateLimit-Retry-After, wait that many seconds. Otherwise wait until the timestamp in X-RateLimit-Reset, then resume at a lower rate.

Default limits can be increased upon request through your customer success manager, so a real volume need is a conversation to have early, before you build a workaround.

How do you handle errors and retries?

Authentication failures are the first you'll meet. A 401 means an invalid API key, and a 403 means the key doesn't have sufficient permissions. Both point at configuration, so we recommend fixing the key or the endpoint rather than retrying in a loop.

Server errors are different. Braze recommends retrying 5XX responses with exponential backoff. In an incident or outage, Braze is not able to replay REST API calls that failed during the incident window, so you must retry them.

We recommend writing a durable record of every trigger your system attempts, before you make the call. A retry job can then see exactly what is outstanding.

A 400 has documented causes you can rule out in code. The campaign endpoint returns a 400 if the campaign ID belongs to a transactional email campaign, which has its own endpoint. A body that isn't valid JSON also returns a 400, and Braze evaluates Liquid in a payload only when the body is valid JSON.

Where supported, Braze recommends passing dynamic values through trigger_properties instead of embedding Liquid directly in the payload. If the system sending the trigger needs bespoke middleware to hold that record and run the retries, our product engineering service covers bespoke middleware.

What does a worked example look like?

Take a hypothetical retailer that wants a post-purchase email sent when its order system marks an order as shipped. This is an illustration of the decisions. It is not client work and it uses no figures.

The team builds an API-triggered email campaign in the dashboard and puts the shipping details in trigger_properties. Their order system calls the campaign endpoint with the customer's external ID and the email attribute in the same recipient, so a new customer isn't held waiting for an address.

The key has the campaign trigger permission and nothing else. It's restricted to the order system's server addresses.

They also decide the order system owns the record of what was sent. It writes the dispatch ID against the order before it moves on, and a retry job reads that record after any failure. If the order system sends the same event twice, the second call is skipped because the record already exists.

The sequence we recommend is to scope the key, put the email attribute in the call, keep a durable record, and then add retries on top.

How does this connect to the rest of the programme?

API triggers are one input among several. Our guide to action-based and API-triggered automation in Braze covers when each trigger type fits, and automating complex workflows in Braze Canvas shows how to structure a send that belongs inside a longer journey.

The API call is only as good as the data behind it. Read connecting Braze to your tech stack for the data paths, and integrating CRM data into Braze for the attributes your triggers will rely on.

Audience choices matter as much as the call. Segmenting your audience in Braze explains how to define the group a broadcast reaches, and the failure modes to plan for in email automation covers what tends to go wrong once sends are live.

For an example of guided SDK and API integration work done alongside a lean internal team, see this case study on technical translation and cross-agency alignment.

As a Braze implementation partner, CustomerIK recommends starting with one triggered campaign, one narrowly scoped key and one durable send record, then adding Canvas triggers and broadcasts once that first path is stable.

Frequently Asked Questions

1. What is API-triggered delivery in Braze?

It lets you keep message content in the Braze dashboard while your own system decides when a message is sent and to whom, using an API call.

2. Which permission does a key need to trigger a campaign?

The campaigns.trigger.send permission, which covers the /campaigns/trigger/send endpoint. A Canvas trigger needs canvas.trigger.send.

3. Can I change a key's permissions after I create it?

No. You can't edit the permissions or allowlisted IPs of an existing key. Create a new key with the scope you need and use it in place of the old one.

4. How many recipients can one trigger request carry?

Up to 50 recipients by default, or a connected audience of any size. A batched request returns a single dispatch ID for the whole set of users.

5. What should I do when I receive a 429 response?

Pause requests. If the response includes X-RateLimit-Retry-After, wait that many seconds. Otherwise wait until the timestamp in X-RateLimit-Reset, then resume at a lower rate.

Sources

CustomerIK is a Braze implementation partner working across onboarding, technical integration, marketing operations and customer data management.

If your team is planning an API-triggered send and wants a second pair of eyes on key scope, retries and the send record, let's talk.

Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website.

Accept all cookies
Accept all cookies

These items are required to enable basic website functionality.

Always active

These items are used to deliver advertising that is more relevant to you and your interests.

These items allow the website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features.

These items help the website operator understand how its website performs, how visitors interact with the site, and whether there may be technical issues.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.