---
openapi: 3.0.3
info:
  title: Braze REST API – Schedule API-triggered campaigns
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key-permissions) with the `campaigns.trigger.schedule.create` 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: []
paths:
  "/campaigns/trigger/schedule/create":
    post:
      summary: Schedule API-triggered campaigns
      description: |
        ## 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`.
        - If you don't include `recipients`, set `broadcast` to `true` to send to the campaign's entire target segment (narrowed by `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.
      operationId: post_campaigns_trigger_schedule_create_post_schedule_triggered_campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleTriggeredCampaignsRequest'
            examples:
              recipients_and_audience:
                summary: Schedule for an external user ID within a connected audience
                value:
                  campaign_id: campaign_identifier
                  send_id: send_identifier
                  recipients:
                    - external_user_id: external_user_identifier
                      trigger_properties: {}
                  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'
                  broadcast: false
                  trigger_properties: {}
                  schedule:
                    time: '2030-01-01T09:00:00Z'
                    in_local_time: false
                    at_optimal_time: false
              user_alias:
                summary: Schedule for a user alias
                value:
                  campaign_id: campaign_identifier
                  recipients:
                    - user_alias:
                        alias_name: example_alias
                        alias_label: example_label
                  schedule:
                    time: '2030-01-01T09:00:00Z'
      responses:
        "201":
          description: |
            The request was accepted. The response includes a `schedule_id`. No action needed.

            The following sample response shows an example of the response returned when you schedule API-triggered campaigns.

            If the request includes a `send_id`, the response also includes it. If the campaign is archived or paused, the response also includes a `notice` field. If the campaign is archived, you see this `notice` message: "The campaign is archived. Unarchive the campaign to ensure trigger requests will take effect." If the campaign is paused, you see this `notice` message: "The campaign is paused. Resume the campaign to ensure trigger requests will take effect."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleTriggeredCampaignsResponse'
              examples:
                success:
                  summary: Campaign scheduled
                  value:
                    dispatch_id: dispatch_identifier
                    schedule_id: schedule_identifier
                    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_id` belongs to a transactional email campaign:** Transactional emails cannot be scheduled. To send one, use the [`/transactional/v1/campaigns/{campaign_id}/send` endpoint]({{site.baseurl}}/api/endpoints/messaging/send_messages/post_send_transactional_message) at the time you want it delivered.
            - **The `schedule.time` is missing, malformed, or in the past:** Pass `schedule.time` as a future ISO 8601 UTC datetime.
            - **For local or optimal delivery, the `time` is in the past:** Pass a future `schedule.time` for local or optimal delivery.
            - **Both `in_local_time` and `at_optimal_time` are `true`:** Set only one of `in_local_time` or `at_optimal_time`.
            - **The `recipients` value isn't an array of objects that each include a user identifier:** Pass `recipients` as an array of objects, each with an `external_user_id`, `user_alias`, or `braze_id`.
            - **The `recipients` array is empty:** Include at least one recipient, or use `broadcast`.
            - **The `recipients` array exceeds the maximum allowed length:** Send fewer recipients per request (up to the API-triggered recipient limit).
            - **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`.
            - **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` isn't supported on this endpoint:** Remove `segment_id` from the request.
          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
                invalid_time:
                  summary: The time is missing, malformed, or in the past
                  value:
                    message: "'time' must be an ISO 8601 time in UTC that has not passed"
                local_time_in_past:
                  summary: The local or optimal time is in the past
                  value:
                    message: "'time' must be an ISO 8601 time in UTC that is not in the past"
                local_and_optimal:
                  summary: Both in_local_time and at_optimal_time are true
                  value:
                    message: "only one of 'in_local_time' and 'at_optimal_time' can be true"
                malformed_recipients:
                  summary: The recipients value is malformed
                  value:
                    message: "'recipients' must be an array of objects, each containing one of 'external_user_id',\n'user_alias', 'braze_id', or 'email', and optional 'trigger_properties'. When using 'email' as an\nidentifier, a 'prioritization' array is required.\n"
                empty_recipients:
                  summary: The recipients array is empty
                  value:
                    message: when including recipients, there must be at least one recipient specified
                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
                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_not_supported:
                  summary: segment_id isn't supported
                  value:
                    message: "'segment_id' is not supported on this endpoint"
        "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.schedule.create` 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.schedule.create` 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_alias
        alias_label:
          type: string
          example: example_label
    CampaignRecipient:
      title: Recipient
      type: object
      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
        trigger_properties:
          type: object
          additionalProperties: true
          description: Trigger properties for this user.
    Schedule:
      title: Schedule object
      type: object
      required: [time]
      description: See [schedule object]({{site.baseurl}}/api/objects_filters/schedule_object).
      properties:
        time:
          type: string
          description: Time to send the message, as an ISO 8601 datetime string.
          example: '2030-01-01T09:00:00Z'
        in_local_time:
          type: boolean
          example: false
        at_optimal_time:
          type: boolean
          example: false
    ScheduleTriggeredCampaignsRequest:
      title: Schedule API-triggered campaign request
      type: object
      required: [campaign_id, schedule]
      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
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/CampaignRecipient'
          description: |
            See [recipients object]({{site.baseurl}}/api/objects_filters/recipient_object).

            Including `recipients` will send only to the provided user IDs if they are in the campaign's segment.
        audience:
          title: Connected audience object
          type: object
          additionalProperties: true
          description: |
            See [connected audience]({{site.baseurl}}/api/objects_filters/connected_audience).

            Including `audience` will only send to users in the audience.
        broadcast:
          type: boolean
          default: false
          description: |
            You must set `broadcast` to true when sending a message to an entire segment that a campaign or Canvas targets. 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.

            Defaults to false on 8/31/17, must be set to true if the `recipients` object is omitted. If `recipients` is omitted and `broadcast` is set to `true`, the message sends to the entire segment targeted by the campaign, narrowed by `audience` if provided.
          example: false
        trigger_properties:
          type: object
          additionalProperties: true
          description: |
            Personalization key-value pairs for all users in this send. See [trigger properties]({{site.baseurl}}/api/objects_filters/trigger_properties_object).

            For any keys that conflict between these trigger properties and those in a Recipients Object, the value from the Recipients Object will be used.
        schedule:
          $ref: '#/components/schemas/Schedule'
    ScheduleTriggeredCampaignsResponse:
      title: Schedule API-triggered campaign response
      type: object
      properties:
        dispatch_id:
          type: string
          example: dispatch_identifier
        schedule_id:
          type: string
          description: Save this identifier to update or delete the scheduled campaign later.
          example: schedule_identifier
        send_id:
          type: string
          description: The send identifier, returned when `send_id` was included in the request.
          example: send_identifier
        notice:
          type: string
          description: Included when the campaign is archived or paused.
          example: The campaign is paused. Resume the campaign to ensure trigger requests will take effect.
        message:
          type: string
          example: success
    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.
