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

# Get consolidated campaign result



## OpenAPI

````yaml /api-reference/openapi.en.yaml get /campaigns/{id}/report
openapi: 3.0.3
info:
  title: Connecta DESK Public API
  version: 1.0.0
  description: >-
    Public API of Connecta DESK, available at `/api/v1`. Access uses a token
    generated in the tokens module. Each token has permissions per **module ×
    method**, and every list read is paginated.


    ## Authentication


    ```

    Authorization: Bearer sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

    ```


    The token belongs to a **company**, not to a user. The company used is
    always the token's company, so sending `companyId` in the body has no
    effect. A missing, invalid, revoked or expired token gets the same `401`
    response.


    ## Order of checks


    1. **token** → `401`

    2. **active company** → `403`

    3. **API enabled on the plan** → `403 ERR_API_NOT_ENABLED` (does not apply
    to on-premise)

    4. **company rate limit** → `429`

    5. **token permission** → `403 ERR_API_FORBIDDEN_SCOPE`


    ## User ids


    Every user id in the API is the user's id **in this company**, the same one
    `GET /users` returns. This applies to what the API returns (`user.id`,
    `assignedTo.id`, `userCreated.id`) and to what it accepts (`userId`,
    `userIds`, `assignedToUserId` and the `{id}` in user routes).


    The same person can work in several companies, with a different name and
    profile in each one, and has a different id in each company.


    An id that does not belong to this company returns `404`, with the same
    message as an id that does not exist.


    ## Pagination


    Every list `GET` is paginated. The `meta` contains only `page`, `perPage`
    and `hasMore`, without the total number of records. To go through
    everything, keep advancing `page` while `hasMore` is `true`.


    ## Idempotency


    Optional on `POST`/`PUT`, through the `Idempotency-Key` header. If you
    repeat the call with the same key and the same body, you get the stored
    response (with `Idempotent-Replay: true`). With the same key and a different
    body, the response is `409`.
servers:
  - url: https://api.connectadesk.com/api/v1
    description: Production
security:
  - apiToken: []
tags:
  - name: contacts
    description: Contact records, extra fields and marketing source.
  - name: tickets
    x-displayName: Tickets
    description: Opening, transferring, closing and wrap-up of tickets.
  - name: messages
    description: Asynchronous sending and reading of messages.
  - name: tags
    description: Tags and their link to tickets.
  - name: queues
    description: Service queues and their agents.
  - name: wrapups
    description: Wrap-up types.
  - name: users
    description: Agents and administrators.
  - name: schedules
    description: Scheduled messages.
  - name: quick-messages
    description: Quick replies.
  - name: campaigns
    description: Bulk sending.
  - name: crm
    description: Boards, stages, cards and metrics.
  - name: channels
    description: Channels (read only).
  - name: reports
    description: Reports and dashboards.
  - name: products
    description: Product catalog, categories and sales performance.
  - name: custom-fields
    description: Custom fields for contacts and cards, plus company-wide global variables.
  - name: profiles
    description: Company permission profiles (read only).
  - name: webchat
    description: >-
      Native webchat from your own system: open a visitor session, send and read
      messages. The token needs the `webchat` scope (GET and POST).
paths:
  /campaigns/{id}/report:
    parameters:
      - $ref: '#/components/parameters/idParam'
    get:
      tags:
        - campaigns
      summary: Get consolidated campaign result
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CampaignReport'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    idParam:
      name: id
      in: path
      required: true
      schema:
        type: integer
      example: 1042
  schemas:
    CampaignReport:
      type: object
      description: >-
        Consolidated campaign results, grouped according to the `groupBy`
        parameter.


        The fields that identify each row depend on the grouping: `campaign`
        returns `campaign_id`, `campaign_name` and `channel_name`; `channel.id`
        returns `channel_id` and `channel_name`; `channel.type` returns
        `channel_type`. The counters are always the same.
      properties:
        rows:
          type: array
          description: One row per group, for the current page only.
          items:
            allOf:
              - type: object
                properties:
                  campaign_id:
                    type: integer
                    description: Present only with `groupBy=campaign`.
                    example: 33
                  campaign_name:
                    type: string
                    description: Present only with `groupBy=campaign`.
                    example: Promoção de inverno
                  channel_id:
                    type: integer
                    description: Present only with `groupBy=channel.id`.
                    example: 11
                  channel_name:
                    type: string
                    description: Present with `groupBy=campaign` or `channel.id`.
                    example: Instagram Loja
                  channel_type:
                    type: string
                    description: Present only with `groupBy=channel.type`.
                    example: whatsapp
              - $ref: '#/components/schemas/CampaignReportCounters'
        totals:
          description: >-
            Counters for the entire filtered set, regardless of pagination. Use
            them for the totals at the top of the report.
          allOf:
            - $ref: '#/components/schemas/CampaignReportCounters'
        page:
          type: integer
          example: 1
        perPage:
          type: integer
          example: 20
        total:
          type: integer
          description: Total number of groups (rows), not recipients.
          example: 12
        totalPages:
          type: integer
          example: 1
    CampaignReportCounters:
      type: object
      description: >-
        Delivery counters. The statuses are **cumulative**: a recipient who read
        the message also counts as delivered and as sent. That is why
        `contacts_read` is never greater than `contacts_delivered`.
      properties:
        campaigns_count:
          type: integer
          description: Number of campaigns included in the report.
          example: 12
        channels_count:
          type: integer
          description: Number of channels involved.
          example: 3
        contacts_imported:
          type: integer
          description: >-
            Imported recipients. All other counters are calculated against this
            number.
          example: 5400
        contacts_waiting:
          type: integer
          description: Recipients whose message has not been sent yet.
          example: 120
        contacts_sent:
          type: integer
          description: >-
            Recipients whose message was handed off to the provider, including
            those who already received, read or replied to it.
          example: 5100
        contacts_failed:
          type: integer
          description: Recipients whose send failed, including invalid numbers.
          example: 180
        contacts_delivered:
          type: integer
          description: >-
            Recipients whose message reached their device, including those who
            read or replied to it.
          example: 4890
        contacts_read:
          type: integer
          description: Recipients who read the message, including those who replied.
          example: 3120
        contacts_answered:
          type: integer
          description: Recipients who replied.
          example: 640
        contacts_chat_opened:
          type: integer
          description: Recipients whose reply opened a ticket.
          example: 410
        contacts_wrapped_up:
          type: integer
          description: Recipients whose resulting ticket was closed and given a wrap-up.
          example: 300
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Fixed error code, so your system can handle each case.
              example: ERR_API_FORBIDDEN_SCOPE
            message:
              type: string
            details: {}
  responses:
    NotFound:
      description: >-
        The resource does not exist or belongs to another company. For security,
        the response is the same in both cases.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: ERR_API_NOT_FOUND
              message: Registro não encontrado.
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      description: API token in the `sk_live_…` format.

````

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