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

# Get Templates

> Lists an application's WhatsApp templates with cursor pagination, status / category / language filters, name-or-content search, and optional component expansion.

Read fresh directly from Meta, with no caching.

**Pagination.** Do not pass a cursor on the first request. Take `pagingMetadata.nextCursor` from the response and send it as `after` on the next one. An empty result returns `"data": []` with `pageSize: 0`.



## OpenAPI

````yaml /public-openapi.json get /wa/{app_id}/templates
openapi: 3.0.3
info:
  title: Connexease Public API
  version: 1.0.0
  description: >-
    Panel-independent API for managing WhatsApp Business operations from your
    own servers.


    Every endpoint is scoped to the organization resolved from your secret key.
    Read endpoints are uncached and proxy straight to the source.


    **On-premises installations** are served from your own domain with an extra
    `/public` segment: `https://{your_domain}/public/api/v1/...`.
    Authentication, bodies, responses, and error codes are identical.
servers:
  - url: https://public-api.gateway.connexease.com/api/v1
    description: Production
security:
  - secretKey: []
tags:
  - name: Analytics
    description: Organization-wide message volume.
  - name: Application
    description: The WhatsApp business profile linked to an application.
  - name: Template
    description: >-
      The full template lifecycle: create, list, inspect, update, delete, and
      measure.
  - name: Media
    description: >-
      Uploads that produce the single-use handle for template headers and the
      profile picture.
  - name: Developers
    description: Webhook configuration and API keys.
