---
openapi: 3.0.3
info:
  title: Braze REST API – Export custom events
  description: |
    ## Prerequisites

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

    ## Rate limit

    We apply a shared rate limit of 1,000 requests per hour to this endpoint. This rate limit is shared with the `/custom_attributes`, `/events/list`, and `/purchases/product_list` endpoints, 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:
  /events:
    get:
      summary: Export custom events
      description: |
        ## Fatal error response codes

        For status codes and associated error messages that will be returned if your request encounters a fatal error, reference [Fatal errors]({{site.baseurl}}/api/errors/#fatal-errors).
      operationId: get_events_get_custom_events_data
      parameters:
        - name: cursor
          in: query
          required: false
          description: Determines the pagination of the custom events.
          schema:
            type: string
          example: c2tpcDow
      responses:
        "200":
          description: |
            The request succeeded and the response body includes the custom event data. No action needed.

            The following sample response shows an example of the response returned when you export custom events.

            Note that each call to this endpoint will return 50 events. For more than 50 events, use the `Link` header to retrieve the data on the next page as shown in the following example response.
          headers:
            Link:
              description: Links to the previous and next pages of custom events, when they exist, in the format `<URL>; rel="prev"` and `<URL>; rel="next"`, separated by a comma. Each URL includes the `cursor` query parameter for that page.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomEventsDataResponse'
              examples:
                success:
                  summary: Custom events exported
                  value:
                    message: success
                    events:
                      - name: The event name
                        description: The event description
                        included_in_analytics_report: false
                        status: Active
                        tag_names:
                          - Tag One
                          - Tag Two
        "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 `events.get` 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 1000 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 `events.get` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    CustomEvent:
      title: Custom event
      type: object
      properties:
        name:
          type: string
          description: The event name.
          example: The event name
        description:
          type: string
          description: The event description.
          example: The event description
        included_in_analytics_report:
          type: boolean
          description: The analytics report inclusion.
          example: false
        status:
          type: string
          description: The event status.
          example: Active
        tag_names:
          type: array
          description: The tag names associated with the event formatted as strings.
          items:
            type: string
          example:
            - Tag One
            - Tag Two
    CustomEventsDataResponse:
      title: Export custom events response
      type: object
      properties:
        message:
          type: string
          description: Returns 'success' when the request completes without errors.
          example: success
        events:
          type: array
          items:
            $ref: '#/components/schemas/CustomEvent'
    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.
