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

# Get a WhatsApp template

> Read one WhatsApp template as last synced from Meta: components, approval status, category, language, validity period and the WhatsApp Business Account it belongs to.

Use it to check whether a template is `APPROVED` before sending it, or to mirror Meta's view of a template into your own platform. Requires the `whatsapp:read` scope (`whatsapp:write` includes it).


## OpenAPI

````yaml get /whatsapp/templates/{templateId}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /whatsapp/templates/{templateId}:
    get:
      summary: Get a WhatsApp template
      description: >-
        The template as last synced from Meta: components, approval status,
        category, language, validity period, and the WABA it lives on.
      operationId: getWhatsappTemplate
      parameters:
        - schema:
            type: string
            minLength: 1
          in: path
          name: templateId
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsAppTemplateDetailDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    WhatsAppTemplateDetailDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/WhatsAppTemplateDetailDto'
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
            - APPROVED
            - REJECTED
            - PENDING
            - PAUSED
            - DISABLED
            - IN_APPEAL
            - PENDING_DELETION
            - DELETED
            - LIMIT_EXCEEDED
            - ARCHIVED
        category:
          type: string
          enum:
            - UTILITY
            - MARKETING
            - AUTHENTICATION
        parameter_format:
          type: string
          enum:
            - NAMED
            - POSITIONAL
        language:
          type: string
        components:
          anyOf:
            - type: array
              items:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        const: HEADER
                      format:
                        type: string
                        const: TEXT
                      text:
                        type: string
                        description: 60 chars max
                      example:
                        anyOf:
                          - type: object
                            properties:
                              header_text:
                                type: array
                                items:
                                  type: string
                            required:
                              - header_text
                            additionalProperties: false
                          - type: object
                            properties:
                              header_text_named_params:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    param_name:
                                      type: string
                                    example:
                                      type: string
                                  required:
                                    - param_name
                                    - example
                                  additionalProperties: false
                            required:
                              - header_text_named_params
                            additionalProperties: false
                    required:
                      - type
                      - format
                      - text
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: HEADER
                      format:
                        type: string
                        enum:
                          - IMAGE
                          - DOCUMENT
                          - VIDEO
                        description: |2-

                            /**
                             * IMAGE: JPG | PNG
                             * DOCUMENT: PDF
                             * VIDEO: MP4
                             */
                              
                      example:
                        type: object
                        properties:
                          header_handle:
                            anyOf:
                              - type: string
                              - type: array
                                items:
                                  type: string
                            description: |2-

                                  /**
                                   * A handle for the media uploaded through the Resumable Upload API
                                   * https://developers.facebook.com/docs/graph-api/guides/upload
                                   */
                                  
                        required:
                          - header_handle
                        additionalProperties: false
                    required:
                      - type
                      - format
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: HEADER
                      format:
                        type: string
                        const: LOCATION
                    required:
                      - type
                      - format
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: BODY
                      text:
                        type: string
                        description: >-
                          1024 chars max, or 32768 if `body` is the only
                          component in the template
                      example:
                        anyOf:
                          - type: object
                            properties:
                              body_text:
                                type: array
                                items:
                                  type: array
                                  items:
                                    type: string
                                description: >-
                                  Yes, this is an array of arrays, but only the
                                  first array is used, just like `header_text`
                            required:
                              - body_text
                            additionalProperties: false
                          - type: object
                            properties:
                              body_text_named_params:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    param_name:
                                      type: string
                                    example:
                                      type: string
                                  required:
                                    - param_name
                                    - example
                                  additionalProperties: false
                            required:
                              - body_text_named_params
                            additionalProperties: false
                    required:
                      - type
                      - text
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: FOOTER
                      text:
                        type: string
                        description: 60 chars max
                    required:
                      - type
                      - text
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: BUTTONS
                        description: |2-

                            /**
                             * Templates are limited to 10 quick reply buttons. If using quick reply buttons with other buttons,
                             * buttons must be organized into two groups: quick reply buttons and non-quick reply buttons.
                             * If grouped incorrectly, the API will return an error indicating an invalid combination.
                             *
                             * Examples of valid groupings:
                             * - Quick Reply, Quick Reply
                             * - Quick Reply, Quick Reply, URL, Phone
                             * - URL, Phone, Quick Reply, Quick Reply
                             *
                             * Examples of invalid groupings:
                             * - Quick Reply, URL, Quick Reply
                             * - URL, Quick Reply, URL
                             */
                            
                      buttons:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                type:
                                  type: string
                                  const: QUICK_REPLY
                                text:
                                  type: string
                                  description: 25 chars max
                              required:
                                - type
                                - text
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  const: URL
                                text:
                                  type: string
                                url:
                                  type: string
                                  description: 2000 chars max
                                example:
                                  type: array
                                  prefixItems:
                                    - type: string
                                      description: 2000 chars max
                                  items: false
                                  minItems: 1
                                  maxItems: 1
                              required:
                                - type
                                - text
                                - url
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  const: PHONE_NUMBER
                                text:
                                  type: string
                                  description: 25 chars max
                                phone_number:
                                  type: string
                                  description: 20 chars max
                              required:
                                - type
                                - text
                                - phone_number
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  const: COPY_CODE
                                example:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                  description: 15 chars max
                              required:
                                - type
                                - example
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  const: FLOW
                                text:
                                  type: string
                                  description: 25 chars max
                                icon:
                                  type: string
                                  enum:
                                    - DOCUMENT
                                    - PROMOTION
                                    - REVIEW
                                flow_id:
                                  type: string
                                flow_name:
                                  type: string
                                flow_json:
                                  type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties: {}
                                flow_action:
                                  type: string
                                  enum:
                                    - data_exchange
                                    - navigate
                                navigate_screen:
                                  type: string
                              required:
                                - type
                                - text
                                - icon
                                - flow_action
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  const: MPM
                                example:
                                  type: string
                              required:
                                - type
                                - example
                              additionalProperties: false
                    required:
                      - type
                      - buttons
                    additionalProperties: false
            - type: 'null'
        rejected_reason:
          type:
            - string
            - 'null'
        message_send_ttl_seconds:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        waba_id:
          type: string
          description: The WhatsApp Business Account the template belongs to.
      required:
        - id
        - name
        - status
        - category
        - parameter_format
        - language
        - waba_id
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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