> ## 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.

# List Campaign Pipeline Automation Leads

> Leads of one campaign with the automation step each one is sitting on.



## OpenAPI

````yaml get /opportunity/campaign/{campaign_id}/pipeline-automation/leads
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/leads:
    get:
      tags:
        - Campaigns
      summary: List Campaign Pipeline Automation Leads
      description: Leads of one campaign with the automation step each one is sitting on.
      operationId: >-
        list_campaign_pipeline_automation_leads_opportunity_campaign__campaign_id__pipeline_automation_leads_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: stage_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Stage Id
        - name: step_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Step Id
        - name: automation_filter
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/OpportunityAutomationFilter'
            default: ALL
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 25
            title: Per Page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_CampaignAutomationLeadRow_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OpportunityAutomationFilter:
      type: string
      enum:
        - ALL
        - ACTIVE
        - COMPLETED
        - EXITED
        - NOT_ENROLLED
        - PAUSED
        - NEEDS_ATTENTION
      title: OpportunityAutomationFilter
      description: Lead-list slices, expressed the way an operator asks for them.
    Page_CampaignAutomationLeadRow_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/CampaignAutomationLeadRow'
          type: array
          title: Data
        total:
          type: integer
          title: Total
      type: object
      required:
        - data
        - total
      title: Page[CampaignAutomationLeadRow]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CampaignAutomationLeadRow:
      properties:
        opportunityId:
          type: string
          title: Opportunityid
        patientId:
          type: string
          title: Patientid
        firstName:
          type: string
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
        status:
          $ref: '#/components/schemas/OpportunityStatus'
        stageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Stageid
        stageName:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagename
        stageColor:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagecolor
        stageEnteredAt:
          type: string
          format: date-time
          title: Stageenteredat
        daysInStage:
          type: number
          title: Daysinstage
        isStale:
          type: boolean
          title: Isstale
          default: false
        automationsPaused:
          type: boolean
          title: Automationspaused
          default: false
        assignedProviderName:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignedprovidername
        lastEngagedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Lastengagedat
        run:
          anyOf:
            - $ref: '#/components/schemas/OpportunityAutomationRunSummary'
            - type: 'null'
      type: object
      required:
        - opportunityId
        - patientId
        - firstName
        - status
        - stageEnteredAt
        - daysInStage
      title: CampaignAutomationLeadRow
      description: One lead in the Pipeline tab list, with its automation position.
    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
    OpportunityStatus:
      type: string
      enum:
        - OPEN
        - WON
        - LOST
        - DISQUALIFIED
      title: OpportunityStatus
      description: |-
        Terminal-capable status for a pursuit episode (separate from stage).

        Schema column lands with the opportunity rebuild; enum ships early so
        intake/services can type against it without a second enum PR.
    OpportunityAutomationRunSummary:
      properties:
        id:
          type: string
          title: Id
        sequenceId:
          type: string
          title: Sequenceid
        sequenceName:
          anyOf:
            - type: string
            - type: 'null'
          title: Sequencename
        stageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Stageid
        status:
          $ref: '#/components/schemas/EnrollmentStatus'
        enrolledAt:
          type: string
          format: date-time
          title: Enrolledat
        completedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completedat
        exitReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Exitreason
        currentStepId:
          anyOf:
            - type: string
            - type: 'null'
          title: Currentstepid
        currentStepEffectType:
          anyOf:
            - $ref: '#/components/schemas/EffectType'
            - type: 'null'
        currentStepPosition:
          anyOf:
            - type: integer
            - type: 'null'
          title: Currentstepposition
        totalSteps:
          type: integer
          title: Totalsteps
          default: 0
        succeeded:
          type: integer
          title: Succeeded
          default: 0
        skipped:
          type: integer
          title: Skipped
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
        lastStepExecutedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Laststepexecutedat
        nextDueAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Nextdueat
      type: object
      required:
        - id
        - sequenceId
        - status
        - enrolledAt
      title: OpportunityAutomationRunSummary
      description: Where one lead currently stands inside one automation run.
    EnrollmentStatus:
      type: string
      enum:
        - ACTIVE
        - COMPLETED
        - EXITED
      title: EnrollmentStatus
    EffectType:
      type: string
      enum:
        - SEND_SMS
        - SEND_EMAIL
        - CHANGE_STATUS
        - CREATE_TASK
        - ASSIGN_PROVIDER
        - WEBHOOK
        - WAIT
        - DECISION
      title: EffectType

````