> ## 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 Pipeline Automation

> Stage-by-stage occupancy, flow and automation health for one campaign.



## OpenAPI

````yaml get /opportunity/campaign/{campaign_id}/pipeline-automation
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/campaign/{campaign_id}/pipeline-automation:
    get:
      tags:
        - Campaigns
      summary: Get Campaign Pipeline Automation
      description: Stage-by-stage occupancy, flow and automation health for one campaign.
      operationId: >-
        get_campaign_pipeline_automation_opportunity_campaign__campaign_id__pipeline_automation_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
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignPipelineAutomationSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CampaignPipelineAutomationSummary:
      properties:
        campaignId:
          type: string
          title: Campaignid
        pipelineId:
          anyOf:
            - type: string
            - type: 'null'
          title: Pipelineid
        pipelineName:
          anyOf:
            - type: string
            - type: 'null'
          title: Pipelinename
        isPipelineAttached:
          type: boolean
          title: Ispipelineattached
          default: false
        stages:
          items:
            $ref: '#/components/schemas/CampaignPipelineStageStats'
          type: array
          title: Stages
        stepsFailed:
          type: integer
          title: Stepsfailed
          default: 0
        generatedAt:
          type: string
          format: date-time
          title: Generatedat
      type: object
      required:
        - campaignId
        - generatedAt
      title: CampaignPipelineAutomationSummary
      description: Everything the Pipeline tab needs above the lead list.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CampaignPipelineStageStats:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        currentCount:
          type: integer
          title: Currentcount
          default: 0
        enteredCount:
          type: integer
          title: Enteredcount
          default: 0
        advancedCount:
          type: integer
          title: Advancedcount
          default: 0
        staleCount:
          type: integer
          title: Stalecount
          default: 0
        pausedCount:
          type: integer
          title: Pausedcount
          default: 0
        notEnrolledCount:
          type: integer
          title: Notenrolledcount
          default: 0
        automation:
          anyOf:
            - $ref: '#/components/schemas/StageAutomationSummary'
            - type: 'null'
      type: object
      required:
        - id
        - name
      title: CampaignPipelineStageStats
      description: Occupancy, flow and automation health for one stage of the pipeline.
    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
    StageAutomationSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        isActive:
          type: boolean
          title: Isactive
        exitPolicy:
          $ref: '#/components/schemas/PipelineStageExitPolicy'
        entryStepId:
          type: string
          title: Entrystepid
        steps:
          items:
            $ref: '#/components/schemas/AutomationStepStats'
          type: array
          title: Steps
        transitions:
          items:
            $ref: '#/components/schemas/AutomationTransitionSummary'
          type: array
          title: Transitions
        activeRuns:
          type: integer
          title: Activeruns
          default: 0
        stepsFailed:
          type: integer
          title: Stepsfailed
          default: 0
        lastActivityAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Lastactivityat
      type: object
      required:
        - id
        - isActive
        - exitPolicy
        - entryStepId
      title: StageAutomationSummary
      description: A stage's automation definition with campaign-scoped run counters.
    PipelineStageExitPolicy:
      type: string
      enum:
        - CANCEL_ON_EXIT
        - CONTINUE_AFTER_EXIT
      title: PipelineStageExitPolicy
    AutomationStepStats:
      properties:
        id:
          type: string
          title: Id
        effectType:
          $ref: '#/components/schemas/EffectType'
        displayOrder:
          type: integer
          title: Displayorder
        config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config
        waiting:
          type: integer
          title: Waiting
          default: 0
        succeeded:
          type: integer
          title: Succeeded
          default: 0
        skipped:
          type: integer
          title: Skipped
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
        delivered:
          type: integer
          title: Delivered
          default: 0
        opened:
          type: integer
          title: Opened
          default: 0
        openRate:
          anyOf:
            - type: number
            - type: 'null'
          title: Openrate
        replied:
          type: integer
          title: Replied
          default: 0
        replyRate:
          anyOf:
            - type: number
            - type: 'null'
          title: Replyrate
      type: object
      required:
        - id
        - effectType
        - displayOrder
      title: AutomationStepStats
      description: >-
        One runnable automation step plus what it has done for this campaign's
        leads.


        Inactive steps are absent: the engine cannot run them, so they are not
        part

        of the flow being reported on.
    AutomationTransitionSummary:
      properties:
        id:
          type: string
          title: Id
        fromStepId:
          type: string
          title: Fromstepid
        toStepId:
          type: string
          title: Tostepid
        isDefault:
          type: boolean
          title: Isdefault
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        condition:
          anyOf:
            - $ref: '#/components/schemas/PreviousEmailEventCondition'
            - type: 'null'
      type: object
      required:
        - id
        - fromStepId
        - toStepId
        - isDefault
      title: AutomationTransitionSummary
    EffectType:
      type: string
      enum:
        - SEND_SMS
        - SEND_EMAIL
        - CHANGE_STATUS
        - CREATE_TASK
        - ASSIGN_PROVIDER
        - WEBHOOK
        - WAIT
        - DECISION
      title: EffectType
    PreviousEmailEventCondition:
      properties:
        kind:
          type: string
          const: PREVIOUS_EMAIL_EVENT
          title: Kind
          default: PREVIOUS_EMAIL_EVENT
        event:
          $ref: '#/components/schemas/PreviousEmailEventKind'
      additionalProperties: false
      type: object
      required:
        - event
      title: PreviousEmailEventCondition
    PreviousEmailEventKind:
      type: string
      enum:
        - DELIVERED
        - OPENED
        - CLICKED
        - REPLIED
      title: PreviousEmailEventKind

````