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

# Consent approve

> This endpoint is used to approve the consent



## OpenAPI

````yaml post /abdm/v1/consents/approve
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/consents/approve:
    post:
      description: This endpoint is used to approve the consent
      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
        - description: OID is used to Identify the user.
          in: query
          name: oid
          schema:
            description: OID is used to Identify the user.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveRequest'
      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:
    ApproveRequest:
      properties:
        access_mode:
          enum:
            - view
          type: string
        consent_artefacts:
          description: List of consent artefacts.
          items:
            $ref: '#/components/schemas/ApproveConsent'
          type:
            - array
            - 'null'
        duration:
          $ref: '#/components/schemas/CommonsDuration'
        erase_at:
          format: date-time
          type: string
        hi_types:
          items:
            type: string
          type:
            - array
            - 'null'
        id:
          description: Unique identifier of a consent, also called the consent ID.
          type: string
      required:
        - id
        - consent_artefacts
      type: object
    GenericError:
      properties:
        code:
          type: integer
        error:
          type: string
        source_error:
          $ref: '#/components/schemas/SourceErr'
      type: object
    ApproveConsent:
      properties:
        access_mode:
          enum:
            - view
          type: string
        care_contexts:
          items:
            $ref: '#/components/schemas/CommonsCareContext'
          type:
            - array
            - 'null'
        duration:
          $ref: '#/components/schemas/CommonsDuration'
        erase_at:
          format: date-time
          type: string
        hi_types:
          items:
            type: string
          type:
            - array
            - 'null'
        hip_id:
          type: string
      type: object
    CommonsDuration:
      properties:
        from:
          description: Start time of the consent
          format: date-time
          type: string
        to:
          description: End time of the consent
          format: date-time
          type: string
      type: object
    SourceErr:
      properties:
        code:
          type: string
        message:
          type: string
      type: object
    CommonsCareContext:
      properties:
        display:
          description: Care Context Display Name
          examples:
            - Heart Rate 2020
          type: string
        id:
          description: Care Context ID
          examples:
            - heart-rate-2020
          type: string
      type: object
  securitySchemes:
    authApiKey:
      description: The API requires a Bearer token (JWT) for authentication.
      scheme: bearer
      type: http

````