curl --request PATCH \
--url https://api.eka.care/appointments/v1/{appointment_id}/reschedule \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"start_time": 1730189586,
"end_time": 1730193186,
"partner_appointment_id": "api-3f9c2b18-7e44-4a51-9"
}
'import requests
url = "https://api.eka.care/appointments/v1/{appointment_id}/reschedule"
payload = {
"start_time": 1730189586,
"end_time": 1730193186,
"partner_appointment_id": "api-3f9c2b18-7e44-4a51-9"
}
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({
start_time: 1730189586,
end_time: 1730193186,
partner_appointment_id: 'api-3f9c2b18-7e44-4a51-9'
})
};
fetch('https://api.eka.care/appointments/v1/{appointment_id}/reschedule', 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/appointments/v1/{appointment_id}/reschedule",
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([
'start_time' => 1730189586,
'end_time' => 1730193186,
'partner_appointment_id' => 'api-3f9c2b18-7e44-4a51-9'
]),
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/appointments/v1/{appointment_id}/reschedule"
payload := strings.NewReader("{\n \"start_time\": 1730189586,\n \"end_time\": 1730193186,\n \"partner_appointment_id\": \"api-3f9c2b18-7e44-4a51-9\"\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/appointments/v1/{appointment_id}/reschedule")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": 1730189586,\n \"end_time\": 1730193186,\n \"partner_appointment_id\": \"api-3f9c2b18-7e44-4a51-9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/appointments/v1/{appointment_id}/reschedule")
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 \"start_time\": 1730189586,\n \"end_time\": 1730193186,\n \"partner_appointment_id\": \"api-3f9c2b18-7e44-4a51-9\"\n}"
response = http.request(request)
puts response.read_body{
"appointment_id": "api-3f9c2b18-7e44-4a51-9c2d-1b6f0a8e5d23",
"patient_id": "patient-oid-123",
"doctor_id": "doctor-oid-456",
"clinic_id": "clinic-789",
"status": "BK",
"mode": "IN_CLINIC",
"start_time": 1730189586,
"end_time": 1730193186,
"created_at": 1730185000,
"prev_aids": [
"api-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
]
}{
"message": "end_time must be after start_time"
}{
"message": "unauthenticated"
}{
"message": "Appointment \"api-1a2b3c4d\" was not found"
}{
"message": "Appointment \"api-3f9c2b18\" already exists"
}Reschedule Appointment
Overview
This API is used to reschedule an appointment. Rescheduling does not update the existing appointment. Instead, a brand new appointment is created with the supplied start_time and end_time, while the previous appointment’s status is marked as RES (which represents rescheduled).
The newly created appointment carries a prev_aids field — an array containing the ids of the previous, rescheduled appointment(s). Each previous appointment in turn carries a next_aid field, which holds the id of the next appointment it was rescheduled to. This forms a linked chain across the reschedule history.
The response of this API is the new appointment that is created as a result of the reschedule.
curl --request PATCH \
--url https://api.eka.care/appointments/v1/{appointment_id}/reschedule \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"start_time": 1730189586,
"end_time": 1730193186,
"partner_appointment_id": "api-3f9c2b18-7e44-4a51-9"
}
'import requests
url = "https://api.eka.care/appointments/v1/{appointment_id}/reschedule"
payload = {
"start_time": 1730189586,
"end_time": 1730193186,
"partner_appointment_id": "api-3f9c2b18-7e44-4a51-9"
}
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({
start_time: 1730189586,
end_time: 1730193186,
partner_appointment_id: 'api-3f9c2b18-7e44-4a51-9'
})
};
fetch('https://api.eka.care/appointments/v1/{appointment_id}/reschedule', 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/appointments/v1/{appointment_id}/reschedule",
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([
'start_time' => 1730189586,
'end_time' => 1730193186,
'partner_appointment_id' => 'api-3f9c2b18-7e44-4a51-9'
]),
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/appointments/v1/{appointment_id}/reschedule"
payload := strings.NewReader("{\n \"start_time\": 1730189586,\n \"end_time\": 1730193186,\n \"partner_appointment_id\": \"api-3f9c2b18-7e44-4a51-9\"\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/appointments/v1/{appointment_id}/reschedule")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": 1730189586,\n \"end_time\": 1730193186,\n \"partner_appointment_id\": \"api-3f9c2b18-7e44-4a51-9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/appointments/v1/{appointment_id}/reschedule")
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 \"start_time\": 1730189586,\n \"end_time\": 1730193186,\n \"partner_appointment_id\": \"api-3f9c2b18-7e44-4a51-9\"\n}"
response = http.request(request)
puts response.read_body{
"appointment_id": "api-3f9c2b18-7e44-4a51-9c2d-1b6f0a8e5d23",
"patient_id": "patient-oid-123",
"doctor_id": "doctor-oid-456",
"clinic_id": "clinic-789",
"status": "BK",
"mode": "IN_CLINIC",
"start_time": 1730189586,
"end_time": 1730193186,
"created_at": 1730185000,
"prev_aids": [
"api-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
]
}{
"message": "end_time must be after start_time"
}{
"message": "unauthenticated"
}{
"message": "Appointment \"api-1a2b3c4d\" was not found"
}{
"message": "Appointment \"api-3f9c2b18\" already exists"
}Headers
Path Parameters
The id (aid) of the existing appointment to reschedule. When partner_appointment_id is supplied, this is treated as the partner appointment id.
Body
New start time of the appointment as a Unix epoch in seconds.
1730189586
New end time of the appointment as a Unix epoch in seconds. Must be after start_time.
1730193186
Optional partner-provided appointment id. When omitted, the server generates the new appointment id and the appointment_id path param is used as-is. When supplied, the new id is derived with the help of this field and the appointment_id path param is treated as a partner appointment id.
Response
OK — the newly created (rescheduled) appointment.
Id of the newly created appointment.
Start time as a Unix epoch in seconds.
End time as a Unix epoch in seconds.
Creation time as a Unix epoch in seconds.
Ids of the previous rescheduled appointment(s).
Id of the next appointment this one was rescheduled to. Present only on previous appointments.
Was this page helpful?

