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

# Get campaign(s) analytics overview

> Get analytics overview for one or multiple campaigns. Specify the `id` field to get the analytics overview for a single campaign, or leave it empty to get the analytics overview for all campaigns.

Note regarding the interest status totals (interested, meeting booked, meeting completed, closed): these are calculated based on the first occurrence of each event per contact by default. To change this behavior and calculate the totals based on all occurrences of the events, set the `expand_crm_events` parameter to `true`. Additionally, there is a 10 minute time window after you change a lead status in which the subsequent updates will NOT insert new analytics events to avoid duplicates from rapid status changes and avoid false inflation of the analytics numbers.



## OpenAPI

````yaml https://api.instantly.ai/openapi/api_v2.json get /api/v2/campaigns/analytics/overview
openapi: 3.1.0
info:
  title: API Explorer
  description: >-
    The entire API V2 documentation is interactive and can be tested here. To
    the right side of every endpoint you will see a box with an example request.
    You can click on the "Try it" button to send a request to the server right
    from the docs. You will need to provide an API key by clicking the
    `ApiKeyAuth_token` blue text.
  version: 2.0.0
servers:
  - url: https://api.instantly.ai
    description: Instantly API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Analytics
    description: Endpoints related to analytics
    x-displayName: Analytics
  - name: OAuth
    description: >-
      OAuth authentication endpoints for connecting Google and Microsoft email
      accounts
    x-displayName: OAuth
  - name: Account
    description: An email account that can be used to send campaigns
    x-displayName: Account
  - name: Campaign
    description: A campaign that can be sent to a list of recipients
    x-displayName: Campaign
  - name: Email
    description: >-
      A campaign email, a reply, a manually sent email, or any other email
      that's visible in the Unibox
    x-displayName: Email
  - name: EmailVerification
    description: A single email verification
    x-displayName: Email Verification
  - name: LeadList
    description: A list used to store leads
    x-displayName: Lead List
  - name: InboxPlacementTest
    description: An inbox placement test
    x-displayName: Inbox Placement Test
  - name: InboxPlacementAnalytics
    description: Analytics data for individual emails in inbox placement tests
    x-displayName: Inbox Placement Analytics
  - name: InboxPlacementBlacklist&SpamAssassinReport
    description: Report data for an inbox placement test
    x-displayName: Inbox Placement Blacklist & SpamAssassin Report
  - name: APIKey
    description: API Key
    x-displayName: API Key
  - name: AccountCampaignMapping
    description: Account Campaign Mapping
    x-displayName: Account Campaign Mapping
  - name: Lead
    description: A lead entity representing an individual lead
    x-displayName: Lead
  - name: BackgroundJob
    description: A background job that can be used to perform long-running tasks
    x-displayName: Background Job
  - name: CustomTag
    description: >-
      A custom tag for organizing and categorizing accounts and campaigns. You
      can use them as filters in apis that list accounts and campaigns.
    x-displayName: Custom Tag
  - name: CustomTagMapping
    description: >-
      This entity represents a tag being assigned to a specific campaign or
      email account. When an email account is assigned a tag, a new custom tag
      mapping entry is created, which connects the tag (`tag_id` field) with the
      email account (`resource_id` field). You can use it to see which tag si
      connected to which resource.
    x-displayName: Custom Tag Mapping
  - name: BlockListEntry
    description: A blocked email or domain
    x-displayName: Block List Entry
  - name: LeadLabel
    description: A custom label for categorizing and managing leads
    x-displayName: Lead Label
  - name: Workspace
    description: A workspace entity representing a workspace
    x-displayName: Workspace
  - name: SuperSearchEnrichment
    description: >-
      An enrichment can take different forms, such as email enrichment or
      LinkedIn enrichment. Leads may be imported from SuperSearch using the
      dedicated endpoint, or enriched directly within a list or campaign by
      attaching an enrichment to it.
    x-displayName: SuperSearch Enrichment
  - name: WorkspaceGroupMember
    description: >-
      A member of a workspace group. You can use the endpoints within this
      entity to manage the members of a workspace group.
    x-displayName: Workspace Group Member
  - name: WorkspaceMember
    description: A member of a workspace with associated user details
    x-displayName: Workspace Member
  - name: CampaignSubsequence
    description: A subsequence entity representing a follow-up sequence
    x-displayName: Campaign Subsequence
  - name: AuditLog
    description: Audit log records for tracking system activities
    x-displayName: Audit Log
  - name: Webhook
    description: A webhook subscription for receiving event notifications
    x-displayName: Webhook
  - name: WebhookEvent
    description: A webhook event that was sent or attempted to be sent
    x-displayName: Webhook Event
  - name: DFYEmailAccountOrder
    description: A Done-For-You email account order
    x-displayName: DFY Email Account Order
  - name: CustomPromptTemplate
    description: Custom prompt templates for creating custom prompts
    x-displayName: Custom Prompt Template
  - name: SalesFlow
    description: >-
      Manages how sales users view and interact with campaign and lead lists
      within the sales flow.
    x-displayName: Sales Flow
  - name: EmailTemplate
    description: A campaign email template
    x-displayName: Email Template
  - name: WorkspaceBilling
    description: Workspace Billing
    x-displayName: Workspace Billing
  - name: CRMActions
    description: CRM related actions
    x-displayName: CRM Actions
