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

# Get Campaign Performance

> Aggregated performance metrics for a single campaign + daily breakdown.

**Spend** comes from `CampaignSpendLedger` via `CampaignMetricsService`
— same source as the campaigns list card and the Phase-2 spend tab,
so the three surfaces never disagree. A real Meta delivery posted
by `BudgetReconciler` shows up here immediately.

**Impressions / clicks / reach / conversions / video views** still
come from `CampaignMetricSnapshot` — no other source exists today.
Until `BudgetReconciler` is extended to also pull ad-platform
insights (Phase 3 follow-up), these stay seed-shaped for new
campaigns. On seeded campaigns they match what was historically
rendered because the Phase-2 backfill mirrored snapshot spend into
the ledger 1:1, so CPC / CPM stay numerically stable.



## OpenAPI

````yaml get /opportunity/analytics/campaign/{campaign_id}/performance
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/analytics/campaign/{campaign_id}/performance:
    get:
      tags:
        - Growth Analytics
      summary: Get Campaign Performance
      description: |-
        Aggregated performance metrics for a single campaign + daily breakdown.

        **Spend** comes from `CampaignSpendLedger` via `CampaignMetricsService`
        — same source as the campaigns list card and the Phase-2 spend tab,
        so the three surfaces never disagree. A real Meta delivery posted
        by `BudgetReconciler` shows up here immediately.

        **Impressions / clicks / reach / conversions / video views** still
        come from `CampaignMetricSnapshot` — no other source exists today.
        Until `BudgetReconciler` is extended to also pull ad-platform
        insights (Phase 3 follow-up), these stay seed-shaped for new
        campaigns. On seeded campaigns they match what was historically
        rendered because the Phase-2 backfill mirrored snapshot spend into
        the ledger 1:1, so CPC / CPM stay numerically stable.
      operationId: >-
        get_campaign_performance_opportunity_analytics_campaign__campaign_id__performance_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            title: Campaign Id
        - name: days
          in: query
          required: false
          schema:
            type: integer
            default: 90
            title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignPerformanceSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CampaignPerformanceSummary:
      properties:
        totalImpressions:
          type: integer
          title: Totalimpressions
          default: 0
        totalClicks:
          type: integer
          title: Totalclicks
          default: 0
        totalReach:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totalreach
        totalSpendCents:
          type: integer
          title: Totalspendcents
          default: 0
        totalConversions:
          type: integer
          title: Totalconversions
          default: 0
        totalLeadsGenerated:
          type: integer
          title: Totalleadsgenerated
          default: 0
        totalVideoViews:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totalvideoviews
        ctr:
          anyOf:
            - type: number
            - type: 'null'
          title: Ctr
        cpcCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cpccents
        cpmCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cpmcents
        daily:
          items:
            $ref: '#/components/schemas/CampaignMetricSnapshotSummary'
          type: array
          title: Daily
      type: object
      title: CampaignPerformanceSummary
      description: Aggregated performance metrics for a campaign.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CampaignMetricSnapshotSummary:
      properties:
        id:
          type: string
          title: Id
        campaignId:
          type: string
          title: Campaignid
        date:
          type: string
          title: Date
        impressions:
          type: integer
          title: Impressions
          default: 0
        clicks:
          type: integer
          title: Clicks
          default: 0
        reach:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reach
        spendCents:
          type: integer
          title: Spendcents
          default: 0
        conversions:
          type: integer
          title: Conversions
          default: 0
        leadsGenerated:
          type: integer
          title: Leadsgenerated
          default: 0
        videoViews:
          anyOf:
            - type: integer
            - type: 'null'
          title: Videoviews
      type: object
      required:
        - id
        - campaignId
        - date
      title: CampaignMetricSnapshotSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````