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

# Campaign metrics

> Lead counts by status, dial activity and meetings booked for one campaign.



## OpenAPI

````yaml /openapi.json get /campaigns/{id}/metrics
openapi: 3.1.0
info:
  title: Leadey API
  version: 1.4.0
  description: >-
    The Leadey API gives you programmatic access to your workspace: leads,
    companies, contacts, campaigns, meetings, opportunities and calls, plus the
    reporting metrics behind the Cockpit.


    Every request is authenticated with an organization-scoped API key, and
    every response is JSON. Reads work with any key. Writes — creating leads,
    adding notes, logging calls, managing tasks — need a key with write access,
    and are attributed to the workspace member that key belongs to. See [Writing
    data](/guides/writing-data).
servers:
  - url: https://backend.leadey.ai/v1
    description: Production
  - url: http://localhost:3001/v1
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The organization behind the API key.
  - name: Leads
    description: People enrolled in your campaigns.
  - name: Notes
    description: >-
      Free-text notes on a lead. Notes appear in the lead's timeline and in the
      Cockpit.
  - name: Tasks
    description: Follow-ups and reminders, each assigned to a workspace member.
  - name: Campaigns
    description: Outreach sequences and their performance.
  - name: Companies
    description: Companies in your workspace.
  - name: Contacts
    description: The canonical person record behind your leads.
  - name: Meetings
    description: Bookings merged across Calendly, Leadey and connected calendars.
  - name: Opportunities
    description: Deals, their value, and the pipelines they sit in.
  - name: Pipelines
    description: Deal pipelines and the stages inside them.
  - name: Calls
    description: Dial history, recordings and transcripts.
  - name: Metrics
    description: >-
      Aggregated reporting — meetings booked, sit rate, dial activity and
      pipeline value.
  - name: Reference
    description: The vocabularies other endpoints return values from.
paths:
  /campaigns/{id}/metrics:
    get:
      tags:
        - Metrics
      summary: Campaign metrics
      description: >-
        Lead counts by status, dial activity and meetings booked for one
        campaign.
      operationId: getCampaignMetrics
      parameters:
        - name: id
          in: path
          required: true
          description: Campaign id.
          schema:
            type: string
        - $ref: '#/components/parameters/From'
        - $ref: '#/components/parameters/To'
        - $ref: '#/components/parameters/Timezone'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CampaignMetrics'
              example:
                data:
                  campaignId: fnl_Q3OutboundUK
                  campaignName: Q3 outbound, UK logistics
                  window:
                    from: '2026-07-01T00:00:00.000Z'
                    to: '2026-07-31T23:59:59.999Z'
                    timezone: UTC
                  leads:
                    total: 138
                    byStatus:
                      - status: qualified
                        count: 138
                  calls:
                    dials: 412
                    connected: 138
                    connectRate: 0.335
                    talkSeconds: 386
                  meetings:
                    booked: 23
                    past: 1
                    upcoming: 1
                    attended: 19
                    noShow: 4
                    dispositioned: 380
                    undispositioned: 32
                    sitRate: 0.826
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    From:
      name: from
      in: query
      description: Start of the window, ISO 8601. A window longer than 62 days is clamped.
      schema:
        type: string
        format: date-time
    To:
      name: to
      in: query
      description: End of the window, ISO 8601.
      schema:
        type: string
        format: date-time
    Timezone:
      name: timezone
      in: query
      description: >-
        IANA timezone used to decide which calendar day a record falls on — e.g.
        `Europe/London`. Defaults to `UTC`. Set this whenever you report on a
        day, or a late-evening meeting can land in the wrong one.
      schema:
        type: string
        example: Europe/London
  schemas:
    CampaignMetrics:
      type: object
      properties:
        campaignId:
          type: string
        campaignName:
          type: string
        window:
          $ref: '#/components/schemas/Window'
        leads:
          type: object
          properties:
            total:
              type: integer
            byStatus:
              type: array
              items:
                type: object
                properties:
                  status:
                    type: string
                  count:
                    type: integer
        calls:
          type: object
          properties:
            dials:
              type: integer
            connected:
              type: integer
            connectRate:
              type:
                - number
                - 'null'
              description: >-
                Ratio 0–1, rounded to 4dp. Null when the denominator is zero —
                distinguishable from a genuine 0.
            talkSeconds:
              type: integer
        meetings:
          $ref: '#/components/schemas/MeetingTally'
      required:
        - campaignId
        - campaignName
        - window
    Window:
      type: object
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        timezone:
          type: string
          example: UTC
      required:
        - from
        - to
        - timezone
    MeetingTally:
      type: object
      properties:
        booked:
          type: integer
          description: Every meeting in the window.
        past:
          type: integer
          description: Already started.
        upcoming:
          type: integer
        attended:
          type: integer
        noShow:
          type: integer
        dispositioned:
          type: integer
          description: attended + noShow — the sit-rate denominator.
        undispositioned:
          type: integer
          description: >-
            Past meetings nobody has marked. Excluded from sitRate; check this
            before trusting the rate.
        sitRate:
          type:
            - number
            - 'null'
          description: >-
            attended / (attended + noShow). Unmarked meetings are excluded
            entirely — see the Metrics guide.
      required:
        - booked
        - attended
        - noShow
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
            details:
              type:
                - object
                - array
                - string
                - 'null'
              description: Optional structured detail.
          required:
            - message
  responses:
    Unauthorized:
      description: The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid or revoked API key.
              details: null
    NotFound:
      description: The resource does not exist or is not in your workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Lead not found
              details: null
    RateLimited:
      description: Too many requests. Retry after the period in the `Retry-After` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit exceeded. Retry in 42s.
              details: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key, created in the Leadey dashboard under Settings → API Keys.
        Send it as `Authorization: Bearer leadey_sk_live_…`.

````