---
openapi: 3.0.3
info:
  title: Braze REST API – Export campaign details
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key-permissions) with the `campaigns.details` permission.

    ## Rate limit

    We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in [API rate limits]({{site.baseurl}}/api/api_limits/).
  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/details":
    get:
      summary: Export campaign details
      operationId: get_campaigns_details_get_campaign_details
      parameters:
        - name: campaign_id
          in: query
          required: true
          description: |
            See [campaign API identifier]({{site.baseurl}}/api/identifier_types/).

            The `campaign_id` for API campaigns can be found on the [API Keys]({{site.baseurl}}/user_guide/administer/global/workspace_settings/apis_and_identifiers/) page and the **Campaign Details** page within your dashboard; or you can use the [Export campaigns list endpoint]({{site.baseurl}}/api/endpoints/export/campaigns/get_campaigns/).
          schema:
            type: string
          example: campaign_identifier
        - name: post_launch_draft_version
          in: query
          required: false
          description: For messages that have a post-launch draft, setting this to `true` shows any draft changes available. Defaults to `false`.
          schema:
            type: boolean
            default: false
        - name: include_has_translatable_content
          in: query
          required: false
          description: When set to `true`, the API response includes a `has_translatable_content` field for each message. Defaults to `false`.
          schema:
            type: boolean
            default: false
      responses:
        "200":
          description: |
            The request succeeded and the response body includes the campaign details. No action needed.

            The following sample response shows an example of the response returned when you export campaign details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDetailsResponse'
              examples:
                campaign_details:
                  summary: Campaign details
                  value:
                    message: success
                    id: campaign_internal_identifier
                    created_at: "2023-01-01T12:00:00+00:00"
                    updated_at: "2023-01-10T12:00:00+00:00"
                    archived: false
                    draft: false
                    enabled: true
                    has_post_launch_draft: false
                    name: Example campaign
                    description: Example campaign description
                    schedule_type: date
                    channels:
                      - email
                    first_sent: "2023-01-02T09:00:00+00:00"
                    last_sent: "2023-01-09T09:00:00+00:00"
                    tags:
                      - example_tag
                    teams:
                      - Example Team
                    messages:
                      email_variation_api_identifier:
                        channel: email
                        name: Variation 1
                        has_translatable_content: false
                        extras:
                          example_key: example_value
                        subject: Welcome to Example Brand
                        body: "<html><body>Welcome, {{first_name}}!</body></html>"
                        from: Example Brand <marketing@example.com>
                        reply_to: support@example.com
                        title: Welcome email
                        amp_body: null
                        preheader: Thanks for signing up
                        custom_plain_text: Welcome!
                        should_inline_css: true
                        should_whitespace_preheader: false
                        headers:
                          X-Example-Header: example_value
                      control_variation_api_identifier:
                        channel: email
                        name: Control Group
                        type: control
                    conversion_behaviors:
                      - type: Clicks Email
                        window: 86400
                      - type: Makes Specific Purchase
                        window: 86400
                        product: Feline Body Armor
        "400":
          description: Bad request. The `campaign_id` isn't a valid object identifier. Pass the `campaign_id` string shown on the campaign's details page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_campaign_id:
                  summary: Missing or invalid campaign_id
                  value:
                    message: campaign_id must be a string of the object api identifier
        "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.details` 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'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    message: You have exceeded your limit of 250000 requests per hour. Please contact your account executive to increase your limit. If you do not have their info, you may contact Braze directly at https://www.braze.com/contact/.
        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.details` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    ContentCardsMessage:
      title: Content Cards
      type: object
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: content_cards
        name:
          type: string
          description: The name of variant.
        extras:
          type: object
          additionalProperties: true
          description: Any key-value pairs provided; only present if at least one key-value pair has been set.
    EmailMessage:
      title: Email
      type: object
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: email
        name:
          type: string
          description: The name of the variant.
        extras:
          type: object
          additionalProperties: true
          description: The email extras.
        subject:
          type: string
          description: The subject.
        body:
          type: string
          description: The HTML body.
        from:
          type: string
          description: The from address and display name.
        reply_to:
          type: string
          description: The reply-to for message, if different than "from" address.
        title:
          type: string
          description: The name of the email.
        amp_body:
          type: string
          nullable: true
          description: The AMP HTML body.
        preheader:
          type: string
          description: The preheader.
        custom_plain_text:
          type: string
          description: The custom plain text.
        should_inline_css:
          type: boolean
          description: Whether there should be inline CSS.
        should_whitespace_preheader:
          type: boolean
          description: Whether there should be a whitespace header.
        headers:
          type: object
          additionalProperties: true
          description: List of email headers.
    SurveyInAppMessage:
      title: Surveys
      type: object
      description: The response format depends on the type of in-app message. Survey in-app messages return `type` and `data` fields. Other in-app message types (slideup, modal, and fullscreen) return `name`, `message`, and `extras` fields.
      properties:
        type:
          type: string
          description: The description of in-app message type, such as "survey".
          example: survey
        data:
          type: object
          properties:
            pages:
              type: array
              items:
                title: Survey page
                type: object
                properties:
                  header:
                    type: object
                    properties:
                      text:
                        type: string
                        description: The display text for the header of the survey.
                  choices:
                    type: array
                    items:
                      title: Survey choice
                      type: object
                      properties:
                        choice_id:
                          type: string
                          description: The choice identifier.
                        text:
                          type: string
                          description: The display text.
                        custom_attribute_key:
                          type: string
                          description: The custom attribute key.
                        custom_attribute_value:
                          type: string
                          description: The custom attribute value.
                        deleted:
                          type: boolean
                          description: Deleted from live campaign.
    InAppMessage:
      title: Slideup, modal, fullscreen in-app messages
      type: object
      required: [channel, name]
      description: The response format depends on the type of in-app message. Survey in-app messages return `type` and `data` fields. Other in-app message types (slideup, modal, and fullscreen) return `name`, `message`, and `extras` fields.
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: trigger_in_app_message
        name:
          type: string
          description: The name of the variant.
        message:
          type: string
          description: The body text.
        extras:
          type: object
          additionalProperties: true
          description: Any key-value pairs provided; only present if at least one key-value pair has been set.
    PushMessage:
      title: Push
      type: object
      properties:
        channel:
          type: string
          description: The description of the channel, such as "ios_push" or "android_push".
          example: ios_push
        name:
          type: string
          description: The name of the variant.
        alert:
          type: string
          description: The alert body text.
        extras:
          type: object
          additionalProperties: true
          description: Any key-value pairs provided.
        title:
          type: string
          description: The alert title text.
        action:
          type: string
          description: Action link from click.
        image_url:
          type: string
          nullable: true
          description: The image URL for an Android notification image, an iOS notification image, or a Web push icon image.
        large_image_url:
          type: string
          nullable: true
          description: The web notification image URL for Android Chrome and Windows web push actions; null in other cases.
    SmsMessage:
      title: SMS
      type: object
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: sms
        body:
          type: string
          description: The payload body.
        from:
          type: array
          items:
            type: string
          description: The list of numbers associated with the subscription group.
        subscription_group_id:
          type: string
          nullable: true
          description: The API id of the subscription group targeted in the SMS message.
    WebhookMessage:
      title: Webhook
      type: object
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: webhook
        url:
          type: string
          description: The URL for webhook.
        body:
          type: string
          description: The payload body.
        type:
          type: string
          description: The body content type.
        headers:
          type: object
          additionalProperties: true
          description: The specified request headers.
        method:
          type: string
          description: The HTTP method, either POST or GET.
    WhatsAppTemplateMessage:
      title: WhatsApp template messages
      type: object
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: whats_app
        subscription_group_id:
          type: string
          nullable: true
          description: The API ID of the subscription group selected in the WhatsApp message.
        from:
          type: array
          items:
            type: string
          description: The list of strings of the numbers associated with the subscription group.
        template_name:
          type: string
          description: The name of the WhatsApp template being sent.
        template_language_code:
          type: string
          description: The language code of the WhatsApp template being sent.
        header_variables:
          type: array
          items:
            type: string
          description: The list of strings, if present, of Liquid variables being inserted into header of WhatsApp template being sent.
        body_variables:
          type: array
          items:
            type: string
          description: The list of strings, if present, of Liquid variables being inserted into body of WhatsApp template being sent.
        button_variables:
          type: array
          items:
            type: string
          description: The list of strings, if present, of Liquid variables being inserted into buttons of WhatsApp template being sent.
    WhatsAppResponseMessage:
      title: WhatsApp response messages
      type: object
      required: [channel, subscription_group_id, from, layout, buttons]
      properties:
        channel:
          type: string
          description: The channel type of the message.
          example: whats_app
        subscription_group_id:
          type: string
          nullable: true
          description: The API ID of the subscription group selected in the WhatsApp message.
        from:
          type: array
          items:
            type: string
          description: List of strings of the numbers associated with the subscription group.
        layout:
          type: string
          description: The name of the WhatsApp template being sent (text or media or quick-reply).
        header_text:
          type: string
          nullable: true
          description: The text, if present, of the header of the message being sent.
        body_text:
          type: string
          nullable: true
          description: The text, if present, of the body of the message being sent.
        footer_text:
          type: string
          nullable: true
          description: The text, if present, of the footer of the message being sent.
        buttons:
          type: array
          description: List of button objects in the message being sent.
          items:
            title: WhatsApp button
            type: object
            properties:
              text:
                type: string
                description: The text of the button.
    ControlMessage:
      title: Control messages
      type: object
      properties:
        channel:
          type: string
          description: The description of the channel that the control is for.
          example: email
        type:
          type: string
          example: control
    CampaignMessage:
      title: Campaign message
      type: object
      properties:
        channel:
          type: string
          description: The channel type of the message, must be either email, ios_push, android_push, web_push, kindle_push, webhook, content_cards, trigger_in_app_message, sms, whats_app, banner, line, kakao, or feature_flag_experiment.
          example: email
        name:
          type: string
          description: The name of the message in the dashboard (for example, "Variation 1").
          example: Variation 1
        has_translatable_content:
          type: boolean
          description: Whether the message has translatable content (only present if `include_has_translatable_content` is true); `true` if locales are configured and the message contains at least one translation tag; `false` if no locales are configured or no translation tags detected.
          example: false
      anyOf:
        - $ref: '#/components/schemas/ContentCardsMessage'
        - $ref: '#/components/schemas/EmailMessage'
        - $ref: '#/components/schemas/SurveyInAppMessage'
        - $ref: '#/components/schemas/InAppMessage'
        - $ref: '#/components/schemas/PushMessage'
        - $ref: '#/components/schemas/SmsMessage'
        - $ref: '#/components/schemas/WebhookMessage'
        - $ref: '#/components/schemas/WhatsAppTemplateMessage'
        - $ref: '#/components/schemas/WhatsAppResponseMessage'
        - $ref: '#/components/schemas/ControlMessage'
    ConversionBehavior:
      title: Conversion behavior
      anyOf:
        - title: Clicks email
          type: object
          properties:
            type:
              type: string
              enum: [Clicks Email]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
        - title: Opens email
          type: object
          properties:
            type:
              type: string
              enum: [Opens Email]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
        - title: Makes purchase (any purchase)
          type: object
          properties:
            type:
              type: string
              enum: [Makes Any Purchase]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
        - title: Makes purchase (specific product)
          type: object
          properties:
            type:
              type: string
              enum: [Makes Specific Purchase]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
            product:
              type: string
              description: The name of the product, such as "Feline Body Armor".
              example: Feline Body Armor
        - title: Performs custom event
          type: object
          properties:
            type:
              type: string
              enum: [Performs Custom Event]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
            custom_event_name:
              type: string
              description: The name of the event, such as "Used Feline Body Armor".
              example: Used Feline Body Armor
        - title: Upgrades app
          type: object
          properties:
            type:
              type: string
              enum: [Upgrades App]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
            app_ids:
              type: array
              nullable: true
              items:
                type: string
              description: Array of app ids, such as ["12345", "67890"], or `null` if "Track sessions for any app" is selected in the UI.
              example: ["12345", "67890"]
        - title: Uses app
          type: object
          properties:
            type:
              type: string
              enum: [Starts Session]
            window:
              type: integer
              description: The number of seconds during which the user can convert on this event, such as 86400, which is 24 hours.
              example: 86400
            app_ids:
              type: array
              nullable: true
              items:
                type: string
              description: Array of app ids, such as ["12345", "67890"], or `null` if "Track sessions for any app" is selected in the UI.
              example: ["12345", "67890"]
    CampaignDetailsResponse:
      title: Export campaign details response
      type: object
      properties:
        message:
          type: string
          description: Returns 'success' when the request completes without errors.
          example: success
        id:
          type: string
          description: The campaign's internal object identifier. This is different from the campaign API identifier that you pass as `campaign_id`.
        created_at:
          type: string
          description: The date created as ISO 8601 date.
        updated_at:
          type: string
          description: The date last updated as ISO 8601 date.
        archived:
          type: boolean
          description: Whether this campaign is archived.
        draft:
          type: boolean
          description: Whether this campaign is a draft.
        enabled:
          type: boolean
          description: Whether this campaign is active or not.
        has_post_launch_draft:
          type: boolean
          description: Whether this campaign has a post-launch draft.
        name:
          type: string
          description: The campaign name.
        description:
          type: string
          description: The campaign description.
        schedule_type:
          type: string
          description: The type of scheduling action.
        channels:
          type: array
          items:
            type: string
          description: The list of channels to send via.
        first_sent:
          type: string
          nullable: true
          description: The date and hour of first sent as ISO 8601 date.
        last_sent:
          type: string
          nullable: true
          description: The date and hour of last sent as ISO 8601 date.
        tags:
          type: array
          items:
            type: string
          description: The tag names associated with the campaign.
        teams:
          type: array
          items:
            type: string
          description: The names of the Teams associated with the campaign.
        messages:
          type: object
          description: |
            The messages in the campaign, keyed by message variation ID (`message_variation_id`, the actual ID of the message variation).

            The `messages` response will contain information about each message. The following includes example message responses for each channel:
          additionalProperties:
            $ref: '#/components/schemas/CampaignMessage'
        conversion_behaviors:
          type: array
          description: |
            The conversion event behaviors assigned to the campaign, see the following conversions behavior section.

            The `conversion_behaviors` array contains information about each conversion event behavior set for the campaign. These behaviors are in order as set by the campaign. For example, Conversion Event A is the first item in the array, Conversion Event B is the second, and so on. The following lists example conversion event behavior responses:
          items:
            $ref: '#/components/schemas/ConversionBehavior'
    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.
