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

# Move Opportunity Stage

> Move an opportunity to a different pipeline stage.



## OpenAPI

````yaml put /opportunity/{opportunity_id}/stage
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/{opportunity_id}/stage:
    put:
      tags:
        - Opportunities
      summary: Move Opportunity Stage
      description: Move an opportunity to a different pipeline stage.
      operationId: move_opportunity_stage_opportunity__opportunity_id__stage_put
      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: opportunity_id
          in: path
          required: true
          schema:
            type: string
            title: Opportunity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityStageUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpportunityDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OpportunityStageUpdate:
      properties:
        stageId:
          type: string
          title: Stageid
        lostReasonId:
          anyOf:
            - type: string
            - type: 'null'
          title: Lostreasonid
      type: object
      required:
        - stageId
      title: OpportunityStageUpdate
    OpportunityDetail:
      properties:
        id:
          type: string
          title: Id
        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
        sourceDetail:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourcedetail
        campaignId:
          anyOf:
            - type: string
            - type: 'null'
          title: Campaignid
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
        pipelineId:
          type: string
          title: Pipelineid
        currentStageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Currentstageid
        patientId:
          type: string
          title: Patientid
        assignedProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignedproviderid
        status:
          $ref: '#/components/schemas/OpportunityStatus'
          default: OPEN
        wonAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Wonat
        lostAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Lostat
        lostReasonId:
          anyOf:
            - type: string
            - type: 'null'
          title: Lostreasonid
        lostReasonLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Lostreasonlabel
        convertedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Converteddate
        lostReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Lostreason
        stageEnteredAt:
          type: string
          format: date-time
          title: Stageenteredat
        sourceChannel:
          anyOf:
            - $ref: '#/components/schemas/TouchpointChannel'
            - type: 'null'
        originatingTouchpointId:
          anyOf:
            - type: string
            - type: 'null'
          title: Originatingtouchpointid
        estValueCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Estvaluecents
        contactAttempts:
          type: integer
          title: Contactattempts
          default: 0
        firstResponseDueAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Firstresponsedueat
        firstResponseAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Firstresponseat
        lastEngagedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Lastengagedat
        automationsPaused:
          type: boolean
          title: Automationspaused
          default: false
        stale:
          type: boolean
          title: Stale
          default: false
        lifecycleStage:
          $ref: '#/components/schemas/PatientLifecycle'
        isExistingPatient:
          type: boolean
          title: Isexistingpatient
          default: false
        latestBooking:
          anyOf:
            - $ref: '#/components/schemas/OpportunityBookingSummary'
            - type: 'null'
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        currentStage:
          anyOf:
            - $ref: '#/components/schemas/PipelineStageSummary'
            - type: 'null'
        assignedProvider:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
        campaign:
          anyOf:
            - $ref: '#/components/schemas/CampaignSummary'
            - type: 'null'
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        opportunityNotes:
          items:
            $ref: '#/components/schemas/OpportunityNoteDetail'
          type: array
          title: Opportunitynotes
        aiSummaries:
          items:
            $ref: '#/components/schemas/OpportunityAISummaryDetail'
          type: array
          title: Aisummaries
        bookings:
          items:
            $ref: '#/components/schemas/OpportunityBookingSummary'
          type: array
          title: Bookings
      type: object
      required:
        - id
        - firstName
        - pipelineId
        - patientId
        - stageEnteredAt
        - lifecycleStage
      title: OpportunityDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    TouchpointChannel:
      type: string
      enum:
        - META_LEAD_FORM
        - GOOGLE_LEAD_FORM
        - PAID_CLICK
        - WEB_ORGANIC
        - WEB_FORM
        - WEB_CHAT
        - PHONE_CALL
        - SMS_INBOUND
        - EMAIL_INBOUND
        - DM_INSTAGRAM
        - DM_FACEBOOK
        - REFERRAL
        - WALK_IN
        - QR
        - IMPORT
        - OTHER
      title: TouchpointChannel
      description: |-
        How a marketing interaction was observed.

        Reporting dimension #1 on the touchpoint ledger. Add values only with
        a writer in the same PR (TypedEnum decodes unmapped strings to None).
    PatientLifecycle:
      type: string
      enum:
        - PROSPECT
        - PATIENT
      title: PatientLifecycle
      description: |-
        Clinical vs marketing hygiene for a patient row.

        Prospects are thin / pre-clinical people created by CRM capture.
        Transition is one-way to PATIENT on first completed visit, first
        committed payment, portal claim, or explicit staff action.
    OpportunityBookingSummary:
      properties:
        conversionId:
          type: string
          title: Conversionid
        eventId:
          type: string
          title: Eventid
        occurredAt:
          type: string
          format: date-time
          title: Occurredat
        appointmentStart:
          type: string
          format: date-time
          title: Appointmentstart
        appointmentEnd:
          type: string
          format: date-time
          title: Appointmentend
        appointmentStatus:
          $ref: '#/components/schemas/EventStatus'
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
        isLinked:
          type: boolean
          title: Islinked
        isArchived:
          type: boolean
          title: Isarchived
          default: false
      type: object
      required:
        - conversionId
        - eventId
        - occurredAt
        - appointmentStart
        - appointmentEnd
        - appointmentStatus
        - isLinked
      title: OpportunityBookingSummary
      description: One real appointment fact visible in an opportunity's patient context.
    PipelineStageSummary:
      properties:
        id:
          type: string
          title: Id
        pipelineId:
          type: string
          title: Pipelineid
        name:
          type: string
          title: Name
        stageNumber:
          type: integer
          title: Stagenumber
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        kind:
          $ref: '#/components/schemas/StageKind'
          default: WORKING
        staleAfterDays:
          anyOf:
            - type: integer
            - type: 'null'
          title: Staleafterdays
        isTerminalWon:
          type: boolean
          title: Isterminalwon
          default: false
        isTerminalLost:
          type: boolean
          title: Isterminallost
          default: false
        autoConvert:
          type: boolean
          title: Autoconvert
          default: false
        actions:
          items:
            $ref: '#/components/schemas/PipelineStageActionSummary'
          type: array
          title: Actions
      type: object
      required:
        - id
        - pipelineId
        - name
        - stageNumber
      title: PipelineStageSummary
    ProviderTiny:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - firstName
      title: ProviderTiny
    CampaignSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        platformId:
          anyOf:
            - type: string
            - type: 'null'
          title: Platformid
        platformAssetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Platformassetid
        externalCampaignId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalcampaignid
        externalResourceName:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalresourcename
        externalName:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalname
        externalStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalstatus
        externalCurrency:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalcurrency
        externalDailyBudgetCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Externaldailybudgetcents
        externalLifetimeBudgetCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Externallifetimebudgetcents
        externalLastSeenAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externallastseenat
        externalLastSyncedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externallastsyncedat
        externalStaleAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externalstaleat
        externalSyncError:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalsyncerror
        locationId:
          type: string
          title: Locationid
        isActive:
          type: boolean
          title: Isactive
          default: true
        startDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Startdate
        endDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Enddate
        budgetCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Budgetcents
        pipelineId:
          anyOf:
            - type: string
            - type: 'null'
          title: Pipelineid
        webhook:
          anyOf:
            - $ref: '#/components/schemas/CampaignWebhookSummary'
            - type: 'null'
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        opportunityCount:
          type: integer
          title: Opportunitycount
          default: 0
        convertedCount:
          type: integer
          title: Convertedcount
          default: 0
      type: object
      required:
        - id
        - name
        - locationId
      title: CampaignSummary
    OpportunityNoteDetail:
      properties:
        id:
          type: string
          title: Id
        opportunityId:
          type: string
          title: Opportunityid
        content:
          type: string
          title: Content
        creatorId:
          type: string
          title: Creatorid
        creator:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
        createdDate:
          type: string
          format: date-time
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
      type: object
      required:
        - id
        - opportunityId
        - content
        - creatorId
        - createdDate
      title: OpportunityNoteDetail
    OpportunityAISummaryDetail:
      properties:
        id:
          type: string
          title: Id
        opportunityId:
          type: string
          title: Opportunityid
        summary:
          type: string
          title: Summary
        suggestions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Suggestions
        latestActivity:
          anyOf:
            - type: string
            - type: 'null'
          title: Latestactivity
        createdDate:
          type: string
          format: date-time
          title: Createddate
      type: object
      required:
        - id
        - opportunityId
        - summary
        - createdDate
      title: OpportunityAISummaryDetail
    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
    EventStatus:
      type: string
      enum:
        - PENDING
        - RESERVED
        - CONFIRMED
        - CANCELLED
        - COMPLETED
        - OVERRIDABLE
        - NO_SHOW
      title: EventStatus
    StageKind:
      type: string
      enum:
        - NEW
        - WORKING
        - ENGAGED
        - BOOKED
        - WON
        - LOST
      title: StageKind
      description: Canonical funnel mapping for arbitrarily named pipeline stages.
    PipelineStageActionSummary:
      properties:
        id:
          type: string
          title: Id
        stageId:
          type: string
          title: Stageid
        actionType:
          $ref: '#/components/schemas/PipelineActionType'
        actionOrder:
          type: integer
          title: Actionorder
        delayMinutes:
          type: integer
          title: Delayminutes
          default: 0
        config:
          additionalProperties: true
          type: object
          title: Config
        isActive:
          type: boolean
          title: Isactive
          default: true
      type: object
      required:
        - id
        - stageId
        - actionType
        - actionOrder
      title: PipelineStageActionSummary
    CampaignWebhookSummary:
      properties:
        webhookKey:
          type: string
          title: Webhookkey
        webhookUrl:
          type: string
          title: Webhookurl
        redirectUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Redirecturl
      type: object
      required:
        - webhookKey
        - webhookUrl
      title: CampaignWebhookSummary
    PipelineActionType:
      type: string
      enum:
        - CREATE_TASK
        - SEND_SMS
        - SEND_EMAIL
        - START_SEQUENCE
        - ASSIGN_PROVIDER
        - WEBHOOK
        - UPDATE_FIELD
      title: PipelineActionType

````