---
openapi: 3.0.3
info:
  title: Braze REST API – List available email templates
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics/) with the `templates.email.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:
  "/templates/email/list":
    get:
      summary: List available email templates
      operationId: get_templates_email_list_get_list_email_templates
      parameters:
        - name: modified_after
          in: query
          required: false
          description: Retrieve only templates updated at or after the given time. Use a string in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          schema:
            type: string
          example: "2020-01-01T01:01:01.000000"
        - name: modified_before
          in: query
          required: false
          description: Retrieve only templates updated at or before the given time. Use a string in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          schema:
            type: string
          example: "2020-02-01T01:01:01.000000"
        - name: limit
          in: query
          required: false
          description: Maximum number of templates to retrieve. Default to 100 if not provided, with a maximum acceptable value of 1000. Must be a positive number.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          example: 1
        - name: offset
          in: query
          required: false
          description: Number of templates to skip before returning rest of the templates that fit the search criteria. Must be a positive number.
          schema:
            type: integer
            minimum: 1
          example: 1
      responses:
        "200":
          description: |
            The request succeeded and the response body lists the email templates. No action needed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEmailTemplatesResponse'
              examples:
                success:
                  summary: Email template list
                  value:
                    count: 1
                    templates:
                      - email_template_id: 232b6d29-7e41-4106-a0ab-1c4fe915d701
                        template_name: email_template_name
                        created_at: "2020-01-15T01:01:01.000Z"
                        updated_at: "2020-01-20T01:01:01.000Z"
                        tags:
                          - Tag1
                          - Tag2
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **The `modified_after` value isn't a valid time:** Pass `modified_after` as an ISO 8601 datetime.
            - **The `modified_before` value isn't a valid time:** Pass `modified_before` as an ISO 8601 datetime.
            - **`modified_after` is later than `modified_before`:** Set `modified_after` on or before `modified_before`.
            - **The `limit` isn't a valid number:** Pass `limit` as an integer.
            - **The `limit` is 0 or negative:** Pass a `limit` of 1 or greater.
            - **The `limit` is greater than 1000:** Pass a `limit` of 1000 or fewer.
            - **The `offset` isn't a valid number:** Pass `offset` as an integer.
            - **The `offset` is 0 or negative:** Pass an `offset` of 1 or greater.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                modified_after_invalid:
                  summary: The modified_after value isn't a valid time
                  value:
                    message: Modified after time is invalid.
                modified_before_invalid:
                  summary: The modified_before value isn't a valid time
                  value:
                    message: Modified before time is invalid.
                modified_times_order:
                  summary: modified_after is later than modified_before
                  value:
                    message: Modified after time must be earlier than or the same as modified before time.
                limit_invalid:
                  summary: The limit isn't a valid number
                  value:
                    message: Template number limit is invalid.
                limit_not_positive:
                  summary: The limit is 0 or negative
                  value:
                    message: Template number limit must be greater than 0.
                limit_too_high:
                  summary: The limit is greater than 1000
                  value:
                    message: Template number limit exceeds maximum of 1000.
                offset_invalid:
                  summary: The offset isn't a valid number
                  value:
                    message: Offset is invalid.
                offset_not_positive:
                  summary: The offset is 0 or negative
                  value:
                    message: Offset must be greater than 0.
        "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 `templates.email.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 `templates.email.list` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    EmailTemplateSummary:
      title: Email template
      type: object
      properties:
        email_template_id:
          type: string
          description: Your email template's API Identifier.
          example: 232b6d29-7e41-4106-a0ab-1c4fe915d701
        template_name:
          type: string
          description: The name of your email template.
          example: email_template_name
        created_at:
          type: string
          description: The time the email was created at in ISO 8601.
          example: "2020-01-15T01:01:01.000Z"
        updated_at:
          type: string
          description: The time the email was updated in ISO 8601.
          example: "2020-01-20T01:01:01.000Z"
        tags:
          type: array
          description: Tags appended to the template.
          items:
            type: string
          example:
            - Tag1
            - Tag2
    ListEmailTemplatesResponse:
      title: List email templates response
      type: object
      properties:
        count:
          type: integer
          description: The number of templates returned.
          example: 1
        templates:
          type: array
          description: The email templates in the workspace. Each template has the following properties.
          items:
            $ref: '#/components/schemas/EmailTemplateSummary'
        message:
          type: string
          description: Returns `success` when the request completes without errors.
          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.
