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

# Retrieve template

> Returns a template with its current approval `status`. If it was rejected, `rejection_reason` gives the reason. If Routa could not send it to WhatsApp (`status: failed`), `failure_code` gives the reason and `failure_detail` carries the provider's own sentence, when it gave one. Through the API, you have to create the template again. In the dashboard, a `failed` or `rejected` template can be edited and sent again.

While a deletion requested in the dashboard is in progress, `deletion_requested` is `true` and the template cannot be used to send.



## OpenAPI

````yaml en/openapi.json GET /v1/templates/{id}
openapi: 3.0.3
info:
  title: Routa API
  description: >-
    REST API to send and receive WhatsApp messages, track delivery and receive
    normalized events through webhooks.
  version: '1'
servers:
  - url: https://api.routa.chat
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send, retrieve and list messages.
  - name: Events
    description: Query the log of normalized events.
  - name: Webhooks
    description: Manage webhook endpoints, secrets and deliveries.
  - name: Templates
    description: Create and retrieve WhatsApp templates.
  - name: Media
    description: Upload and download media files.
  - name: Usage
    description: Query the metered usage of the project.
  - name: Identity
    description: Identify the API key in use.
  - name: Partners
    description: >-
      Create one project per customer, issue the key of each project, follow the
      channels and receive the events of every customer on a single webhook.
      These routes use a partner key (`rt_partner_...`). See [Partner
      API](/en/partners/overview).
