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

# Campaign analytics

> Date-bounded performance for every `ACTIVE`, non-test campaign, followed by a separate Simple Scheduler Dropoff rollup row. Not paginated, and computes analytics per campaign — use `GET /api/v1/teams/{teamId}/outbound/campaigns` to list campaigns. The rollup follows the team's lead-source relationship and can overlap the campaign rows, so do not add it into a grand total. Always scoped to the team in the URL path. Requires the `read:outbound` permission.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/teams/{teamId}/outbound/campaign-analytics
openapi: 3.1.0
info:
  title: Avoca Enterprise API
  description: >-
    Read-only programmatic access to Avoca data: calls and recordings,
    transcripts, leads, coach evaluations, Simple Scheduler sessions and
    analytics, outbound texting activity, enterprise support tickets, and
    customer survey results.
  version: 1.5.0
servers:
  - url: https://enterprise-api.avoca.ai
security:
  - bearerAuth: []
tags:
  - name: Calls
    description: Call records, recordings, transcripts, and pre-call transfers
  - name: Leads
    description: Unified leads (v0) and the canonical leads feed (v1)
  - name: Teams
    description: Teams accessible to the API key
  - name: Coach
    description: Coach (QA) call evaluations and rubrics
  - name: Scheduler Analytics (v0)
    description: Simple Scheduler analytics — legacy flat endpoints
  - name: Sessions & Bookings
    description: v1 scheduling-widget sessions and completed bookings
  - name: Analytics (v1)
    description: v1 funnel, UTM, service-area, and issue-type analytics
  - name: Outbound Texting
    description: Campaign text and subscription-event feeds for BI ingestion
  - name: Support Tickets
    description: Customer-safe enterprise support-ticket feed
  - name: Surveys
    description: >-
      Post-call customer survey results (CSAT, resolution, feedback) for BI
      ingestion
paths:
  /api/v1/teams/{teamId}/outbound/campaign-analytics:
    get:
      tags:
        - Outbound Texting
      summary: Campaign analytics
      description: >-
        Date-bounded performance for every `ACTIVE`, non-test campaign, followed
        by a separate Simple Scheduler Dropoff rollup row. Not paginated, and
        computes analytics per campaign — use `GET
        /api/v1/teams/{teamId}/outbound/campaigns` to list campaigns. The rollup
        follows the team's lead-source relationship and can overlap the campaign
        rows, so do not add it into a grand total. Always scoped to the team in
        the URL path. Requires the `read:outbound` permission.
      operationId: getOutboundCampaignAnalytics
      parameters:
        - $ref: '#/components/parameters/teamIdPath'
        - name: start_date
          in: query
          required: true
          description: Include activity on/after this ISO 8601 timestamp
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          required: true
          description: Include activity before this ISO 8601 timestamp
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: One row per active campaign plus the Simple Scheduler Dropoff rollup
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CampaignAnalyticsRow'
                  meta:
                    type: object
                    properties:
                      team_id:
                        type: integer
                      start_date:
                        type: string
                        format: date-time
                      end_date:
                        type: string
                        format: date-time
                      campaign_status:
                        type: string
                        enum:
                          - ACTIVE
                      campaign_count:
                        type: integer
                        description: Number of `campaign` rows (excludes the rollup)
                      includes_simple_scheduler_dropoff_rollup:
                        type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    teamIdPath:
      name: teamId
      in: path
      required: true
      description: The team ID
      schema:
        type: integer
  schemas:
    CampaignAnalyticsRow:
      type: object
      properties:
        row_type:
          type: string
          enum:
            - campaign
            - simple_scheduler_dropoff
          description: >-
            `campaign` for a real campaign; `simple_scheduler_dropoff` for the
            rollup row
        campaign_id:
          type:
            - integer
            - 'null'
          description: '`null` on the rollup row'
        campaign_name:
          type:
            - string
            - 'null'
        campaign_status:
          type:
            - string
            - 'null'
          description: '`ACTIVE`; `null` on the rollup row'
        audience_size:
          type: integer
          description: Distinct audience members with a scheduled execution in the window
        calls_made:
          type: integer
          description: Dial attempts (a customer dialed four times contributes four)
        texts_made:
          type: integer
          description: Text messages sent
        bookings:
          type: integer
          description: Distinct audience members booked by a campaign node
        start_date:
          type: string
          format: date-time
        end_date:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Human-readable description (newer endpoints)
      required:
        - error
  responses:
    BadRequest:
      description: Invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: API key lacks the required permission or team access
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key in the format `avoca_<64 hex characters>`

````