paths:
  /wa/{app_id}/templates:
    get:
      tags:
        - Template
      summary: Get Templates
      description: >-
        Lists an application's WhatsApp templates with cursor pagination, status
        / category / language filters, name-or-content search, and optional
        component expansion.


        Read fresh directly from Meta, with no caching.


        **Pagination.** Do not pass a cursor on the first request. Take
        `pagingMetadata.nextCursor` from the response and send it as `after` on
        the next one. An empty result returns `"data": []` with `pageSize: 0`.
      operationId: getTemplates
      parameters:
        - $ref: '#/components/parameters/AppId'
        - name: limit
          in: query
          required: false
          description: Maximum records per page.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: after
          in: query
          required: false
          description: >-
            Next-page cursor — the `nextCursor` from a previous response. Do not
            pass it on the first request.
          schema:
            type: string
        - name: before
          in: query
          required: false
          description: >-
            Previous-page cursor — the `previousCursor` from a response. Cannot
            be combined with `after`.
          schema:
            type: string
        - name: status
          in: query
          required: false
          description: Status filter. Any other value returns `422`.
          schema:
            $ref: '#/components/schemas/TemplateStatus'
        - name: category
          in: query
          required: false
          description: Category filter. Any other value returns `422`.
          schema:
            $ref: '#/components/schemas/TemplateCategory'
        - name: language
          in: query
          required: false
          description: >-
            Language filter, a BCP-47 code such as `en` or `tr`. Unlike the
            `language` field on create, this filter is a plain string passed to
            Meta as-is and is not restricted to the closed language list.
          schema:
            type: string
        - name: search
          in: query
          required: false
          description: >-
            Meta `name_or_content` search — matches the template name or its
            body text.
          schema:
            type: string
        - name: expand
          in: query
          required: false
          description: >-
            Repeatable. `components` also returns the components, which are
            omitted by default. Any other value is rejected with `422`.
          schema:
            type: array
            items:
              type: string
              enum:
                - components
          style: form
          explode: true
      responses:
        '200':
          description: A page of templates plus its paging metadata.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Template'
                  pagingMetadata:
                    $ref: '#/components/schemas/PagingMetadata'
                  isSuccess:
                    type: boolean
                    enum:
                      - true
              example:
                data:
                  - sourceId: '842802041844912'
                    name: order_confirmation
                    language: en
                    category: UTILITY
                    status: APPROVED
                    qualityScore: GREEN
                    rejectedReason: NONE
                    parameterFormat: POSITIONAL
                pagingMetadata:
                  nextCursor: MAZDZDhYbVZ3PQ
                  hasNext: true
                  hasPrevious: false
                  pageSize: 1
                isSuccess: true
        '400':
          description: Meta rejected a parameter (`META_037`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: >-
            Secret key missing or invalid (`ORGANIZATION_SECRET_010` / `011`),
            or Meta token invalid or expired (`META_034`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Meta permission denied (`META_035`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          $ref: '#/components/responses/AppNotFound'
        '422':
          description: >-
            `limit` outside 1–100, or an invalid `status`, `category`, or
            `expand` value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Meta rate limit (`META_036`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '502':
          description: General Meta-side listing failure (`META_004`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  parameters:
    AppId:
      name: app_id
      in: path
      required: true
      description: >-
        Application ID. Must belong to the organization resolved from your
        secret key, otherwise the request returns `404` with `APPLICATION_004`.
      schema:
        type: string
        example: app_7poyXj8GXuv76e
  schemas:
    TemplateStatus:
      type: string
      description: >-
        Review and lifecycle status. `UNKNOWN` means Meta reported a status this
        API does not recognise.
      enum:
        - APPROVED
        - PENDING
        - REJECTED
        - PAUSED
        - DISABLED
        - IN_APPEAL
        - PENDING_DELETION
        - DELETED
        - LIMIT_EXCEEDED
        - UNKNOWN
    TemplateCategory:
      type: string
      description: >-
        Determines which components are allowed. `UTILITY` for transactional
        messages, `MARKETING` for promotional, `AUTHENTICATION` for one-time
        passcodes.
      enum:
        - UTILITY
        - MARKETING
        - AUTHENTICATION
    Template:
      type: object
      description: >-
        Null fields (`id`, `createdAt`, `updatedAt`, `messageSendTtlSeconds`,
        `correctCategory`, `previousCategory`) are dropped from the response.
      properties:
        sourceId:
          type: string
          description: The template's Meta ID.
        name:
          type: string
        language:
          type: string
        category:
          $ref: '#/components/schemas/TemplateCategory'
        status:
          $ref: '#/components/schemas/TemplateStatus'
        components:
          type: array
          items:
            $ref: '#/components/schemas/TemplateComponent'
          description: Returned only with `expand=components`.
        qualityScore:
          $ref: '#/components/schemas/TemplateQualityScore'
        rejectedReason:
          $ref: '#/components/schemas/TemplateRejectedReason'
        parameterFormat:
          $ref: '#/components/schemas/TemplateParameterFormat'
    PagingMetadata:
      type: object
      properties:
        nextCursor:
          type: string
          nullable: true
        previousCursor:
          type: string
          nullable: true
        hasNext:
          type: boolean
        hasPrevious:
          type: boolean
        pageSize:
          type: integer
    ErrorEnvelope:
      type: object
      description: >-
        Every failure shares this shape. `description` already has any `params`
        interpolated into it.
      properties:
        isSuccess:
          type: boolean
          enum:
            - false
        errors:
          type: object
          properties:
            code:
              type: string
              description: >-
                `VAL_*`, `WA_*`, `META_*`, `APPLICATION_*`,
                `ORGANIZATION_SECRET_*`, `REQ_001`, or `SYS_001`.
              example: META_075
            group:
              type: string
              enum:
                - VALIDATION
                - NOT_FOUND
                - CONFLICT
                - AUTHENTICATION
                - NOT_ALLOWED
                - LIMIT_EXCEEDED
                - SERVICE_UNAVAILABLE
                - SYSTEM
            description:
              type: string
              example: Template with 0000000000 not found in Meta.
            params:
              type: object
              additionalProperties: true
              description: >-
                Raw values interpolated into `description`. Present only on
                parametric messages.
            fields:
              type: object
              description: >-
                Field-level validation errors only. Field name (dot-joined for
                nested fields, list indices omitted) to its own `code` /
                `description` / `params`.
              additionalProperties:
                type: object
                properties:
                  code:
                    type: string
                  description:
                    type: string
                  params:
                    type: object
                    additionalProperties: true
          required:
            - code
            - group
            - description
      required:
        - isSuccess
        - errors
    TemplateComponent:
      type: object
      description: >-
        One component. Every field other than `type` is dropped when Meta does
        not report it.
      properties:
        type:
          type: string
          enum:
            - HEADER
            - BODY
            - FOOTER
            - BUTTONS
            - CAROUSEL
            - LIMITED_TIME_OFFER
        format:
          type: string
          enum:
            - TEXT
            - IMAGE
            - VIDEO
            - DOCUMENT
            - LOCATION
            - CAROUSEL
          description: >-
            `HEADER` only. A response header never reports `NONE` — the
            component is simply absent — but may report `CAROUSEL` for a
            carousel template.
        text:
          type: string
          description: '`HEADER` with `format: TEXT`, `BODY`, or `FOOTER`.'
        example:
          $ref: '#/components/schemas/ComponentExample'
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/ComponentButton'
          description: '`BUTTONS` only.'
        cards:
          type: array
          description: >-
            `CAROUSEL` only. One entry per card, each holding its own
            `components` array limited to `HEADER`, `BODY`, and `BUTTONS`.
          items:
            type: object
            properties:
              components:
                type: array
                items:
                  $ref: '#/components/schemas/CardComponent'
        addSecurityRecommendation:
          type: boolean
          description: '`BODY` of an `AUTHENTICATION` template.'
        codeExpirationMinutes:
          type: integer
          description: '`FOOTER` of an `AUTHENTICATION` template.'
        limitedTimeOffer:
          $ref: '#/components/schemas/LimitedTimeOffer'
      required:
        - type
    TemplateQualityScore:
      type: string
      description: Quality rating derived by Meta from user feedback.
      enum:
        - GREEN
        - YELLOW
        - RED
        - UNKNOWN
    TemplateRejectedReason:
      type: string
      enum:
        - NONE
        - ABUSIVE_CONTENT
        - INVALID_FORMAT
        - PROMOTIONAL
        - TAG_CONTENT_MISMATCH
        - SCAM
        - INCORRECT_CATEGORY
        - UNKNOWN
    TemplateParameterFormat:
      type: string
      description: How variables are referenced within the template.
      enum:
        - POSITIONAL
        - NAMED
        - UNKNOWN
    ComponentExample:
      type: object
      description: Sample values Meta stores for the component's variables or media.
      properties:
        headerText:
          type: array
          items:
            type: string
          description: Sample values for the `TEXT` header variables.
        headerHandle:
          type: array
          items:
            type: string
          description: The media handle behind an `IMAGE` / `VIDEO` / `DOCUMENT` header.
        headerUrl:
          type: array
          items:
            type: string
          description: The resolved media URL, when Meta returns one instead of a handle.
        bodyText:
          type: array
          items:
            type: array
            items:
              type: string
          description: >-
            Sample values for the body variables — a list of value sets, so
            nested one level deeper than `headerText`.
    ComponentButton:
      type: object
      description: >-
        A button as Meta reports it. Note the snake_case keys — they differ from
        the camelCase keys used when creating a template.
      properties:
        type:
          type: string
          enum:
            - URL
            - PHONE_NUMBER
            - QUICK_REPLY
            - COPY_CODE
            - OTP
        text:
          type: string
          description: The label shown on the button.
        url:
          type: string
          description: '`URL` buttons: the target link, possibly containing `{{1}}`.'
        phone_number:
          type: string
          description: >-
            `PHONE_NUMBER` buttons. Meta returns RFC3966 form
            (`tel:+90-555-123-45-67`), not the E.164 form you sent.
        example:
          type: array
          items:
            type: string
          description: The dynamic-URL sample, or the `COPY_CODE` coupon code.
        otp_type:
          type: string
          enum:
            - COPY_CODE
            - ONE_TAP
            - ZERO_TAP
        autofill_text:
          type: string
        package_name:
          type: string
        signature_hash:
          type: string
        zero_tap_terms_accepted:
          type: boolean
    CardComponent:
      type: object
      description: >-
        A component inside a carousel card. A card is a reduced template: no
        footer, no limited-time offer.
      properties:
        type:
          type: string
          enum:
            - HEADER
            - BODY
            - BUTTONS
        format:
          type: string
          enum:
            - IMAGE
            - VIDEO
          description: '`HEADER` only.'
        text:
          type: string
          description: '`BODY` only.'
        example:
          $ref: '#/components/schemas/ComponentExample'
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/ComponentButton'
    LimitedTimeOffer:
      type: object
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 16
          description: Offer text on the banner, e.g. `Expiring offer!`.
        hasExpiration:
          type: boolean
          default: false
          description: >-
            When `true`, WhatsApp renders a countdown. This only controls
            whether the countdown is shown — the expiration timestamp itself is
            supplied per message at send time, so one approved template can
            serve different deadlines.
      required:
        - text
  responses:
    AppNotFound:
      description: '`app_id` does not belong to the organization (`APPLICATION_004`).'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Secret key in `Bearer sk_...` format. Server-to-server only — never
        embed it in a browser or mobile client. The organization is resolved
        from the key, so `organization_id` is never passed explicitly.

````