> ## Documentation Index
> Fetch the complete documentation index at: https://docs.watahub.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List a WABA's message templates

> List a WABA's message templates



## OpenAPI

````yaml openapi.json GET /v1/templates/{wabaId}
openapi: 3.1.0
info:
  title: Watahub API
  version: 0.2.0
  description: >-
    Tenant API of Watahub, the multi-tenant WhatsApp Cloud API gateway.
    Authenticate every request with your API key as `Authorization: Bearer
    <key>` or `X-API-Key: <key>`.


    - Shapes the gateway owns are closed: no other field appears.

    - Records that come from Meta are open: documented fields are listed and any
    other field Meta adds is passed through.

    - The `/vN.N` proxy passes Meta's body and status through untouched; the
    version in the path is accepted and ignored.
servers:
  - url: https://cloud.watahub.dev
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Messages
  - name: Media
  - name: Templates
  - name: Graph-compatible proxy
    description: >-
      Drop-in for Meta's Graph API on three routes. Meta's response is returned
      as is.
  - name: Phones
    description: Phones
  - name: Conversations
    description: Conversations
  - name: Connect
    description: Connect
  - name: Customers
    description: Customers
  - name: Webhooks
    description: Webhooks
  - name: Logs
    description: Logs
  - name: Health
    description: Health
  - name: Message templates
    description: >-
      Templates cached by the gateway per WABA; synced from Meta and required by
      broadcasts.
  - name: Broadcasts
    description: >-
      Send one approved template to up to 500 recipients; sending is queued and
      drained in the background.
paths:
  /v1/templates/{wabaId}:
    parameters:
      - name: wabaId
        in: path
        required: true
        schema:
          type: string
          pattern: ^\d{1,32}$
    get:
      tags:
        - Templates
      summary: List a WABA's message templates
      description: Same as `GET /v1/templates`, with the WABA in the path.
      operationId: listTemplates
      parameters:
        - name: wabaId
          in: path
          required: true
          description: One of the tenant's WABAs.
          schema:
            $ref: '#/components/schemas/GraphId'
        - $ref: '#/components/parameters/PageAfter'
      responses:
        '200':
          $ref: '#/components/responses/TemplatesListed'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    GraphId:
      type: string
      pattern: ^\d+$
      description: Numeric Meta Graph ID.
    TemplateList:
      type: object
      additionalProperties: false
      required:
        - data
        - paging
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MessageTemplate'
        paging:
          type: object
          additionalProperties: false
          description: >-
            `{}` on the last page. Meta's `next` and `previous` URLs are never
            returned.
          properties:
            after:
              type: string
              description: >-
                Meta's cursor for the next page, present only while Meta has
                one. Send it back as `after`.
    GatewayError:
      type: object
      description: >-
        An error the gateway or the core answers itself. `error` is a stable
        English message for developers.
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: string
        fields:
          type: array
          items:
            type: string
          description: 'With 400 `Invalid fields`: the paths of the rejected fields.'
        requestId:
          type: string
          description: 'With 500 `Operation unavailable`: the ID to quote to support.'
    ValidationError:
      type: object
      description: The core rejected a value of the body, path, header or query.
      additionalProperties: false
      required:
        - error
        - details
      properties:
        error:
          const: Validation failed
        details:
          type: object
          description: Messages by field name.
          additionalProperties:
            type: array
            items:
              type: string
    MetaError:
      type: object
      description: >-
        Meta failed a `/v1` call. With Meta's error: `code`, its `subcode`,
        `type` on sends, and the core's classification. When Meta could not be
        reached or answered something unusable, only `message`, plus the
        `unknown_outcome` classification on sends.
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - message
          properties:
            message:
              type: string
            code:
              type: integer
              description: Meta's error code; Meta's HTTP status when Meta gave none.
            subcode:
              type: integer
              description: Meta's `error_subcode`.
            type:
              type: string
              description: Meta's error type. Only on message sends.
            category:
              type: string
              enum:
                - auth
                - billing
                - rate_limit
                - meta_server
                - unknown
                - unknown_outcome
            retryable:
              type: boolean
            action:
              type: string
              description: What to do next, in English.
    MessageTemplate:
      type: object
      description: >-
        A template as Meta returns it. Fields Meta adds beyond these are passed
        through.
      additionalProperties: true
      required:
        - id
        - name
        - language
        - status
        - category
        - components
      properties:
        id:
          type: string
        name:
          type: string
        language:
          type: string
          description: Locale code, such as `es` or `en_US`.
        status:
          type: string
          description: Such as `APPROVED`, `PENDING`, `REJECTED`, `PAUSED` or `DISABLED`.
        category:
          type: string
          description: '`MARKETING`, `UTILITY` or `AUTHENTICATION`.'
        components:
          type: array
          items:
            $ref: '#/components/schemas/TemplateComponent'
        parameter_format:
          type: string
          description: '`POSITIONAL` or `NAMED`.'
    TemplateComponent:
      type: object
      description: A template component as Meta returns it.
      additionalProperties: true
      required:
        - type
      properties:
        type:
          type: string
          description: Such as `HEADER`, `BODY`, `FOOTER` or `BUTTONS`.
        format:
          type: string
        text:
          type: string
        buttons:
          type: array
          items:
            type: object
            additionalProperties: true
        example:
          type: object
          additionalProperties: true
  parameters:
    PageAfter:
      name: after
      in: query
      required: false
      description: >-
        The `paging.after` of the previous page. A value that is not a Meta
        paging cursor is rejected with 422 (`ValidationError`) before Meta is
        called.
      schema:
        type: string
        pattern: ^[A-Za-z0-9+/=_-]+$
        maxLength: 1024
  responses:
    TemplatesListed:
      description: One page of Meta's templates.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TemplateList'
    ClientError:
      description: >-
        Rejected by the gateway (`GatewayError`), by the core's validation
        (`ValidationError`, 422) or by Meta (`MetaError`, with Meta's status).
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/GatewayError'
              - $ref: '#/components/schemas/ValidationError'
              - $ref: '#/components/schemas/MetaError'
    ServerError:
      description: >-
        `GatewayError` for a gateway failure (500 with `requestId`, 503 for
        missing configuration); `MetaError` for a Meta 5XX, an unreachable Meta
        (502) or a Meta timeout (504).
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/GatewayError'
              - $ref: '#/components/schemas/MetaError'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: Tenant API key.
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Tenant API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.