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

# Create Eka User

> 
### Overview
Create a new Eka User (HIP User) for your business. This endpoint lets you register a user with their personal details and assign them to specific doctors and clinics.

**Endpoint:** `{{HOST}}/cdr/v1/ekauser`

**Method:** `POST`
### Request Parameters

| Parameter    | Type    | Description                                           | Required |
|--------------|---------|-------------------------------------------------------|----------|
| firstname    | string  | User's first name                                     | Yes      |
| lastname     | string  | User's last name                                      | Yes      |
| mobile       | string  | User's mobile number (10 digits)                      | Yes*     |
| email        | string  | User's email address                                  | Yes*     |
| auth_userid  | string  | auth_userid is used for the SSO authentication        | Yes*     |
| gender       | string  | User's gender (M/F/O)                                 | Yes      |
| dob          | string  | User's date of birth (YYYY-MM-DD)                     | Yes      |
| is_admin     | boolean | Whether the user is an admin                          | No       |
| seat_type    | string  | Seat type (b - basic, p - premium). Default: b        | No       |
| persona      | string  | User persona (S - Staff, D - Doctor). Default: D      | No       |
| doctor_ids   | array   | List of doctor Eka IDs to assign to this user         | No       |
| partner_doctor_ids   | array   | List of partner doctor IDs to assign to this user         | No       |
| clinic_ids   | array   | List of clinic Eka IDs to assign to this user         | No       |
| partner_clinic_ids   | array   | List of partner clinic IDs to assign to this user         | No       |
> **Note:** Either `mobile` or `email` or `auth_userid` is required. At least one must be provided.


### Response Parameters

| Parameter | Type   | Description                                   |
| --------- | ------ | --------------------------------------------- |
| status    | string | Status of the response (e.g., "success")      |
| ekaid     | string | Unique identifier for the created Eka User    |



## OpenAPI

````yaml post /cdr/v1/ekauser/
openapi: 3.0.0
info:
  title: Ekacare API & Webhook Documentation
  contact: {}
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /cdr/v1/ekauser/:
    post:
      tags:
        - HIP Users API
      summary: Create Eka User
      description: >-

        ### Overview

        Create a new Eka User (HIP User) for your business. This endpoint lets
        you register a user with their personal details and assign them to
        specific doctors and clinics.


        **Endpoint:** `{{HOST}}/cdr/v1/ekauser`


        **Method:** `POST`

        ### Request Parameters


        | Parameter    | Type    |
        Description                                           | Required |

        |--------------|---------|-------------------------------------------------------|----------|

        | firstname    | string  | User's first
        name                                     | Yes      |

        | lastname     | string  | User's last
        name                                      | Yes      |

        | mobile       | string  | User's mobile number (10
        digits)                      | Yes*     |

        | email        | string  | User's email
        address                                  | Yes*     |

        | auth_userid  | string  | auth_userid is used for the SSO
        authentication        | Yes*     |

        | gender       | string  | User's gender
        (M/F/O)                                 | Yes      |

        | dob          | string  | User's date of birth
        (YYYY-MM-DD)                     | Yes      |

        | is_admin     | boolean | Whether the user is an
        admin                          | No       |

        | seat_type    | string  | Seat type (b - basic, p - premium). Default:
        b        | No       |

        | persona      | string  | User persona (S - Staff, D - Doctor).
        Default: D      | No       |

        | doctor_ids   | array   | List of doctor Eka IDs to assign to this
        user         | No       |

        | partner_doctor_ids   | array   | List of partner doctor IDs to assign
        to this user         | No       |

        | clinic_ids   | array   | List of clinic Eka IDs to assign to this
        user         | No       |

        | partner_clinic_ids   | array   | List of partner clinic IDs to assign
        to this user         | No       |

        > **Note:** Either `mobile` or `email` or `auth_userid` is required. At
        least one must be provided.



        ### Response Parameters


        | Parameter | Type   | Description                                   |

        | --------- | ------ | --------------------------------------------- |

        | status    | string | Status of the response (e.g., "success")      |

        | ekaid     | string | Unique identifier for the created Eka User    |
      operationId: CreateEkaUser
      parameters:
        - name: auth
          in: header
          description: >-
            The auth token of the business. It is used to authenticate the
            client. This should be fetched from auth api.
          required: true
          style: simple
          schema:
            type: string
            example: >-
              eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
      requestBody:
        description: Request body for creating an Eka User
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - firstname
                - lastname
                - gender
                - dob
              properties:
                firstname:
                  type: string
                  description: User's first name
                  example: Amit
                lastname:
                  type: string
                  description: User's last name
                  example: Kumar
                mobile:
                  type: string
                  description: >-
                    User's mobile number (10 digits). Either mobile or email or
                    auth_userid is required.
                  example: '0000011111'
                email:
                  type: string
                  format: email
                  description: >-
                    User's email address. Either mobile or email or auth_userid
                    is required.
                  example: amit.kumar@example.com
                auth_userid:
                  type: string
                  description: >-
                    auth_userid used for SSO authentication. Either mobile or
                    email or auth_userid is required
                  example: Prateek_@_123
                gender:
                  type: string
                  enum:
                    - M
                    - F
                    - O
                  description: User's gender (M - Male, F - Female, O - Other)
                  example: M
                dob:
                  type: string
                  format: date
                  description: User's date of birth in YYYY-MM-DD format
                  example: '1990-05-15'
                is_admin:
                  type: boolean
                  description: Whether the user has admin privileges
                  default: false
                  example: false
                seat_type:
                  type: string
                  enum:
                    - b
                    - p
                  description: 'Seat type (b - basic, p - premium). Default: b'
                  example: b
                persona:
                  type: string
                  enum:
                    - S
                    - D
                  description: 'User persona (S - Staff, D - Doctor). Default: D'
                  example: D
                doctor_ids:
                  type: array
                  items:
                    type: string
                  description: List of doctor Eka IDs to assign to this user
                  example:
                    - '171266028552522'
                    - '171266028552523'
                partner_doctor_ids:
                  type: array
                  items:
                    type: string
                  description: List of partner doctor IDs to assign to this user
                  example:
                    - Part_doc_1
                    - Part_doc_2
                clinic_ids:
                  type: array
                  items:
                    type: string
                  description: List of clinic Eka IDs to assign to this user
                  example:
                    - c-314086a34253rd
                    - c-415197b45364se
                partner_clinic_ids:
                  type: array
                  items:
                    type: string
                  description: List of partner clinic IDs to assign to this user
                  example:
                    - Part_clinic_1
                    - Part_clinic_2
            example:
              firstname: Amit
              lastname: Kumar
              mobile: '9876543210'
              email: amit.kumar@example.com
              auth_userid: Prateek_@_123
              gender: M
              dob: '1990-05-15'
              is_admin: false
              seat_type: b
              persona: D
              doctor_ids:
                - '171266028552522'
                - '171266028552523'
              clinic_ids:
                - c-314086a34253rd
                - c-415197b45364se
              partner_doctor_ids:
                - Part_doc_1
                - Part_doc_2
              partner_clinic_ids:
                - Part_clinic_1
                - Part_clinic_2
      responses:
        '201':
          description: Created - Eka User successfully created
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  ekaid:
                    type: string
                    description: Unique identifier for the created Eka User
                    example: '176917697553584'
        '400':
          description: Bad Request - Invalid or missing required parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  <field>:
                    type: array
                    items:
                      type: string
                      example: This field is required.
                  message:
                    type: array
                    items:
                      type: string
                      example: >-
                        Only one of doctor_ids or partner_doctor_ids should be
                        provided, not both.
      deprecated: false

````