---
openapi: 3.0.3
info:
  title: Braze REST API – Export campaigns list
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key-permissions) with the `campaigns.list` 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/list":
    get:
      summary: Export campaigns list
      operationId: get_campaigns_list_get_campaigns
      parameters:
        - name: page
          in: query
          required: false
          description: The page of campaigns to return, defaults to 0 (returns the first set of up to 100).
          schema:
            type: integer
            default: 0
          example: 0
        - name: include_archived
          in: query
          required: false
          description: Whether or not to include archived campaigns, defaults to false.
          schema:
            type: boolean
            default: false
          example: false
        - name: sort_direction
          in: query
          required: false
          description: |
            - Sort creation time from newest to oldest: pass in the value `desc`.
            - Sort creation time from oldest to newest: pass in the value `asc`.

            If `sort_direction` is not included, the default order is oldest to newest.
          schema:
            type: string
            enum: [asc, desc]
            default: asc
          example: desc
        - name: last_edit.time[gt]
          in: query
          required: false
          description: Filters the results and only returns campaigns that were edited greater than the time provided till now. Format is `yyyy-MM-DDTHH:mm:ss`.
          schema:
            type: string
          example: "2020-06-28T23:59:59-5:00"
      responses:
        "200":
          description: |
            The request succeeded and the response body lists the campaigns. No action needed.

            The following sample response shows an example of the response returned when you export campaigns list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsResponse'
              examples:
                success:
                  summary: Campaigns list
                  value:
                    message: success
                    campaigns:
                      - id: campaign_identifier_1
                        last_edited: "2020-06-28T23:59:59+00:00"
                        name: Example campaign 1
                        is_api_campaign: false
                        tags:
                          - example_tag_1
                          - example_tag_2
                      - id: campaign_identifier_2
                        last_edited: "2020-06-27T12:00:00+00:00"
                        name: Example API campaign
                        is_api_campaign: true
                        tags: []
        "400":
          description: |
            Bad request. To resolve it:

            - **The `page` value isn't an integer:** Pass `page` as a single non-negative integer, such as `page=1`.
            - **The `last_edit.time[gt]` value is improperly formatted:** Pass the time in the format `yyyy-MM-DDTHH:mm:ss`.
            - **The `last_edit.time[gt]` value is in the future:** Pass a time that isn't in the future.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                page_not_integer:
                  summary: The page value isn't an integer
                  value:
                    message: page must be an integer
                invalid_last_edit_time:
                  summary: Improperly formatted last_edit.time[gt]
                  value:
                    message: invalid time input. Format is yyyy-MM-DDTHH:mm:ss
                last_edit_time_in_future:
                  summary: last_edit.time[gt] in the future
                  value:
                    message: invalid time input. input time cannot be in the future
        "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.list` 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.list` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    CampaignListItem:
      title: Campaign
      type: object
      properties:
        id:
          type: string
          description: The Campaign API identifier.
          example: campaign_identifier_1
        last_edited:
          type: string
          format: date-time
          nullable: true
          description: The last edited time for the message, as an ISO 8601 string.
          example: "2020-06-28T23:59:59+00:00"
        name:
          type: string
          description: The campaign name.
          example: Example campaign 1
        is_api_campaign:
          type: boolean
          description: Whether the campaign is an API campaign.
          example: false
        tags:
          type: array
          items:
            type: string
          description: The tag names associated with the campaign formatted as strings.
          example:
            - example_tag_1
            - example_tag_2
    CampaignsResponse:
      title: Export campaigns list response
      type: object
      properties:
        message:
          type: string
          description: Returns 'success' when the request completes without errors.
          example: success
        campaigns:
          type: array
          items:
            $ref: '#/components/schemas/CampaignListItem'
    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.
