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

# Discover Link On Confirm

> This API is used by HIP to confirm the linking of care contexts after OTP verification.

<Note>
  Call this API in response to the [Link Confirmation webhook](/api-reference/user-app/abdm-connect/webhooks/discover-link-confirm), after validating the OTP. Use the `request_id` from the webhook payload and include the list of care contexts to be linked.
</Note>


## OpenAPI

````yaml post /abdm/v1/care-contexts/discover/link/on-confirm
openapi: 3.1.0
info:
  description: ABHA Registration and login APIs
  title: Registration
  version: 1.0.0
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /abdm/v1/care-contexts/discover/link/on-confirm:
    post:
      summary: Discover Link On Confirm
      description: >-
        This API is used by HIP to confirm the linking of care contexts after
        OTP verification.
      parameters:
        - description: Eka User ID (OID)
          in: header
          name: X-Pt-Id
          schema:
            type: string
        - description: Partner User ID
          in: header
          name: X-Partner-Pt-Id
          schema:
            type: string
        - description: Partner HIP ID
          in: header
          name: X-Hip-Id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelsLinkOnConfirmHmisConnect'
      responses:
        '204':
          description: No Content
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
        5XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
      security:
        - authApiKey: []
components:
  schemas:
    ModelsLinkOnConfirmHmisConnect:
      properties:
        error:
          $ref: '#/components/schemas/ModelsError'
          description: Error details, if any occurred during the process.
        patients:
          description: >-
            List of patients including reference number, display name, care
            contexts, and HI type
          items:
            $ref: '#/components/schemas/ModelsPatient'
          type:
            - array
            - 'null'
        request_id:
          description: Request ID that is received in the webhook call.
          type: string
      required:
        - request_id
      type: object
    GenericError:
      properties:
        code:
          type: integer
        error:
          type: string
        source_error:
          $ref: '#/components/schemas/SourceErr'
      type: object
    ModelsError:
      properties:
        code:
          description: Error code indicating the type of error
          type: integer
        message:
          description: Detailed error message
          type: string
      type: object
    ModelsPatient:
      properties:
        care_contexts:
          description: List of care contexts of the patient
          items:
            $ref: '#/components/schemas/ModelsCareContext'
          type:
            - array
            - 'null'
        display:
          description: Display name or identifier for the patient
          type: string
        hi_type:
          description: Type of health information (HI)
          enum:
            - OPConsultation
            - Prescription
            - DischargeSummary
            - DiagnosticReport
            - ImmunizationRecord
            - HealthDocumentRecord
            - WellnessRecord
          type: string
        ref_num:
          description: patient reference number.
          type: string
      type: object
    SourceErr:
      properties:
        code:
          type: string
        message:
          type: string
      type: object
    ModelsCareContext:
      properties:
        display:
          description: Display name or identifier for the care context
          type: string
        ref_num:
          description: Unique reference number for the care context
          type: string
      type: object
  securitySchemes:
    authApiKey:
      description: The API requires a Bearer token (JWT) for authentication.
      scheme: bearer
      type: http

````