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

# Campaign statistics

> Show send counts and campaign performance.



## OpenAPI

````yaml /en/contacts-api/api-reference/openapi-contacts.json get /v1/campaigns/{campaignId}/stats
openapi: 3.0.3
info:
  title: Notifique API Contatos, tags e audiência
  description: >-
    API para **CRUD de contatos**, **tags**, **tópicos**, **segmentos** e
    **campanhas** (template + audiência + canais).


    **Contato:** pelo menos um de **phone** ou **email** (únicos por workspace).
    **Idiomas:** `languages` é um array de códigos BCP-47 permitidos (lista em
    **`GET /v1/meta/contact-locales`**); ordem = prioridade. **Telegram:** use
    **`telegramLinks`** (`instanceId` + `peer`) para várias instâncias Telegram
    no mesmo workspace; **`telegramPeer`** permanece como atalho legado
    (preenche a ligação na **instância Telegram padrão** do workspace). Na
    campanha, o peer usado é o da **`telegramInstanceId`** da campanha (ou
    default), com *fallback* para `telegramPeer`.


    **Campanhas:** `channels` pode incluir `whatsapp`, `sms`, `email`,
    `telegram`. Cada canal listado deve estar **habilitado no template**.
    **`instanceId`** = WhatsApp; **`telegramInstanceId`** = Telegram.


    **WhatsApp cartão:** `POST /v1/whatsapp/messages` com `type: "contact"` e
    `payload.contactId`.


    **Autenticação:** `Authorization: Bearer sk_live_xxxxx` ou `x-api-key`.


    **Escopos:** `contacts:*`, `tags:*`, `topics:*`, `segments:*`, `campaigns:*`
    (inclui `campaigns:run`).


    **Campaign extras:** `POST .../cancel` (DRAFT/SCHEDULED), `GET .../stats`
    and `GET .../recipients` (update/read scopes). Run returns `runId`. WhatsApp
    Sending Pool: dashboard.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Production
security:
  - ntfContactBearerAuth: []
  - ntfContactApiKeyHeader: []
tags:
  - name: Contatos
    description: CRUD de contatos do workspace (phone ou email; tags)
  - name: Tags
    description: Tags (rótulos) para vincular a contatos
  - name: Tópicos
    description: Tópicos de comunicação (marketing / opt-in por tema)
  - name: Segmentos
    description: >-
      Segmentos de audiencia (DSL v1). Regras: tag, property, contactField,
      topic, receiveMarketing. Escopos segments:read|create|update|delete.
  - name: Campanhas
    description: Campanhas multicanal com template; execução via POST .../run
paths:
  /v1/campaigns/{campaignId}/stats:
    get:
      tags:
        - Campanhas
      summary: Campaign statistics
      description: Show send counts and campaign performance.
      operationId: ntfContact_getV1CampaignStats
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
        - name: runId
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_CampaignStatsResponse'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
        '402':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfContact_ErrorResponse'
components:
  schemas:
    NtfContact_CampaignStatsResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/NtfContact_CampaignStats'
    NtfContact_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: HTTP-style error label (e.g. Unauthorized, Bad Request, Not Found).
        message:
          type: string
          description: >-
            Human-readable message for end users (localized via Accept-Language
            / x-locale when applicable).
        code:
          type: string
          description: >-
            Stable API v1 code (enum). Always present on errors. Use with the
            HTTP status to decide retry or fix. See [Error
            responses](/en/guides/conceitos/resposta-de-erros).
      required:
        - success
        - error
        - message
        - code
    NtfContact_CampaignStats:
      type: object
      description: Campaign stats (four create channels)
      properties:
        campaign:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            status:
              type: string
            audienceCount:
              type: integer
              nullable: true
            startedAt:
              type: string
              format: date-time
              nullable: true
            completedAt:
              type: string
              format: date-time
              nullable: true
            lastRunAt:
              type: string
              format: date-time
              nullable: true
            scheduledFor:
              type: string
              format: date-time
              nullable: true
        run:
          type: object
          nullable: true
          properties:
            id:
              type: string
            status:
              type: string
              enum:
                - SCHEDULED
                - RUNNING
                - COMPLETED
                - FAILED
                - CANCELLED
            trigger:
              type: string
              enum:
                - MANUAL
                - SCHEDULED
            scheduledFor:
              type: string
              format: date-time
              nullable: true
            startedAt:
              type: string
              format: date-time
              nullable: true
            completedAt:
              type: string
              format: date-time
              nullable: true
            audienceCount:
              type: integer
              nullable: true
            errorMessage:
              type: string
              nullable: true
            errorLabel:
              type: string
              nullable: true
        funnel:
          type: object
          properties:
            whatsapp:
              $ref: '#/components/schemas/NtfContact_CampaignFunnelCounts'
            sms:
              $ref: '#/components/schemas/NtfContact_CampaignFunnelCounts'
            email:
              $ref: '#/components/schemas/NtfContact_CampaignFunnelCounts'
            telegram:
              $ref: '#/components/schemas/NtfContact_CampaignFunnelCounts'
        totals:
          $ref: '#/components/schemas/NtfContact_CampaignFunnelCounts'
        rates:
          type: object
          properties:
            deliveryRate:
              type: number
            readRate:
              type: number
            clickRate:
              type: number
            failureRate:
              type: number
        timeline:
          type: array
          items:
            type: object
            properties:
              hour:
                type: string
              sent:
                type: integer
              delivered:
                type: integer
              read:
                type: integer
              failed:
                type: integer
        cost:
          type: object
          properties:
            byChannel:
              type: array
              items:
                type: object
                properties:
                  channel:
                    $ref: '#/components/schemas/NtfContact_CampaignChannel'
                  count:
                    type: integer
                  credits:
                    type: number
                  cents:
                    type: integer
                  chargedAs:
                    type: string
                    nullable: true
            totalCredits:
              type: number
            totalCents:
              type: integer
        clicks:
          type: integer
        topErrors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              rawMessage:
                type: string
              count:
                type: integer
    NtfContact_CampaignFunnelCounts:
      type: object
      properties:
        queued:
          type: integer
        sent:
          type: integer
        delivered:
          type: integer
        read:
          type: integer
        clicked:
          type: integer
        responded:
          type: integer
        failed:
          type: integer
        total:
          type: integer
    NtfContact_CampaignChannel:
      type: string
      description: >-
        Campaign channel (create/update): `whatsapp`, `sms`, `email`,
        `telegram`. Must be a subset of channels enabled on the template.
        Templates may enable RCS/Push/voice; campaign create via API/dashboard
        uses these four.
      enum:
        - whatsapp
        - sms
        - email
        - telegram
  securitySchemes:
    ntfContactBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Authorization: Bearer sk_live_xxxxx'
    ntfContactApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'x-api-key: sk_live_xxxxx'

````