> ## 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.

# Consultar template

> Retorna um template com o `status` de aprovação atual. Se ele foi rejeitado, `rejection_reason` indica o motivo.



## OpenAPI

````yaml openapi.json GET /v1/templates/{id}
openapi: 3.0.3
info:
  title: API da Routa
  description: >-
    API REST para enviar e receber mensagens de WhatsApp, acompanhar a entrega e
    receber eventos normalizados por webhook.
  version: '1'
servers:
  - url: https://api.routa.chat
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: Mensagens
    description: Envie, consulte e liste mensagens.
  - name: Eventos
    description: Consulte o log de eventos normalizados.
  - name: Webhooks
    description: Gerencie endpoints de webhook, segredos e entregas.
  - name: Templates
    description: Submeta e consulte templates de WhatsApp.
  - name: Mídia
    description: Envie e obtenha arquivos de mídia.
  - name: Uso
    description: Consulte o uso medido do projeto.
  - name: Identidade
    description: Identifique a chave de API em uso.
paths:
  /v1/templates/{id}:
    get:
      tags:
        - Templates
      summary: Consultar template
      description: >-
        Retorna um template com o `status` de aprovação atual. Se ele foi
        rejeitado, `rejection_reason` indica o motivo.
      operationId: retrieveTemplate
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
          description: Identificador do template (`tmpl_...`).
      responses:
        '200':
          description: Sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '401':
          description: >-
            Chave de API ausente, inválida, revogada ou expirada
            (`api_key_invalid`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: A chave não tem o escopo necessário (`insufficient_scope`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: O recurso não existe ou pertence a outro projeto
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Limite de taxa excedido. Veja o header `Retry-After`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth:
            - templates:read
components:
  schemas:
    Template:
      type: object
      properties:
        id:
          type: string
          description: Identificador do template.
          example: tmpl_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        channel:
          type: string
          description: Canal ao qual o template pertence.
          example: chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        name:
          type: string
          description: Nome do template.
          example: confirmacao_pedido
        language:
          type: string
          description: Código de idioma.
          example: pt_BR
        category:
          type: string
          enum:
            - marketing
            - utility
            - authentication
          description: 'Categoria: `marketing`, `utility` ou `authentication`.'
        variables:
          type: array
          items:
            type: object
            required:
              - index
            properties:
              index:
                type: number
          description: Placeholders posicionais do corpo (`{{1}}`, `{{2}}`, …).
        components:
          type: object
          properties:
            header:
              oneOf:
                - type: object
                  required:
                    - kind
                    - text
                  properties:
                    kind:
                      type: string
                      enum:
                        - text
                    text:
                      type: string
                - type: object
                  required:
                    - kind
                    - format
                    - media_id
                  properties:
                    kind:
                      type: string
                      enum:
                        - media
                    format:
                      type: string
                      enum:
                        - image
                        - video
                        - document
                    media_id:
                      type: string
            footer:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
            buttons:
              type: array
              items:
                oneOf:
                  - type: object
                    required:
                      - kind
                      - text
                    properties:
                      kind:
                        type: string
                        enum:
                          - quick_reply
                      text:
                        type: string
                  - type: object
                    required:
                      - kind
                      - text
                      - phone_number
                    properties:
                      kind:
                        type: string
                        enum:
                          - phone_number
                      text:
                        type: string
                      phone_number:
                        type: string
                  - type: object
                    required:
                      - kind
                      - text
                      - url
                    properties:
                      kind:
                        type: string
                        enum:
                          - url
                      text:
                        type: string
                      url:
                        type: string
          description: Cabeçalho, rodapé e botões do template, quando existirem.
        status:
          type: string
          enum:
            - draft
            - submitted
            - pending
            - approved
            - rejected
            - paused
            - disabled
          description: Estado de aprovação. Somente `approved` permite enviar.
        rejection_reason:
          type: string
          enum:
            - abusive_content
            - incorrect_category
            - invalid_format
            - scam
            - tag_content_mismatch
            - other
          nullable: true
          description: Motivo da rejeição, quando `status` é `rejected`.
        created_at:
          format: date-time
          type: string
          description: Quando o template foi criado.
          example: '2026-09-04T13:22:41.031Z'
        updated_at:
          format: date-time
          type: string
          description: Quando o template foi atualizado pela última vez.
          example: '2026-09-04T13:22:41.031Z'
      required:
        - id
        - channel
        - name
        - language
        - category
        - variables
        - status
        - rejection_reason
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: >-
                Categoria do erro: `invalid_request_error`,
                `authentication_error`, `permission_error`, `not_found_error`,
                `conflict_error`, `rate_limit_error`, `billing_error` ou
                `api_error`.
              example: invalid_request_error
            code:
              type: string
              description: >-
                Código estável e legível por máquina. Veja [Códigos de
                erro](/errors/error-codes).
              example: channel_inactive
            message:
              type: string
              description: >-
                Texto para humanos, em inglês. Pode mudar, então não faça parse
                dele.
              example: Channel chan_01J8... is not active and cannot send messages.
            param:
              type: string
              description: O campo da requisição com problema, quando se aplica.
            doc_url:
              type: string
              description: Link para a documentação do código, quando disponível.
            details:
              type: object
              additionalProperties:
                oneOf:
                  - type: string
                  - type: number
              description: >-
                Valores acionáveis, como `limit`, `used` e `resets_at` em
                `message_quota_exceeded`.
            request_id:
              type: string
              description: Identificador da requisição. Informe-o ao falar com o suporte.
              example: req_01J8ZK9M3Q7XABCDEFGHJKMNPQ
          description: Detalhes do erro.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Chave de API do projeto, no formato `rt_live_...` ou `rt_test_...`,
        enviada como `Authorization: Bearer <chave>`.

````

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