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

# Ads summary

> Click-to-WhatsApp traffic grouped **by ad**, with the resolved ad, ad set and campaign names and the number of Meta Lead Ads leads each ad produced (`leadCount`). Newest-busiest first: ordered by `conversations`, then `lastAt`.

**Permission: `analytics:read`**, which every workspace role holds, ANALYST included — it is volume, not conversation content (compare [`GET /v1/referrals/summary`](/api/referrals), which needs `chat:read` and covers one number). **Scope:** a number-scoped key, or an account-wide credential with `x-whatsapp-number-id`, reports that number only; an account-wide credential without the header reports the whole workspace, and may narrow it with the `whatsappNumberId` query parameter.

`conversations` counts distinct conversations and `messages` counts messages, separately. `lastHeadline` and `lastSourceUrl` (the ad copy) are `null` for an ad seen only on a RELAY_ONLY number; the counts are unaffected. `namesResolvedAt` set with every name `null` means Pilot Status asked Meta and got nothing (ask the advertiser for the partner grant); `null` means it was not asked yet. Capped at 200 ads: `truncated: true` says the list was cut — narrow with `startDate`/`endDate`. An ad that produced leads but never a conversation has no row here; read it from [`GET /v1/leads`](/api/leads).



## OpenAPI

````yaml openapi.json GET /v1/ads/summary
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/ads/summary:
    get:
      tags:
        - Ads
      summary: Ads summary
      description: >-
        Click-to-WhatsApp traffic grouped **by ad**, with the resolved ad, ad
        set and campaign names and the number of Meta Lead Ads leads each ad
        produced (`leadCount`). Newest-busiest first: ordered by
        `conversations`, then `lastAt`.


        **Permission: `analytics:read`**, which every workspace role holds,
        ANALYST included — it is volume, not conversation content (compare [`GET
        /v1/referrals/summary`](/api/referrals), which needs `chat:read` and
        covers one number). **Scope:** a number-scoped key, or an account-wide
        credential with `x-whatsapp-number-id`, reports that number only; an
        account-wide credential without the header reports the whole workspace,
        and may narrow it with the `whatsappNumberId` query parameter.


        `conversations` counts distinct conversations and `messages` counts
        messages, separately. `lastHeadline` and `lastSourceUrl` (the ad copy)
        are `null` for an ad seen only on a RELAY_ONLY number; the counts are
        unaffected. `namesResolvedAt` set with every name `null` means Pilot
        Status asked Meta and got nothing (ask the advertiser for the partner
        grant); `null` means it was not asked yet. Capped at 200 ads:
        `truncated: true` says the list was cut — narrow with
        `startDate`/`endDate`. An ad that produced leads but never a
        conversation has no row here; read it from [`GET
        /v1/leads`](/api/leads).
      operationId: get_ads-summary
      parameters:
        - name: x-whatsapp-number-id
          in: header
          required: false
          description: >-
            Narrows an account-wide credential to one number (its id or instance
            id from `GET /v1/numbers`). Without it, an account-wide credential
            sees the whole workspace; a number-scoped key always sees only its
            own number.
          schema:
            type: string
          example: num_01HZX...
        - name: whatsappNumberId
          in: query
          required: false
          description: >-
            Restrict to one number inside the credential's scope (`403
            NUMBER_NOT_IN_GRANT` otherwise).
          schema:
            type: string
          example: num_01HZX...
        - name: startDate
          in: query
          required: false
          description: >-
            Start of the range (ISO 8601), over the message time — and the
            lead's Meta creation time for `leadCount`. Must be ≤ endDate.
          schema:
            type: string
            format: date-time
          example: '2026-10-01T00:00:00Z'
        - name: endDate
          in: query
          required: false
          description: End of the range (ISO 8601), inclusive.
          schema:
            type: string
            format: date-time
          example: '2026-10-21T23:59:59Z'
      responses:
        '200':
          description: Per-ad summary
          content:
            application/json:
              example:
                ads:
                  - sourceId: '120249828053880703'
                    sourceType: ad
                    conversations: 37
                    messages: 214
                    firstAt: '2026-10-02T11:04:19.000Z'
                    lastAt: '2026-10-20T22:41:07.000Z'
                    lastSourceUrl: https://fb.me/2bXyZ
                    lastHeadline: Reforma com 70% de desconto
                    adName: Ads 01 - Vídeo dos 70%
                    adsetId: '120249828053880001'
                    adsetName: '[IG] [LL1% IG + VÍDEOS] - 35 a 50'
                    campaignId: '120249828053870000'
                    campaignName: '[CD-01] [LEADS] - MM Design - Sale 70%'
                    namesResolvedAt: '2026-10-20T23:00:02.000Z'
                    leadCount: 12
                total: 1
                limit: 200
                truncated: false
        '400':
          description: >-
            Invalid date range (`INVALID_DATE_RANGE`), or `NUMBER_REQUIRED` (a
            per-number OAuth grant without `x-whatsapp-number-id`) or
            `NUMBER_NOT_FOUND` (a number-scoped key whose number was deleted)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  startDate must be before or equal to endDate | Intervalo de
                  datas inválido (use ISO 8601, startDate <= endDate)
                code: INVALID_DATE_RANGE
        '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: >-
            The number is outside the credential's scope
            (`NUMBER_NOT_IN_GRANT`), or an OAuth token whose workspace role
            lacks `analytics:read` (`PERMISSION_DENIED`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  This credential is not granted access to that WhatsApp number
                  | Esta credencial não tem acesso a esse número de WhatsApp
                code: NUMBER_NOT_IN_GRANT
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Internal server error | Erro interno do servidor
                code: INTERNAL_ERROR
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.