Skip to main content
PATCH
/
dr
/
v1
/
patient
/
{patient_id}
Update Patient Details
curl --request PATCH \
  --url https://api.eka.care/dr/v1/patient/{patient_id} \
  --header 'Content-Type: application/json' \
  --header 'auth: <auth>' \
  --data '
{
  "dob": "1987-01-06",
  "designation": "Mr.",
  "first_name": "Test",
  "middle_name": "",
  "last_name": "Patient",
  "gender": "M",
  "address": {
    "city": "Bangalore",
    "line1": "ABC",
    "line2": "XYZ",
    "pincode": 560049,
    "state": "Karnataka",
    "country": "India"
  },
  "partner_meta": {
    "key1": "value1"
  }
}
'
import requests

url = "https://api.eka.care/dr/v1/patient/{patient_id}"

payload = {
"dob": "1987-01-06",
"designation": "Mr.",
"first_name": "Test",
"middle_name": "",
"last_name": "Patient",
"gender": "M",
"address": {
"city": "Bangalore",
"line1": "ABC",
"line2": "XYZ",
"pincode": 560049,
"state": "Karnataka",
"country": "India"
},
"partner_meta": { "key1": "value1" }
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dob: '1987-01-06',
designation: 'Mr.',
first_name: 'Test',
middle_name: '',
last_name: 'Patient',
gender: 'M',
address: {
city: 'Bangalore',
line1: 'ABC',
line2: 'XYZ',
pincode: 560049,
state: 'Karnataka',
country: 'India'
},
partner_meta: {key1: 'value1'}
})
};

fetch('https://api.eka.care/dr/v1/patient/{patient_id}', 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/dr/v1/patient/{patient_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'dob' => '1987-01-06',
'designation' => 'Mr.',
'first_name' => 'Test',
'middle_name' => '',
'last_name' => 'Patient',
'gender' => 'M',
'address' => [
'city' => 'Bangalore',
'line1' => 'ABC',
'line2' => 'XYZ',
'pincode' => 560049,
'state' => 'Karnataka',
'country' => 'India'
],
'partner_meta' => [
'key1' => 'value1'
]
]),
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/dr/v1/patient/{patient_id}"

payload := strings.NewReader("{\n \"dob\": \"1987-01-06\",\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"gender\": \"M\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"line1\": \"ABC\",\n \"line2\": \"XYZ\",\n \"pincode\": 560049,\n \"state\": \"Karnataka\",\n \"country\": \"India\"\n },\n \"partner_meta\": {\n \"key1\": \"value1\"\n }\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.eka.care/dr/v1/patient/{patient_id}")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"dob\": \"1987-01-06\",\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"gender\": \"M\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"line1\": \"ABC\",\n \"line2\": \"XYZ\",\n \"pincode\": 560049,\n \"state\": \"Karnataka\",\n \"country\": \"India\"\n },\n \"partner_meta\": {\n \"key1\": \"value1\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.eka.care/dr/v1/patient/{patient_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dob\": \"1987-01-06\",\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"gender\": \"M\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"line1\": \"ABC\",\n \"line2\": \"XYZ\",\n \"pincode\": 560049,\n \"state\": \"Karnataka\",\n \"country\": \"India\"\n },\n \"partner_meta\": {\n \"key1\": \"value1\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "patient_id": "123456789"
}
{
"error": {
"code": "NOT_ALLOWED",
"message": "You are not allowed to add resource"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}

Headers

auth
string
required

The auth token of business_id. It is used to authenticate the business. The token can be fetched from the auth api.

Path Parameters

patient_id
string
required

Query Parameters

partner_id
string
required

If set to 1 then appointment_id in path parameter should be partner_appointment_id else eka apppointment_id

Example:

"1"

Body

application/json

Request body for updating a patient to the directory

dob
string<date>

Date of birth of the patient (YYYY-MM-DD)

Example:

"1987-01-06"

designation
enum<string>

Title or designation of the patient

Available options:
Mr.,
Ms.,
Mrs.,
Miss.,
Kumar.,
Shri.,
Smt.,
Dr.,
Master.,
Baby.,
Mohd.,
B/O
Example:

"Mr."

first_name
string

First name of the patient

Example:

"Test"

middle_name
string

Middle name of the patient (if any)

Example:

""

last_name
string

Last name of the patient

Example:

"Patient"

gender
enum<string>

Gender of the patient (e.g., 'M' for male, 'F' for female, 'O' for others)

Available options:
M,
F,
O
Example:

"M"

address
object

Address details of the patient

partner_meta
object

Response

OK

patient_id
string
Example:

"123456789"