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

> Archive (or restore) every selected opportunity.



## OpenAPI

````yaml post /opportunity/bulk-archive
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-archive:
    post:
      tags:
        - Opportunities
      summary: Bulk Archive
      description: Archive (or restore) every selected opportunity.
      operationId: bulk_archive_opportunity_bulk_archive_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/OpportunityBulkArchive'
        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:
    OpportunityBulkArchive:
      properties:
        opportunityIds:
          items:
            type: string
          type: array
          minItems: 1
          title: Opportunityids
          description: IDs of the opportunities to act on
        isArchived:
          type: boolean
          title: Isarchived
          default: true
      type: object
      required:
        - opportunityIds
      title: OpportunityBulkArchive
      description: Archive (or restore) the selected opportunities.
    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
    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

````