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

# Get template insights

> Returns Meta's delivery and engagement numbers for a template over the last `days` days (7, 30 or 90; default 30): totals of sent, delivered and read, `readRate` (read / delivered, `null` when nothing was delivered), button clicks and a daily series.

Data comes from Meta's template analytics: daily granularity, only the last 90 days, and the most recent days may still be filling in. The first call for a WhatsApp Business Account may enable template insights on that account at Meta.

Only templates submitted to Meta have insights (`409 TEMPLATE_NOT_ON_META` otherwise). Meta does not provide template insights for WhatsApp Business App / coexistence numbers (`422 TEMPLATE_INSIGHTS_UNAVAILABLE_SMB`). Same access as `GET /v1/templates/{id}`: permission `templates:read`; a number-scoped key only sees templates of its numbers.

**Requires a number-scoped key.**



## OpenAPI

````yaml openapi.json GET /v1/templates/{id}/insights
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/templates/{id}/insights:
    get:
      tags:
        - Templates
      summary: Get template insights
      description: >-
        Returns Meta's delivery and engagement numbers for a template over the
        last `days` days (7, 30 or 90; default 30): totals of sent, delivered
        and read, `readRate` (read / delivered, `null` when nothing was
        delivered), button clicks and a daily series.


        Data comes from Meta's template analytics: daily granularity, only the
        last 90 days, and the most recent days may still be filling in. The
        first call for a WhatsApp Business Account may enable template insights
        on that account at Meta.


        Only templates submitted to Meta have insights (`409
        TEMPLATE_NOT_ON_META` otherwise). Meta does not provide template
        insights for WhatsApp Business App / coexistence numbers (`422
        TEMPLATE_INSIGHTS_UNAVAILABLE_SMB`). Same access as `GET
        /v1/templates/{id}`: permission `templates:read`; a number-scoped key
        only sees templates of its numbers.


        **Requires a number-scoped key.**
      operationId: get_templates_id_insights
      parameters:
        - name: id
          in: path
          required: true
          description: Template id or name.
          schema:
            type: string
          example: boas_vindas
        - name: days
          in: query
          required: false
          description: >-
            Window in days: `7`, `30` or `90`. Defaults to `30`. Any other value
            returns `400 INVALID_DAYS`.
          schema:
            type: integer
            enum:
              - 7
              - 30
              - 90
            default: 30
          example: 30
      responses:
        '200':
          description: Template insights
          content:
            application/json:
              schema:
                type: object
                required:
                  - templateId
                  - template
                  - days
                  - totals
                  - readRate
                  - clicks
                  - daily
                properties:
                  templateId:
                    type: string
                    description: Template id.
                  template:
                    type: object
                    description: >-
                      The template's name, status, category, language and Meta
                      quality score.
                    properties:
                      name:
                        type: string
                      status:
                        type: string
                        description: >-
                          Template status at Meta. `"UNKNOWN"` when neither Meta
                          nor the local copy reports one.
                      category:
                        type: string
                      language:
                        type: string
                        description: >-
                          Template language. `""` (empty string) when neither
                          Meta nor the local copy reports one.
                      qualityScore:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Meta quality score (e.g. `GREEN`, `YELLOW`, `RED`), or
                          `null` when Meta has not rated it.
                  days:
                    type: integer
                    enum:
                      - 7
                      - 30
                      - 90
                    description: The window used.
                  totals:
                    type: object
                    description: Sums over the window.
                    properties:
                      sent:
                        type: integer
                        description: Messages sent.
                      delivered:
                        type: integer
                        description: Messages delivered.
                      read:
                        type: integer
                        description: Messages read.
                  readRate:
                    type:
                      - number
                      - 'null'
                    description: >-
                      `read / delivered`, from 0 to 1. `null` when `delivered`
                      is 0.
                  clicks:
                    type: array
                    description: Button clicks over the window, one entry per button.
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          description: >-
                            Button type reported by Meta (e.g.
                            `quick_reply_button`, `url_button`).
                        buttonContent:
                          type: string
                          description: Button text (or URL) as reported by Meta.
                        count:
                          type: integer
                          description: Clicks.
                  daily:
                    type: array
                    description: One entry per day in the window, oldest first.
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          format: date
                          description: Day (UTC), `YYYY-MM-DD`.
                        sent:
                          type: integer
                          description: Messages sent.
                        delivered:
                          type: integer
                          description: Messages delivered.
                        read:
                          type: integer
                          description: Messages read.
              example:
                templateId: tpl_01HZX...
                template:
                  name: boas_vindas
                  status: APPROVED
                  category: UTILITY
                  language: pt_BR
                  qualityScore: GREEN
                days: 7
                totals:
                  sent: 1240
                  delivered: 1198
                  read: 873
                readRate: 0.7287
                clicks:
                  - type: quick_reply_button
                    buttonContent: Quero saber mais
                    count: 112
                  - type: url_button
                    buttonContent: https://exemplo.com.br/oferta
                    count: 64
                daily:
                  - date: '2026-10-22'
                    sent: 180
                    delivered: 175
                    read: 130
                  - date: '2026-10-23'
                    sent: 172
                    delivered: 166
                    read: 121
                  - date: '2026-10-24'
                    sent: 190
                    delivered: 184
                    read: 139
                  - date: '2026-10-25'
                    sent: 160
                    delivered: 155
                    read: 110
                  - date: '2026-10-26'
                    sent: 178
                    delivered: 171
                    read: 124
                  - date: '2026-10-27'
                    sent: 185
                    delivered: 180
                    read: 129
                  - date: '2026-10-28'
                    sent: 175
                    delivered: 167
                    read: 120
        '400':
          description: '`days` is not 7, 30 or 90'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - INVALID_DAYS
              example:
                error: days must be one of 7, 30 or 90. | days deve ser 7, 30 ou 90.
                code: INVALID_DAYS
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: Tenant-scoped key used on a number-scoped endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Tenant-scoped keys cannot call number endpoints
                code: TENANT_SCOPE_NOT_ALLOWED
        '404':
          description: Template not found in the key's scope
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - TEMPLATE_NOT_FOUND
              example:
                error: Template not found. | Template não encontrado.
                code: TEMPLATE_NOT_FOUND
        '409':
          description: >-
            The template is not on Meta, or no Meta number is connected for its
            WhatsApp Business Account
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - TEMPLATE_NOT_ON_META
                      - NO_META_NUMBER_FOR_WABA
              examples:
                TEMPLATE_NOT_ON_META:
                  summary: Template not submitted to Meta
                  value:
                    error: >-
                      This template was not submitted to Meta, so it has no
                      insights. | Este template não foi enviado à Meta, então
                      não tem insights.
                    code: TEMPLATE_NOT_ON_META
                NO_META_NUMBER_FOR_WABA:
                  summary: No Meta number for the template's WABA
                  value:
                    error: >-
                      No connected Meta number on this template's WABA.
                      Reconnect a number to view insights. | Nenhum número Meta
                      conectado na WABA deste template. Reconecte um número para
                      ver os insights.
                    code: NO_META_NUMBER_FOR_WABA
        '422':
          description: >-
            Meta does not provide insights for this account, or rejected the
            request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - TEMPLATE_INSIGHTS_UNAVAILABLE_SMB
                      - META_REJECTED
              examples:
                TEMPLATE_INSIGHTS_UNAVAILABLE_SMB:
                  summary: WhatsApp Business App / coexistence account
                  value:
                    error: >-
                      Meta does not provide template insights for WhatsApp
                      Business App (SMB / coexistence) accounts. | A Meta não
                      oferece insights de template para contas do WhatsApp
                      Business App (SMB / coexistência).
                    code: TEMPLATE_INSIGHTS_UNAVAILABLE_SMB
                META_REJECTED:
                  summary: Meta rejected the request
                  value:
                    error: >-
                      Meta rejected the template insights request: (#100)
                      Invalid parameter | A Meta recusou o pedido de insights do
                      template.
                    code: META_REJECTED
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
              example:
                error: Internal server error | Erro interno do servidor
                code: INTERNAL_ERROR
        '503':
          description: Meta is temporarily unavailable — retry later
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - META_UNAVAILABLE
              example:
                error: >-
                  Meta is unavailable right now. Try again in a few minutes. | A
                  Meta está indisponível no momento. Tente novamente em alguns
                  minutos.
                code: META_UNAVAILABLE
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````

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