curl --request POST \
--url https://api.eka.care/cdr/v1/ekauser/ \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"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"
]
}
'import requests
url = "https://api.eka.care/cdr/v1/ekauser/"
payload = {
"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"]
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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']
})
};
fetch('https://api.eka.care/cdr/v1/ekauser/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/cdr/v1/ekauser/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <auth>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/cdr/v1/ekauser/"
payload := strings.NewReader("{\n \"firstname\": \"Amit\",\n \"lastname\": \"Kumar\",\n \"mobile\": \"9876543210\",\n \"email\": \"amit.kumar@example.com\",\n \"auth_userid\": \"Prateek_@_123\",\n \"gender\": \"M\",\n \"dob\": \"1990-05-15\",\n \"is_admin\": false,\n \"seat_type\": \"b\",\n \"persona\": \"D\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"clinic_ids\": [\n \"c-314086a34253rd\",\n \"c-415197b45364se\"\n ],\n \"partner_doctor_ids\": [\n \"Part_doc_1\",\n \"Part_doc_2\"\n ],\n \"partner_clinic_ids\": [\n \"Part_clinic_1\",\n \"Part_clinic_2\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<auth>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eka.care/cdr/v1/ekauser/")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"firstname\": \"Amit\",\n \"lastname\": \"Kumar\",\n \"mobile\": \"9876543210\",\n \"email\": \"amit.kumar@example.com\",\n \"auth_userid\": \"Prateek_@_123\",\n \"gender\": \"M\",\n \"dob\": \"1990-05-15\",\n \"is_admin\": false,\n \"seat_type\": \"b\",\n \"persona\": \"D\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"clinic_ids\": [\n \"c-314086a34253rd\",\n \"c-415197b45364se\"\n ],\n \"partner_doctor_ids\": [\n \"Part_doc_1\",\n \"Part_doc_2\"\n ],\n \"partner_clinic_ids\": [\n \"Part_clinic_1\",\n \"Part_clinic_2\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/cdr/v1/ekauser/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstname\": \"Amit\",\n \"lastname\": \"Kumar\",\n \"mobile\": \"9876543210\",\n \"email\": \"amit.kumar@example.com\",\n \"auth_userid\": \"Prateek_@_123\",\n \"gender\": \"M\",\n \"dob\": \"1990-05-15\",\n \"is_admin\": false,\n \"seat_type\": \"b\",\n \"persona\": \"D\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"clinic_ids\": [\n \"c-314086a34253rd\",\n \"c-415197b45364se\"\n ],\n \"partner_doctor_ids\": [\n \"Part_doc_1\",\n \"Part_doc_2\"\n ],\n \"partner_clinic_ids\": [\n \"Part_clinic_1\",\n \"Part_clinic_2\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"ekaid": "176917697553584"
}{
"<field>": [
"This field is required."
],
"message": [
"Only one of doctor_ids or partner_doctor_ids should be provided, not both."
]
}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* |
| 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
mobileorauth_useridis 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 |
curl --request POST \
--url https://api.eka.care/cdr/v1/ekauser/ \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"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"
]
}
'import requests
url = "https://api.eka.care/cdr/v1/ekauser/"
payload = {
"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"]
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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']
})
};
fetch('https://api.eka.care/cdr/v1/ekauser/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/cdr/v1/ekauser/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <auth>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/cdr/v1/ekauser/"
payload := strings.NewReader("{\n \"firstname\": \"Amit\",\n \"lastname\": \"Kumar\",\n \"mobile\": \"9876543210\",\n \"email\": \"amit.kumar@example.com\",\n \"auth_userid\": \"Prateek_@_123\",\n \"gender\": \"M\",\n \"dob\": \"1990-05-15\",\n \"is_admin\": false,\n \"seat_type\": \"b\",\n \"persona\": \"D\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"clinic_ids\": [\n \"c-314086a34253rd\",\n \"c-415197b45364se\"\n ],\n \"partner_doctor_ids\": [\n \"Part_doc_1\",\n \"Part_doc_2\"\n ],\n \"partner_clinic_ids\": [\n \"Part_clinic_1\",\n \"Part_clinic_2\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<auth>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eka.care/cdr/v1/ekauser/")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"firstname\": \"Amit\",\n \"lastname\": \"Kumar\",\n \"mobile\": \"9876543210\",\n \"email\": \"amit.kumar@example.com\",\n \"auth_userid\": \"Prateek_@_123\",\n \"gender\": \"M\",\n \"dob\": \"1990-05-15\",\n \"is_admin\": false,\n \"seat_type\": \"b\",\n \"persona\": \"D\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"clinic_ids\": [\n \"c-314086a34253rd\",\n \"c-415197b45364se\"\n ],\n \"partner_doctor_ids\": [\n \"Part_doc_1\",\n \"Part_doc_2\"\n ],\n \"partner_clinic_ids\": [\n \"Part_clinic_1\",\n \"Part_clinic_2\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/cdr/v1/ekauser/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstname\": \"Amit\",\n \"lastname\": \"Kumar\",\n \"mobile\": \"9876543210\",\n \"email\": \"amit.kumar@example.com\",\n \"auth_userid\": \"Prateek_@_123\",\n \"gender\": \"M\",\n \"dob\": \"1990-05-15\",\n \"is_admin\": false,\n \"seat_type\": \"b\",\n \"persona\": \"D\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"clinic_ids\": [\n \"c-314086a34253rd\",\n \"c-415197b45364se\"\n ],\n \"partner_doctor_ids\": [\n \"Part_doc_1\",\n \"Part_doc_2\"\n ],\n \"partner_clinic_ids\": [\n \"Part_clinic_1\",\n \"Part_clinic_2\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"ekaid": "176917697553584"
}{
"<field>": [
"This field is required."
],
"message": [
"Only one of doctor_ids or partner_doctor_ids should be provided, not both."
]
}Headers
The auth token of the business. It is used to authenticate the client. This should be fetched from auth api.
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM"
Body
Request body for creating an Eka User
User's first name
"Amit"
User's last name
"Kumar"
User's gender (M - Male, F - Female, O - Other)
M, F, O "M"
User's date of birth in YYYY-MM-DD format
"1990-05-15"
User's mobile number (10 digits). Either mobile or email or auth_userid is required.
"0000011111"
User's email address. Either mobile or email or auth_userid is required.
"amit.kumar@example.com"
auth_userid used for SSO authentication. Either mobile or email or auth_userid is required
"Prateek_@_123"
Whether the user has admin privileges
false
Seat type (b - basic, p - premium). Default: b
b, p "b"
User persona (S - Staff, D - Doctor). Default: D
S, D "D"
List of doctor Eka IDs to assign to this user
["171266028552522", "171266028552523"]
List of partner doctor IDs to assign to this user
["Part_doc_1", "Part_doc_2"]
List of clinic Eka IDs to assign to this user
["c-314086a34253rd", "c-415197b45364se"]
List of partner clinic IDs to assign to this user
["Part_clinic_1", "Part_clinic_2"]
Was this page helpful?

