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

# Create Case

> This endpoint creates a new medical case.



## OpenAPI

````yaml post /mr/api/v1/cases
openapi: 3.0.0
info:
  title: Document Upload API
  description: API to pre-sign the URL for uploading documents.
  version: 1.0.0
  license:
    name: Proprietary License
    url: https://developer.eka.care/license
servers:
  - url: https://api.eka.care
    description: Production server
  - url: https://api.dev.eka.care
    description: Development server
security: []
tags:
  - name: Records
    description: API related to records document management.
paths:
  /mr/api/v1/cases:
    post:
      tags:
        - Cases
      summary: Create Case
      description: This endpoint creates a new medical case.
      parameters:
        - in: header
          name: X-Pt-Id
          required: true
          schema:
            type: string
          description: Patient ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: |
                    Unique identifier for the case.
                  example: CASE_ID
                display_name:
                  type: string
                  description: Human-readable name for the case
                  example: Leg Injury
                hi_type:
                  type: string
                  enum:
                    - OPConsultation
                    - Prescription
                    - DischargeSummary
                    - DiagnosticReport
                    - ImmunizationRecord
                    - HealthDocumentRecord
                    - WellnessRecord
                  description: |
                    Type of case
                  example: OPConsultation
                occurred_at:
                  type: integer
                  format: unixtime
                  description: Timestamp when the event occurred (Unix timestamp)
                  example: 1678886400
                type:
                  type: string
                  description: Type of the case
                  example: OP
                partner_meta:
                  type: object
                  additionalProperties: true
                  description: |
                    metadata attached to the case.
                  example:
                    facility_id: GH
                    uhid: UHID_1234
              required:
                - occurred_at
                - id
                - display_name
      responses:
        '200':
          description: Case created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the newly created case
                    example: case_12345
        '400':
          description: Bad request – missing or invalid fields in the request body
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: 'Missing required field: type'
                  code:
                    type: string
                    example: BAD_REQUEST
        '401':
          description: Unauthorized – invalid or missing token
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized access. Invalid token.
                  code:
                    type: string
                    example: UNAUTHORIZED
        '409':
          description: Case already Exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Case Already Exist
        '500':
          description: Internal server error – unexpected issue while processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: An unexpected error occurred while creating the case.
                  code:
                    type: string
                    example: INTERNAL_SERVER_ERROR
      security:
        - auth: []
components:
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````