> ## Documentation Index
> Fetch the complete documentation index at: https://ekacare-quickstart-cleanup.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Consent create



## OpenAPI

````yaml post /abdm/v1/consents/create
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/create:
    post:
      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/ConsentCreateConsentRequest'
      responses:
        '204':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentCreateConsentResponse'
          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:
    ConsentCreateConsentRequest:
      properties:
        appointment_id:
          type: string
        care_contexts:
          items:
            $ref: '#/components/schemas/CommonsCareContextIdentifier'
          type: array
        hip_identifier:
          $ref: '#/components/schemas/CommonsHipIdentifier'
        hiu:
          $ref: '#/components/schemas/ConsentEkaHiuIdentifier'
        patient:
          $ref: '#/components/schemas/CommonsEkaPatientReference'
        period:
          $ref: '#/components/schemas/CommonsPeriodWithExpiry'
        purpose:
          enum:
            - Self Requested
            - Care management
            - Public Health
            - Disease Specific Health Research
          type: string
        record_types:
          description: |-
            Available options: OPConsultation,
            Prescription,
            DischargeSummary,
            DiagnosticReport,
            ImmunizationRecord,
            HealthDocumentRecord,
            WellnessRecord
          enum:
            - OPConsultation
            - Prescription
            - DischargeSummary
            - DiagnosticReport
            - ImmunizationRecord
            - HealthDocumentRecord
            - WellnessRecord
          items:
            type: string
          type:
            - array
            - 'null'
      type: object
    ConsentCreateConsentResponse:
      properties:
        consent_init_id:
          type: string
      type: object
    GenericError:
      properties:
        code:
          type: integer
        error:
          type: string
        source_error:
          $ref: '#/components/schemas/SourceErr'
      type: object
    CommonsCareContextIdentifier:
      properties:
        cc_ref:
          type: string
        patient_ref:
          type: string
      type: object
    CommonsHipIdentifier:
      properties:
        id:
          type: string
        name:
          type: string
      type: object
    ConsentEkaHiuIdentifier:
      properties:
        clinic_id:
          examples:
            - afsdfj786fges87f68g8
          type: string
        d_oid:
          examples:
            - '162835406498984'
          type: string
        requester:
          $ref: '#/components/schemas/ConsentRequester'
      type: object
    CommonsEkaPatientReference:
      properties:
        health_id:
          examples:
            - bobthebuilder@abdm
          type: string
        oid:
          examples:
            - '162835406498984'
          type: string
      type: object
    CommonsPeriodWithExpiry:
      properties:
        expiry:
          examples:
            - '2009-11-10T23:00:00Z'
          format: date-time
          type: string
        from:
          examples:
            - '2009-11-10T23:00:00Z'
          format: date-time
          type: string
        to:
          examples:
            - '2009-11-10T23:00:00Z'
          format: date-time
          type: string
      type: object
    SourceErr:
      properties:
        code:
          type: string
        message:
          type: string
      type: object
    ConsentRequester:
      properties:
        identifier:
          $ref: '#/components/schemas/ConsentRequesterIden'
        name:
          type: string
      type: object
    ConsentRequesterIden:
      properties:
        system:
          type: string
        type:
          type: string
        value:
          type: string
      type: object
  securitySchemes:
    authApiKey:
      description: The API requires a Bearer token (JWT) for authentication.
      scheme: bearer
      type: http

````