> ## Documentation Index
> Fetch the complete documentation index at: https://developer.eka.care/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete a discharge clearance

> Marks one clearance COMPLETED, optionally with a `note` ("cleared with note"), records a `CLEARANCE` event, and updates the admission's `clearances_summary` and `discharge_ready`. When it was the last of the five, a `READY_FOR_DISCHARGE` event is also recorded. Any authenticated user of the workspace can complete any clearance; restrict who may do this in your own application.



## OpenAPI

````yaml api-reference/doc-tool/ipd-api/ipd-sdk-openapi.json post /ipd/v1/sdk/admissions/{admission_id}/clearances/{type}/complete
openapi: 3.1.0
info:
  title: Eka IPD Admission API
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /ipd/v1/sdk/admissions/{admission_id}/clearances/{type}/complete:
    post:
      tags:
        - IPD API
      summary: Complete a discharge clearance
      description: >-
        Marks one clearance COMPLETED, optionally with a `note` ("cleared with
        note"), records a `CLEARANCE` event, and updates the admission's
        `clearances_summary` and `discharge_ready`. When it was the last of the
        five, a `READY_FOR_DISCHARGE` event is also recorded. Any authenticated
        user of the workspace can complete any clearance; restrict who may do
        this in your own application.
      operationId: IpdSdkCompleteADischargeClearance
      parameters:
        - name: auth
          in: header
          required: true
          schema:
            type: string
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
        - schema:
            minLength: 1
            type: string
          in: path
          name: admission_id
          required: true
          description: Id of the IPD admission.
        - schema:
            anyOf:
              - type: string
                enum:
                  - pharmacy
              - type: string
                enum:
                  - lab
              - type: string
                enum:
                  - financial
              - type: string
                enum:
                  - nursing
              - type: string
                enum:
                  - doctor
          in: path
          name: type
          required: true
          description: Clearance type.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              properties:
                note:
                  description: Optional rationale, for example when clearing with a note.
                  type: string
                by:
                  description: >-
                    Actor recorded on the change; defaults to the authenticated
                    operator.
                  additionalProperties: true
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      minLength: 1
                      type: string
                    name:
                      type: string
                    role:
                      type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                required:
                  - statuses
                  - completed_count
                  - total
                  - all_complete
                properties:
                  statuses:
                    type: object
                    additionalProperties:
                      anyOf:
                        - type: string
                          enum:
                            - PENDING
                        - type: string
                          enum:
                            - COMPLETED
                  completed_count:
                    type: number
                  total:
                    type: number
                  all_complete:
                    type: boolean
        '400':
          description: Bad Request — the request failed validation or was rejected.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '404':
          description: >-
            Not Found — the admission (or the addressed record) does not exist
            in your workspace.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.