paths:
  /api/v2/campaigns/analytics/overview:
    get:
      tags:
        - Campaign
        - Analytics
      summary: Get campaign(s) analytics overview
      description: >-
        Get analytics overview for one or multiple campaigns. Specify the `id`
        field to get the analytics overview for a single campaign, or leave it
        empty to get the analytics overview for all campaigns.


        Note regarding the interest status totals (interested, meeting booked,
        meeting completed, closed): these are calculated based on the first
        occurrence of each event per contact by default. To change this behavior
        and calculate the totals based on all occurrences of the events, set the
        `expand_crm_events` parameter to `true`. Additionally, there is a 10
        minute time window after you change a lead status in which the
        subsequent updates will NOT insert new analytics events to avoid
        duplicates from rapid status changes and avoid false inflation of the
        analytics numbers.
      operationId: getCampaignAnalyticsOverview
      parameters:
        - schema:
            type: string
            format: uuid
            example: 019e18e2-a526-75b1-9bd6-0194f5dbd386
          in: query
          name: id
          required: false
          description: >-
            A campaign ID to get the analytics overview for. Leave this field
            empty to get the analytics overview for all campaigns
        - schema:
            type: array
            items:
              type: string
              description: >-
                A list of campaign IDs to get the analytics overview for. Leave
                this field empty to get the analytics overview for all
                campaigns. You can specify multiple IDs by adding the same
                parameter multiple times, for instance:
                `/campaigns/analytics/overview?ids=123&ids=456`
              format: uuid
              example: 019e18e2-a526-75b1-9bd6-019521b67e55
          in: query
          name: ids
          required: false
        - schema:
            type: string
            example: '2024-01-01'
          in: query
          name: start_date
          required: false
          description: Start date
        - schema:
            type: string
            example: '2024-01-01'
          in: query
          name: end_date
          required: false
          description: End date
        - schema:
            type: number
            enum:
              - -99
              - -1
              - -2
              - 0
              - 1
              - 2
              - 3
              - 4
            x-enumDescriptions:
              '0': Draft
              '1': Active
              '2': Paused
              '3': Completed
              '4': Running Subsequences
              '-99': Account Suspended
              '-1': Accounts Unhealthy
              '-2': Bounce Protect
            example: 1
          in: query
          name: campaign_status
          required: false
          description: >-
            Filter by campaign status (only the analytics for the campaigns with
            the specified status will be returned)
        - schema:
            type: boolean
            default: false
            example: true
          in: query
          name: expand_crm_events
          required: false
          description: >-
            When `true`, calculates the total of all the lead interest status
            update events instead of only the first occurrence for each contact.
            This will affect the following fields: `total_opportunities`,
            `total_interested`, `total_meeting_booked`,
            `total_meeting_completed`, and `total_closed`. Example: if a lead
            goes from interested to meeting booked to closed, it will count as 3
            events (total_interested: 1, total_meeting_booked_1, and
            total_closed: 1) when this parameter is set to true, and as 1 event
            (total_interested) when it is set to false (default).
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  open_count:
                    type: integer
                    description: >-
                      The total number of times the emails were opened,
                      including duplicates
                    example: 800
                  open_count_unique:
                    type: integer
                    description: >-
                      The number of emails that got opened (for the first time
                      only)
                    example: 800
                  open_count_unique_by_step:
                    type: integer
                    description: >-
                      The unique number of times the emails were opened (counted
                      once per lead, step, and campaign)
                    example: 800
                  link_click_count:
                    type: integer
                    description: The number of links that got clicked
                    example: 800
                  link_click_count_unique:
                    type: integer
                    description: The number of links that got clicked (for the first time)
                    example: 800
                  link_click_count_unique_by_step:
                    type: integer
                    description: >-
                      The unique number of links that got clicked, per step
                      (counted once per lead, step, and campaign)
                    example: 800
                  reply_count:
                    type: integer
                    description: >-
                      The total number of replies received (if a lead replies
                      multiple times, each reply is counted)
                    example: 300
                  reply_count_unique:
                    type: integer
                    description: >-
                      The number of unique replies (first reply per lead).
                      Excludes automatic replies.
                    example: 300
                  reply_count_unique_by_step:
                    type: integer
                    description: >-
                      The number of unique replies per step (first reply per
                      lead per step). Excludes automatic replies.
                    example: 300
                  reply_count_automatic:
                    type: integer
                    description: >-
                      The total number of automatic replies received (e.g.,
                      out-of-office)
                    example: 50
                  reply_count_automatic_unique:
                    type: integer
                    description: The number of unique leads that sent automatic replies
                    example: 45
                  reply_count_automatic_unique_by_step:
                    type: integer
                    description: >-
                      The unique number of automatic replies per step (counted
                      once per lead, step, and campaign)
                    example: 45
                  bounced_count:
                    type: integer
                    description: The number of bounced leads
                    example: 50
                  unsubscribed_count:
                    type: integer
                    description: The number of unsubscribed leads
                    example: 20
                  completed_count:
                    type: integer
                    description: The number of leads that the campaign was completed for
                    example: 1100
                  emails_sent_count:
                    type: integer
                    description: The total number of sent emails
                    example: 5000
                  contacted_count:
                    type: integer
                    description: The total number of unique leads contacted
                    example: 4500
                  new_leads_contacted_count:
                    type: integer
                    description: The total number of new leads contacted
                    example: 200
                  total_opportunities:
                    type: integer
                    description: The total number of unique opportunities created
                    example: 10
                  total_opportunity_value:
                    type: number
                    description: The total value of opportunities created
                    example: 1000
                  total_interested:
                    type: integer
                    description: The total number of interested opportunities created
                    example: 103
                  total_meeting_booked:
                    type: integer
                    description: The total number of meeting booked opportunities created
                    example: 45
                  total_meeting_completed:
                    type: integer
                    description: >-
                      The total number of meeting completed opportunities
                      created
                    example: 12
                  total_closed:
                    type: integer
                    description: The total number of closed opportunities created
                    example: 10
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message
                    example: Start Date must be earlier than End Date
        '401':
          description: >-
            This request is unauthorized (either the Authorization header is
            missing or invalid, or the API key has been revoked)
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 401
                    example: 401
                  error:
                    type: string
                    enum:
                      - Unauthorized
                    example: Unauthorized
                  message:
                    type: string
                    example: Missing Authorization header
                required:
                  - statusCode
                  - error
                  - message
        '402':
          description: >-
            This request cannot be fulfilled because the workspace does not have
            an active paid plan
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 402
                    example: 402
                  error:
                    type: string
                    enum:
                      - Payment Required
                    example: Payment Required
                  message:
                    type: string
                    example: Workspace does not have an active paid plan
                required:
                  - statusCode
                  - error
                  - message
        '404':
          description: The requested resource was not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 404
                    example: 404
                  error:
                    type: string
                    enum:
                      - Not Found
                    example: Not Found
                  message:
                    type: string
                    example: Resource not found
                required:
                  - statusCode
                  - error
                  - message
        '429':
          description: >-
            You have exceeded the rate limit. Please check the rate limit docs
            for more information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 429
                    example: 429
                  error:
                    type: string
                    enum:
                      - Too Many Requests
                    example: Too Many Requests
                  message:
                    type: string
                    example: Rate limit exceeded
                required:
                  - statusCode
                  - error
                  - message
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````