---
openapi: 3.0.3
info:
  title: Braze REST API – Send campaign messages using API-triggered delivery
  description: |
    ## Prerequisites

    To use this endpoint, you'll need to generate an API key with the `campaigns.trigger.send` permission.

    ## Rate limit

    When you use connected audience filters in your request, this endpoint has a rate limit of 250 requests per minute. Otherwise, if you specify an `external_id`, this endpoint has a default rate limit of 250,000 requests per hour, shared between the endpoints documented in [API rate limits]({{site.baseurl}}/api/api_limits#requests-with-shared-rate-limits).

    This endpoint supports [batching API requests]({{site.baseurl}}/api/api_limits#batching-api-requests). One request can include any of the following:

    - Up to 50 `recipients` by default
    - A [connected audience]({{site.baseurl}}/api/objects_filters/connected_audience) of any size
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
- BearerAuth: []
# cspell:ignore triggerable
paths:
  "/campaigns/trigger/send":
    post:
      summary: Send campaign messages using API-triggered delivery
      description: |
        ## Recipient resolution behavior

        This section discusses how Braze picks a user profile for sending and what happens when one profile is not selected.

        A user's subscription group status can be updated using the inclusion of a `subscription_groups` parameter within the `attributes` object. For more details, refer to [User attributes object]({{site.baseurl}}/api/objects_filters/user_attributes_object/#braze-user-profile-fields).

        ### Recipient limits and profile creation

        Learn more about how recipient limits and profile creation work for this endpoint.

        - The `recipients` array may contain up to 50 objects, with each object containing a single `external_user_id` string and a `trigger_properties` object.
        - When `send_to_existing_only` is `true` (the default), Braze sends the message only to existing users.
        - When `send_to_existing_only` is `false` and an `attributes` object is provided, Braze creates a new user if one doesn't exist.
        - **Net-new profiles need `attributes` with `send_to_existing_only: false`.** Braze runs the pre-send create or update from the `attributes` object in the same recipient. If you set `send_to_existing_only` to `false` but omit `attributes` (or send an empty object), Braze does not hydrate profile data the same way, so you do not get the combined "create or update user, then send" behavior this pattern is meant for.
        - **Email and SMS addressing.** For most Email or SMS API-triggered sends to someone who is not already in Braze, include the delivery fields you need inside `attributes` (for example `email`, or the phone attributes your workspace uses for SMS). You can also set subscription group membership or subscription status there when opt-in state must change in the same call.
        - **Campaign eligibility.** After the profile exists or updates, that user must still match the campaign's dashboard target audience and channel send rules (for example opted in for email) or Braze does not send the message.
        - Setting `send_to_existing_only` to `false` is not supported for user aliases. New alias-only users can't be created through this endpoint. To send to an alias-only user, that user must already exist in Braze.

        ### Email identifier and prioritization ties

        When you identify recipients by email, Braze uses `prioritization`. Braze sends only when `prioritization` returns one profile.

        - If you use `email` as the identifier, Braze resolves the recipient using `prioritization`.
        - If `prioritization` returns a tie, Braze does not send.
        - Braze sends after the tie is broken and `prioritization` returns one profile. For example, if profile updates change one user's ordering fields, Braze sends once `prioritization` can uniquely identify a profile (see [Retry behavior and `send_to_existing_only`](#retry-behavior-and-send_to_existing_only)).
        - Braze also does not send when `prioritization` returns no profiles.

        ### Retry behavior and send_to_existing_only

        Learn what happens when `prioritization` does not return exactly one profile.

        - When `prioritization` does not return exactly one user profile, Braze retries resolution up to 40 times. This retry behavior is expected.
        - The `send_to_existing_only` setting does not change `prioritization` tie behavior. The same tie and retry behavior applies whether this setting is `true` or `false`.

        If you trigger an email-only campaign for a recipient identified by `external_user_id` or `user_alias`, and that user profile has no email address at the time of the call, Braze retries the send for up to approximately 2 hours. This covers the common pattern of creating a user and setting their email address in close succession. To send without delay, include the `email` attribute inside `recipients[].attributes` so the address is set in the same call as the trigger.

        **Note:**
        To narrow a broadcast send to a segment, include `segment_id` with `"broadcast": true`. You can't combine `segment_id` with `recipients`. `segment_id` isn't supported on the `/campaigns/trigger/schedule/create`, `/campaigns/trigger/schedule/update`, or `/campaigns/trigger/schedule/delete` endpoints. You can also narrow the send with the `audience` parameter and [Connected Audience]({{site.baseurl}}/api/objects_filters/connected_audience) filters.

        ## Recipient targeting behavior

        - Including `recipients` sends only to the listed users, and only if they're in the campaign's target segment. You can't combine `recipients` with `broadcast: true`.
        - Including `audience` sends only to users who match the connected audience filters. `audience` isn't a recipient list, so set `broadcast` to `true` when you use it without `recipients`.
        - Including `segment_id` sends only to users in the campaign's target audience who are also in that segment. It's available for broadcast sends only, so set `broadcast` to `true` and don't include `recipients`. If you include both `segment_id` and `audience`, users must match both.
        - If you don't include `recipients`, set `broadcast` to `true` to send to the campaign's entire target segment (narrowed by `segment_id` and `audience`, if provided). If `broadcast` is omitted or `false`, the request returns `Must provide recipients unless the broadcast parameter is true`.
        - Some older workspaces have `broadcast` configured as optional. In those workspaces, omitting `broadcast` (rather than setting it to `false`) without `recipients` sends to the campaign's entire target segment.

        ## Attributes object for campaigns

        Braze has a messaging object called `attributes` that lets you add, create, or update attributes and values for a user before you send them an API-triggered campaign. Using the `campaign/trigger/send` endpoint as this API call processes the user attributes object before it processes and sends the campaign. This helps minimize the risk of there being issues caused by [race conditions]({{site.baseurl}}/user_guide/messaging/ab_testing/concepts/race_conditions/).

        **Tip:**
        Looking for the Canvas version of this endpoint? Check out [Sending Canvas messages using API-triggered delivery]({{site.baseurl}}/api/endpoints/messaging/send_messages/post_send_triggered_canvases/).
      operationId: post_campaigns_trigger_send_post_send_triggered_campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendTriggeredCampaignsRequest'
            examples:
              example_request:
                summary: Send with a connected audience, recipients, and an attachment
                value:
                  campaign_id: campaign_identifier
                  send_id: send_identifier
                  trigger_properties: {}
                  broadcast: false
                  audience:
                    AND:
                      - custom_attribute:
                          custom_attribute_name: eye_color
                          comparison: equals
                          value: blue
                      - custom_attribute:
                          custom_attribute_name: favorite_foods
                          comparison: includes_value
                          value: pizza
                      - OR:
                          - custom_attribute:
                              custom_attribute_name: last_purchase_time
                              comparison: less_than_x_days_ago
                              value: 2
                          - push_subscription_status:
                              comparison: is
                              value: opted_in
                      - email_subscription_status:
                          comparison: is_not
                          value: subscribed
                      - last_used_app:
                          comparison: after
                          value: '2019-07-22T13:17:55+0000'
                  recipients:
                    - user_alias:
                        alias_name: example_name
                        alias_label: example_label
                      external_user_id: external_user_identifier
                      trigger_properties: {}
                      send_to_existing_only: true
                      attributes:
                        first_name: Alex
                  attachments:
                    - file_name: YourFileName
                      url: https://exampleurl.com/YourFileName.pdf
                      basic_auth_credential: company_basic_auth_credential_name
              external_user_id:
                summary: Send to an external user ID
                value:
                  campaign_id: campaign_identifier
                  trigger_properties:
                    product_name: shoes
                  recipients:
                    - external_user_id: external_user_identifier
                      trigger_properties:
                        product_price: 79.99
      responses:
        "201":
          description: |
            The request was accepted and the message was sent. The response includes a `dispatch_id`. No action needed.

            Message-sending endpoint responses include the message's `dispatch_id` for reference back to the dispatch of the message. The `dispatch_id` is the ID of the message dispatch, a unique ID for each transmission sent from Braze. When using this endpoint, you receive a single `dispatch_id` for an entire batched set of users. Each `dispatch_id` is a 32-character hexadecimal string. For format details and behavior by delivery type, see [Dispatch ID behavior]({{site.baseurl}}/user_guide/messaging/messaging_fundamentals/dispatch_id/).

            If the campaign is archived or paused, the response still returns `201` and includes a `notice`, and trigger requests have no effect until the campaign is unarchived or resumed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendTriggeredCampaignsResponse'
              examples:
                success:
                  summary: Message sent
                  value:
                    dispatch_id: example_dispatch_id
                    send_id: send_identifier
                    message: success
                paused:
                  summary: Campaign is paused
                  value:
                    notice: The campaign is paused. Resume the campaign to ensure trigger requests will take effect.
                    dispatch_id: example_dispatch_id
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **The `campaign_id` isn't valid:** Pass a valid `campaign_id`. Find it with the [Export campaign list endpoint]({{site.baseurl}}/api/endpoints/export/campaigns/get_campaigns/).
            - **The campaign can't be triggered by the API:** Set the campaign to **API-triggered** delivery, then retry.
            - **The campaign is a transactional email campaign:** Send transactional email campaigns with the [`/transactional/v1/campaigns/{campaign_id}/send` endpoint]({{site.baseurl}}/api/endpoints/messaging/send_messages/post_send_transactional_message/).
            - **The `recipients` array is empty:** Include at least one recipient object, or omit `recipients` and set `broadcast` to `true`.
            - **The `recipients` value is malformed:** Pass `recipients` as an array of objects that each include one user identifier. Include `prioritization` when you identify users by `email`.
            - **A `braze_id` in `recipients` isn't a valid identifier:** Pass each `braze_id` as a valid Braze user ID.
            - **A recipient's `attributes` value isn't an object:** Pass each recipient's `attributes` as an object.
            - **`send_to_existing_only` is `false` for a recipient identified by `user_alias`:** Omit `send_to_existing_only` for user aliases. To send to an alias-only user, that user must already exist in Braze.
            - **The `recipients` array exceeds the maximum allowed length:** Send fewer recipients per request (up to 50 by default).
            - **The `broadcast` value isn't a boolean:** Pass `broadcast` as `true` or `false`.
            - **`broadcast` is `true` but `recipients` were also provided:** Set `broadcast` to `true` only when sending to a segment or connected audience, without explicit recipients.
            - **No `recipients` were provided and `broadcast` isn't `true`:** Include a `recipients` array, or set `broadcast` to `true`.
            - **`attachments` was included with `broadcast` set to `true`:** Remove `attachments`, or send to explicit `recipients`.
            - **The `trigger_properties` value isn't an object:** Pass `trigger_properties` as an object.
            - **The `trigger_properties` payload is too large:** Reduce the size of `trigger_properties` below your workspace's API trigger properties limit.
            - **`segment_id` was combined with explicit recipients:** Use `segment_id` only for broadcast sends, without `recipients`.
            - **The `segment_id` isn't a valid segment identifier:** Pass the `segment_id` of a segment in this workspace as a string.
            - **The segment in `segment_id` is archived:** Use an active segment.

            If your request encounters a fatal error, refer to [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors) for the error code and description.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_campaign_id:
                  summary: The campaign_id isn't valid
                  value:
                    message: campaign_id must be a valid campaign id
                campaign_not_api_triggered:
                  summary: The campaign can't be triggered by the API
                  value:
                    message: Campaign must be triggerable by API
                transactional_campaign:
                  summary: The campaign is a transactional email campaign
                  value:
                    message: Transactional campaigns cannot be triggered through this endpoint. Use /transactional/v1/campaigns/{campaign_id}/send instead
                empty_recipients:
                  summary: The recipients array is empty
                  value:
                    message: when including recipients, there must be at least one recipient specified
                malformed_recipients:
                  summary: The recipients value is malformed
                  value:
                    message: "'recipients' must be an array of objects, each containing one of 'external_user_id', 'user_alias', 'braze_id', or 'email', and optional 'trigger_properties'. When using 'email' as an identifier, a 'prioritization' array is required."
                invalid_braze_id:
                  summary: A braze_id isn't a valid identifier
                  value:
                    message: "Invalid 'braze_id' value"
                attributes_not_object:
                  summary: A recipient's attributes value isn't an object
                  value:
                    message: "'attributes' must be a hash"
                send_to_existing_only_with_alias:
                  summary: send_to_existing_only is false for a user alias
                  value:
                    message: "'send_to_existing_only' cannot be used with user aliases"
                too_many_recipients:
                  summary: Too many recipients
                  value:
                    message: Max input length exceeded.
                broadcast_not_boolean:
                  summary: The broadcast value isn't a boolean
                  value:
                    message: Broadcast must be a boolean
                broadcast_with_recipients:
                  summary: Broadcast with explicit recipients
                  value:
                    message: Cannot send messages to recipients with the broadcast parameter set to true. Broadcast is only available when sending to a Segment or Connected Audience
                missing_recipients:
                  summary: No recipients and broadcast isn't true
                  value:
                    message: Must provide recipients unless the broadcast parameter is true
                attachments_with_broadcast:
                  summary: Attachments with broadcast
                  value:
                    message: "To use 'attachments', you cannot use 'broadcast'"
                trigger_properties_not_object:
                  summary: The trigger_properties value isn't an object
                  value:
                    message: "'trigger_properties' must be an object"
                trigger_properties_too_large:
                  summary: The trigger_properties payload is too large
                  value:
                    message: "'trigger_properties' is too large"
                segment_id_with_recipients:
                  summary: segment_id combined with recipients
                  value:
                    message: "'segment_id' cannot be combined with recipients. It is only available for broadcast sends"
                invalid_segment_id:
                  summary: The segment_id isn't valid
                  value:
                    message: Invalid segment_id
                segment_archived:
                  summary: The segment in segment_id is archived
                  value:
                    message: this segment has been archived, not sending
        "401":
          description: |
            Unauthorized. The REST API key is missing, malformed, or sent to the wrong REST endpoint. Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    message: 'Invalid API key: YOUR_REST_API_KEY'
        "403":
          description: Access denied. The REST API key doesn't have the required permission. Use a REST API key that has the `campaigns.trigger.send` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                access_denied:
                  summary: Missing permission
                  value:
                    message: Access Denied
        "429":
          description: |
            Rate limited. You exceeded the rate limit for this endpoint. Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        5XX:
          description: |
            Internal server error. An unexpected error occurred on the Braze server. Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
      description: |
        REST API keys are created in the Braze dashboard at **Settings → APIs and
        Identifiers → API Keys**. The key must include the `campaigns.trigger.send` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    UserAlias:
      title: User alias
      type: object
      required: [alias_name, alias_label]
      description: See [user alias object]({{site.baseurl}}/api/objects_filters/user_alias_object/).
      properties:
        alias_name:
          type: string
          example: example_name
        alias_label:
          type: string
          example: example_label
    CampaignRecipient:
      title: Recipient
      type: object
      description: |
        Either `external_user_id` or `user_alias` or `email` is required. Requests must specify only one.
      properties:
        user_alias:
          allOf:
            - $ref: '#/components/schemas/UserAlias'
          description: User alias of user to receive message.
        external_user_id:
          type: string
          description: External identifier of user to receive message.
          example: external_user_identifier
        braze_id:
          type: string
          description: Braze user identifier of user to receive message. Must be a valid Braze user ID.
          example: 5fbd99bac125ca40511f2cb1
        email:
          type: string
          description: Email address of user to receive message.
          example: jane.doe@example.com
        prioritization:
          type: array
          items:
            type: string
          description: Prioritization array; required when using email. See [`prioritization`]({{site.baseurl}}/api/endpoints/user_data/post_user_identify#how-it-works).
          example:
            - identified
            - most_recently_updated
        trigger_properties:
          type: object
          additionalProperties: true
          description: Personalization key-value pairs that apply to this user (these key-value pairs override any keys that conflict with the parent `trigger_properties`).
        send_to_existing_only:
          type: boolean
          default: true
          description: Defaults to true, can't be used with user aliases; if set to `false`, an attributes object must also be included.
          example: true
        attributes:
          type: object
          additionalProperties: true
          description: Fields in the attributes object create or update an attribute of that name with the given value on the specified user profile before the message is sent and existing values are overwritten.
          example:
            first_name: Alex
    Attachment:
      title: Attachment
      type: object
      required: [file_name, url]
      properties:
        file_name:
          type: string
          description: The name of the file you want to attach to your email, excluding the extension (for example, ".pdf"). Attach files up to 2 MB. This is required if you use `attachments`.
          example: YourFileName
        url:
          type: string
          description: The corresponding URL of the file you want to attach to your email. The file name's extension is detected automatically from the URL defined, which should return the appropriate `Content-Type` as a response header. This is required if you use `attachments`.
          example: https://exampleurl.com/YourFileName.pdf
        basic_auth_credential:
          type: string
          description: The name of the stored basic authentication credential to use when the attachment URL requires a login.
          example: company_basic_auth_credential_name
    SendTriggeredCampaignsRequest:
      title: Send API-triggered campaign request
      type: object
      required: [campaign_id]
      properties:
        campaign_id:
          type: string
          description: See [campaign identifier]({{site.baseurl}}/api/identifier_types/).
          example: campaign_identifier
        send_id:
          type: string
          description: See [send identifier]({{site.baseurl}}/api/identifier_types/).
          example: send_identifier
        trigger_properties:
          type: object
          additionalProperties: true
          description: See [trigger properties]({{site.baseurl}}/api/objects_filters/trigger_properties_object/). Personalization key-value pairs apply to all users in this request.
          example:
            product_name: shoes
        broadcast:
          type: boolean
          default: false
          description: |
            You must set `broadcast` to true when sending a message to the entire segment configured as the campaign's target audience in the Braze dashboard. This parameter defaults to false (as of August 31, 2017).

            If `broadcast` is set to true, a `recipients` list cannot be included. However, use caution when setting `broadcast: true`, as unintentionally setting this flag may cause you to send your message to a larger-than-expected audience.

            `broadcast` must be set to true if `recipients` is omitted.
          example: false
        audience:
          title: Connected audience object
          type: object
          additionalProperties: true
          description: |
            See [connected audience]({{site.baseurl}}/api/objects_filters/connected_audience/). When you include `audience`, the message is sent only to users who match the defined filters, such as custom attributes and subscription statuses.

            Including `audience` sends to only users in the audience.
        segment_id:
          type: string
          description: |
            See [segment identifier]({{site.baseurl}}/api/identifier_types/#segment-identifier). When you include `segment_id`, the message is sent only to users in the campaign's target audience who are also in this segment.

            Available for broadcast sends only. Set `broadcast` to true and don't include `recipients`. If you also include `audience`, users must match both. If you include `segment_id` together with `recipients`, the request is rejected with a `400` and no messages are sent.
          example: segment_identifier
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/CampaignRecipient'
          description: |
            See [recipients object]({{site.baseurl}}/api/objects_filters/recipient_object/).

            If `send_to_existing_only` is `false`, an `attributes` object must be included.

            You can update a user's subscription group status by including `subscription_groups` in the nested `attributes` object. For more details, refer to [User attributes object]({{site.baseurl}}/api/objects_filters/user_attributes_object).

            If `recipients` is not provided and `broadcast` is set to true, the message is sent to the entire segment configured as the campaign's target audience in the Braze dashboard.

            If `email` is the identifier, you must include [`prioritization`]({{site.baseurl}}/api/endpoints/user_data/post_user_identify#how-it-works) in the recipients object.
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
          description: |
            Array of JSON objects that define the files you need attached, defined by `file_name`, `url`, and optionally `basic_auth_credential`.

            If `broadcast` is set to true, then the `attachments` list cannot be included.

            Each attachment is defined by `file_name` and `url`, plus an optional `basic_auth_credential`.

            When an attachment URL requires a login, include `basic_auth_credential` on that attachment and set it to the name of a stored basic authentication credential. To set up a credential, refer to [Authentication for email file attachments]({{site.baseurl}}/api/objects_filters/messaging/email_object/#authentication-for-email-file-attachments).
    SendTriggeredCampaignsResponse:
      title: Send API-triggered campaign response
      type: object
      properties:
        message:
          type: string
          description: Returns `success` when the request completes without errors.
          example: success
        dispatch_id:
          type: string
          description: The dispatch identifier for this send, used to correlate the request with message engagement events.
          example: example_dispatch_id
        send_id:
          type: string
          description: The send identifier, returned when `send_id` was included in the request.
          example: send_identifier
        notice:
          type: string
          description: A warning returned when the campaign is archived or paused, in which case trigger requests have no effect until it is unarchived or resumed.
          example: The campaign is paused. Resume the campaign to ensure trigger requests will take effect.
    ErrorResponse:
      title: Error
      type: object
      properties:
        message:
          type: string
          description: The error message describing why the request failed.
        errors:
          type: array
          description: Non-fatal errors encountered while processing the request. Data unaffected by these errors is still processed.
          items:
            type: object
            properties:
              type:
                type: string
                description: The error type.
