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

# Bulk Set Status

> Close every selected opportunity as lost or disqualified under one shared reason.



## OpenAPI

````yaml post /opportunity/bulk-status
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/bulk-status:
    post:
      tags:
        - Opportunities
      summary: Bulk Set Status
      description: >-
        Close every selected opportunity as lost or disqualified under one
        shared reason.
      operationId: bulk_set_status_opportunity_bulk_status_post
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityBulkStatusUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpportunityBulkActionResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OpportunityBulkStatusUpdate:
      properties:
        opportunityIds:
          items:
            type: string
          type: array
          minItems: 1
          title: Opportunityids
          description: IDs of the opportunities to act on
        status:
          $ref: '#/components/schemas/OpportunityStatus'
        lostReasonId:
          anyOf:
            - type: string
            - type: 'null'
          title: Lostreasonid
      type: object
      required:
        - opportunityIds
        - status
      title: OpportunityBulkStatusUpdate
      description: >-
        Close the selected opportunities as LOST or DISQUALIFIED under one
        shared reason.
    OpportunityBulkActionResult:
      properties:
        succeeded:
          type: integer
          title: Succeeded
          description: Number of opportunities the action succeeded for
          default: 0
        skipped:
          type: integer
          title: Skipped
          description: Number of opportunities that were already in the requested state
          default: 0
        failed:
          items:
            $ref: '#/components/schemas/OpportunityBulkActionFailure'
          type: array
          title: Failed
          description: Per-opportunity failures with reasons
      type: object
      title: OpportunityBulkActionResult
      description: Aggregate result for a bulk action that fans out per opportunity.
    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.
    OpportunityBulkActionFailure:
      properties:
        opportunityId:
          type: string
          title: Opportunityid
        reason:
          type: string
          title: Reason
      type: object
      required:
        - opportunityId
        - reason
      title: OpportunityBulkActionFailure
      description: One opportunity a bulk action could not be applied to, and why.
    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

````