paths:
  /v1/templates/{id}:
    get:
      tags:
        - Templates
      summary: Retrieve template
      description: >-
        Returns a template with its current approval `status`. If it was
        rejected, `rejection_reason` gives the reason. If Routa could not send
        it to WhatsApp (`status: failed`), `failure_code` gives the reason and
        `failure_detail` carries the provider's own sentence, when it gave one.
        Through the API, you have to create the template again. In the
        dashboard, a `failed` or `rejected` template can be edited and sent
        again.


        While a deletion requested in the dashboard is in progress,
        `deletion_requested` is `true` and the template cannot be used to send.
      operationId: retrieveTemplate
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
          description: Template ID (`tmpl_...`).
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '401':
          description: >-
            The API key is missing, invalid, revoked or expired
            (`api_key_invalid`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key lacks the required scope (`insufficient_scope`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The resource does not exist or belongs to another project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded. See the `Retry-After` header
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth:
            - templates:read
components:
  schemas:
    Template:
      type: object
      properties:
        id:
          type: string
          description: Template ID.
          example: tmpl_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        channel:
          type: string
          description: Channel the template belongs to.
          example: chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        name:
          type: string
          description: Template name.
          example: order_confirmation
        language:
          type: string
          description: The WhatsApp language code, such as `pt_BR` or `en_US`.
          example: en_US
        category:
          type: string
          enum:
            - marketing
            - utility
            - authentication
          description: 'Category: `marketing`, `utility` or `authentication`.'
        body_text:
          type: string
          nullable: true
          description: >-
            The template body, with the `{{1}}`, `{{2}}`, … placeholders. It is
            `null` only on an imported, read-only template (`read_only`), which
            Routa cannot reproduce.
          example: Hi {{1}}! Your order {{2}} is confirmed.
        variables:
          type: array
          items:
            type: object
            required:
              - index
            properties:
              index:
                type: number
                description: The number of the variable, starting at 1.
                example: 1
              example:
                type: string
                description: >-
                  The example written for the variable. Absent when the template
                  has none for it, such as an imported template or one created
                  before examples were required.
                example: Ana
          description: Positional placeholders of the body (`{{1}}`, `{{2}}`, …).
        components:
          type: object
          properties:
            header:
              oneOf:
                - type: object
                  required:
                    - kind
                    - text
                  properties:
                    kind:
                      type: string
                      enum:
                        - text
                      description: Always `text` on a text header.
                    text:
                      type: string
                      description: Header text.
                    example:
                      type: string
                      description: >-
                        The example of the header variable. Absent when there is
                        no variable or no example.
                - type: object
                  required:
                    - kind
                    - format
                    - media_id
                  properties:
                    kind:
                      type: string
                      enum:
                        - media
                      description: Always `media` on a media header.
                    format:
                      type: string
                      enum:
                        - image
                        - video
                        - document
                      description: 'Media format: `image`, `video` or `document`.'
                    media_id:
                      type: string
                      description: ID (`tmedia_...`) of the header sample file.
              description: >-
                Template header: text (`kind: text`) or media (`kind: media`).
                Absent when the template has no header.
            footer:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  description: Footer text.
              description: Template footer. Absent when the template has none.
            buttons:
              type: array
              items:
                oneOf:
                  - type: object
                    required:
                      - kind
                      - text
                    properties:
                      kind:
                        type: string
                        enum:
                          - quick_reply
                        description: 'Always `quick_reply`: a quick reply button.'
                      text:
                        type: string
                        description: Button text.
                  - type: object
                    required:
                      - kind
                      - text
                      - phone_number
                    properties:
                      kind:
                        type: string
                        enum:
                          - phone_number
                        description: 'Always `phone_number`: a button that calls a number.'
                      text:
                        type: string
                        description: Button text.
                      phone_number:
                        type: string
                        description: The number the button calls.
                  - type: object
                    required:
                      - kind
                      - text
                      - url
                    properties:
                      kind:
                        type: string
                        enum:
                          - url
                        description: 'Always `url`: a button that opens an address.'
                      text:
                        type: string
                        description: Button text.
                      url:
                        type: string
                        description: >-
                          Address the button opens. It can have the `{{1}}`
                          variable, at the end.
                      example:
                        type: string
                        description: >-
                          The example of the URL's `{{1}}`. Absent when there is
                          no variable or no example.
              description: Template buttons, in order. Absent when the template has none.
          description: >-
            Header, footer and buttons of the template. The field is omitted,
            not empty, on a body-only template.
        status:
          type: string
          enum:
            - draft
            - submitted
            - pending
            - approved
            - rejected
            - paused
            - disabled
            - failed
          description: >-
            Approval state. Only `approved` allows sending. `rejected` means the
            provider reviewed the template and refused it. `failed` means Routa
            could not send it to the provider. A `failed` or `rejected` template
            can be edited and sent again in the dashboard, and then goes back to
            `submitted`.
        rejection_reason:
          type: string
          enum:
            - abusive_content
            - incorrect_category
            - invalid_format
            - scam
            - tag_content_mismatch
            - other
          nullable: true
          description: Reason for the rejection, when `status` is `rejected`.
        failure_code:
          type: string
          enum:
            - provider_unavailable
            - provider_auth_failed
            - provider_rejected_request
            - channel_unavailable
            - media_unavailable
            - attempts_exhausted
          nullable: true
          description: >-
            Why it could not be sent for approval, when `status` is `failed`.
            `null` in every other status.
          example: null
        failure_detail:
          type: string
          nullable: true
          description: >-
            Only when `status` is `failed` and the provider explained why: its
            own sentence, written for a person and often in the language of the
            account. It is informational text. Never compare against it; use
            `failure_code`. `null` otherwise.
          example: null
        deletion_requested:
          type: boolean
          description: >-
            `true` from the moment a deletion is accepted (made in the
            dashboard) until Routa finishes deleting the template on WhatsApp.
            In between, the template cannot be used to send, and a message that
            cites it returns `422 template_not_sendable`. `false` otherwise.
          example: false
        deletion_failure_detail:
          type: string
          nullable: true
          description: >-
            Why the last deletion ended without deleting the template, in the
            provider's own sentence when it gave one. It is informational text.
            `null` when no deletion failed.
          example: null
        origin:
          type: string
          enum:
            - routa
            - provider
          description: >-
            Who created the template: `routa` for a template created by Routa,
            `provider` for one that already existed on WhatsApp and was
            imported.
          example: routa
        read_only:
          type: boolean
          description: >-
            `true` for an imported template that Routa cannot reproduce. Sending
            a message with it returns `422 template_not_sendable`. Always
            `false` when `origin` is `routa`.
          example: false
        unsupported_components:
          type: array
          items:
            type: string
            enum:
              - named_parameters
              - media_header
              - location_header
              - carousel
              - flow_button
              - otp_button
              - copy_code_button
              - catalog
              - limited_time_offer
              - other
          description: >-
            Components of an imported template that Routa cannot reproduce.
            Empty when `read_only` is `false`.
          example: []
        created_at:
          format: date-time
          type: string
          description: When the template was created.
          example: '2026-09-04T13:22:41.031Z'
        updated_at:
          format: date-time
          type: string
          description: When the template was last updated.
          example: '2026-09-04T13:22:41.031Z'
      required:
        - id
        - channel
        - name
        - language
        - category
        - body_text
        - variables
        - status
        - rejection_reason
        - failure_code
        - failure_detail
        - deletion_requested
        - deletion_failure_detail
        - origin
        - read_only
        - unsupported_components
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: >-
                Error category: `invalid_request_error`, `authentication_error`,
                `permission_error`, `not_found_error`, `conflict_error`,
                `rate_limit_error`, `billing_error` or `api_error`.
              example: invalid_request_error
            code:
              type: string
              description: >-
                Stable, machine-readable code. See [Error
                codes](/en/errors/error-codes).
              example: channel_inactive
            message:
              type: string
              description: >-
                Human-readable text, in English. It can change, so do not parse
                it.
              example: Channel chan_01J8... is not active and cannot send messages.
            param:
              type: string
              description: >-
                The request field at fault, when it applies. It is filled in on
                `request_invalid` (the field outside the schema, such as
                `template.button_parameters.0.index`) and on template errors:
                `name` in `template_name_invalid`; `body_text`,
                `components.header`, `components.footer` or `components.buttons`
                in `template_components_invalid`; and `variable_examples`,
                `variable_examples.<position>`, `components.header.example` or
                `components.buttons.<position>.example` when
                `template_variables_invalid` refuses an example.
              example: components.buttons.0.example
            doc_url:
              type: string
              description: Link to the documentation of the code, when available.
            details:
              type: object
              additionalProperties:
                oneOf:
                  - type: string
                  - type: number
              description: >-
                Actionable values, such as `limit`, `used` and `resets_at` in
                `message_quota_exceeded`, or `reason`, which tells apart the
                causes behind one code, in errors such as `invalid_recipient`
                and `template_variables_invalid`. See [Actionable
                details](/en/errors/overview#actionable-details).
            request_id:
              type: string
              description: Request ID. Quote it when you contact support.
              example: req_01J8ZK9M3Q7XABCDEFGHJKMNPQ
          description: Error details.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Project API key, in the format `rt_live_...` or `rt_test_...`, sent as
        `Authorization: Bearer <key>`.

````

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