curl --request POST \
--url https://api.eka.care/schedule \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"name": "Dr. Sharma - OPD",
"entity_id": "doc_12345",
"location_id": "c-98765",
"config": {
"overbooking_limit": 2,
"schedule_slot_config_enabled": true,
"slot_durations": [
15,
30
]
},
"timebounds": {
"weekly": {
"1": {
"is_enabled": true,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": [
"conf_abc123"
]
},
{
"s": 1400,
"e": 1800,
"conf_ids": [
"conf_abc123"
]
}
]
},
"2": {
"is_enabled": true,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": [
"conf_abc123"
]
}
]
}
},
"daily": {
"2026-10-15": {
"is_enabled": true,
"bounds": [
{
"s": 1000,
"e": 1200,
"conf_ids": [
"conf_abc123"
]
}
]
}
},
"repeat-weekly": [
{
"repeat_every": 2,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2027-03-21",
"phases": [
{
"3": {
"is_enabled": true,
"bounds": [
{
"s": 1600,
"e": 1900,
"conf_ids": [
"conf_abc123"
]
}
]
}
},
{
"3": {
"is_enabled": false,
"bounds": []
}
}
]
}
],
"repeat-daily": [
{
"phase_index": 0,
"repeat_every": 3,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2026-12-31",
"is_enabled": true,
"bounds": [
{
"s": 900,
"e": 1100,
"conf_ids": [
"conf_abc123"
]
}
]
}
],
"block": [
{
"start_date": "2026-10-20",
"end_date": "2026-10-22",
"start_time": "09:00",
"end_time": "18:00"
}
]
},
"productMap": {
"product-emr": true
}
}
'import requests
url = "https://api.eka.care/schedule"
payload = {
"name": "Dr. Sharma - OPD",
"entity_id": "doc_12345",
"location_id": "c-98765",
"config": {
"overbooking_limit": 2,
"schedule_slot_config_enabled": True,
"slot_durations": [15, 30]
},
"timebounds": {
"weekly": {
"1": {
"is_enabled": True,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": ["conf_abc123"]
},
{
"s": 1400,
"e": 1800,
"conf_ids": ["conf_abc123"]
}
]
},
"2": {
"is_enabled": True,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": ["conf_abc123"]
}
]
}
},
"daily": { "2026-10-15": {
"is_enabled": True,
"bounds": [
{
"s": 1000,
"e": 1200,
"conf_ids": ["conf_abc123"]
}
]
} },
"repeat-weekly": [
{
"repeat_every": 2,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2027-03-21",
"phases": [{ "3": {
"is_enabled": True,
"bounds": [
{
"s": 1600,
"e": 1900,
"conf_ids": ["conf_abc123"]
}
]
} }, { "3": {
"is_enabled": False,
"bounds": []
} }]
}
],
"repeat-daily": [
{
"phase_index": 0,
"repeat_every": 3,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2026-12-31",
"is_enabled": True,
"bounds": [
{
"s": 900,
"e": 1100,
"conf_ids": ["conf_abc123"]
}
]
}
],
"block": [
{
"start_date": "2026-10-20",
"end_date": "2026-10-22",
"start_time": "09:00",
"end_time": "18:00"
}
]
},
"productMap": { "product-emr": True }
}
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({
name: 'Dr. Sharma - OPD',
entity_id: 'doc_12345',
location_id: 'c-98765',
config: {
overbooking_limit: 2,
schedule_slot_config_enabled: true,
slot_durations: [15, 30]
},
timebounds: {
weekly: {
'1': {
is_enabled: true,
bounds: [
{s: 900, e: 1300, conf_ids: ['conf_abc123']},
{s: 1400, e: 1800, conf_ids: ['conf_abc123']}
]
},
'2': {is_enabled: true, bounds: [{s: 900, e: 1300, conf_ids: ['conf_abc123']}]}
},
daily: {
'2026-10-15': {is_enabled: true, bounds: [{s: 1000, e: 1200, conf_ids: ['conf_abc123']}]}
},
'repeat-weekly': [
{
repeat_every: 2,
anchor_date: '2026-09-21',
start_date: '2026-09-21',
end_date: '2027-03-21',
phases: [
{
'3': {is_enabled: true, bounds: [{s: 1600, e: 1900, conf_ids: ['conf_abc123']}]}
},
{'3': {is_enabled: false, bounds: []}}
]
}
],
'repeat-daily': [
{
phase_index: 0,
repeat_every: 3,
anchor_date: '2026-09-21',
start_date: '2026-09-21',
end_date: '2026-12-31',
is_enabled: true,
bounds: [{s: 900, e: 1100, conf_ids: ['conf_abc123']}]
}
],
block: [
{
start_date: '2026-10-20',
end_date: '2026-10-22',
start_time: '09:00',
end_time: '18:00'
}
]
},
productMap: {'product-emr': true}
})
};
fetch('https://api.eka.care/schedule', 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/schedule",
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([
'name' => 'Dr. Sharma - OPD',
'entity_id' => 'doc_12345',
'location_id' => 'c-98765',
'config' => [
'overbooking_limit' => 2,
'schedule_slot_config_enabled' => true,
'slot_durations' => [
15,
30
]
],
'timebounds' => [
'weekly' => [
'1' => [
'is_enabled' => true,
'bounds' => [
[
's' => 900,
'e' => 1300,
'conf_ids' => [
'conf_abc123'
]
],
[
's' => 1400,
'e' => 1800,
'conf_ids' => [
'conf_abc123'
]
]
]
],
'2' => [
'is_enabled' => true,
'bounds' => [
[
's' => 900,
'e' => 1300,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
'daily' => [
'2026-10-15' => [
'is_enabled' => true,
'bounds' => [
[
's' => 1000,
'e' => 1200,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
'repeat-weekly' => [
[
'repeat_every' => 2,
'anchor_date' => '2026-09-21',
'start_date' => '2026-09-21',
'end_date' => '2027-03-21',
'phases' => [
[
'3' => [
'is_enabled' => true,
'bounds' => [
[
's' => 1600,
'e' => 1900,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
[
'3' => [
'is_enabled' => false,
'bounds' => [
]
]
]
]
]
],
'repeat-daily' => [
[
'phase_index' => 0,
'repeat_every' => 3,
'anchor_date' => '2026-09-21',
'start_date' => '2026-09-21',
'end_date' => '2026-12-31',
'is_enabled' => true,
'bounds' => [
[
's' => 900,
'e' => 1100,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
'block' => [
[
'start_date' => '2026-10-20',
'end_date' => '2026-10-22',
'start_time' => '09:00',
'end_time' => '18:00'
]
]
],
'productMap' => [
'product-emr' => true
]
]),
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/schedule"
payload := strings.NewReader("{\n \"name\": \"Dr. Sharma - OPD\",\n \"entity_id\": \"doc_12345\",\n \"location_id\": \"c-98765\",\n \"config\": {\n \"overbooking_limit\": 2,\n \"schedule_slot_config_enabled\": true,\n \"slot_durations\": [\n 15,\n 30\n ]\n },\n \"timebounds\": {\n \"weekly\": {\n \"1\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n },\n {\n \"s\": 1400,\n \"e\": 1800,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n },\n \"2\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"daily\": {\n \"2026-10-15\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1000,\n \"e\": 1200,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"repeat-weekly\": [\n {\n \"repeat_every\": 2,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2027-03-21\",\n \"phases\": [\n {\n \"3\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1600,\n \"e\": 1900,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n {\n \"3\": {\n \"is_enabled\": false,\n \"bounds\": []\n }\n }\n ]\n }\n ],\n \"repeat-daily\": [\n {\n \"phase_index\": 0,\n \"repeat_every\": 3,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2026-12-31\",\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1100,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n ],\n \"block\": [\n {\n \"start_date\": \"2026-10-20\",\n \"end_date\": \"2026-10-22\",\n \"start_time\": \"09:00\",\n \"end_time\": \"18:00\"\n }\n ]\n },\n \"productMap\": {\n \"product-emr\": true\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/schedule")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Dr. Sharma - OPD\",\n \"entity_id\": \"doc_12345\",\n \"location_id\": \"c-98765\",\n \"config\": {\n \"overbooking_limit\": 2,\n \"schedule_slot_config_enabled\": true,\n \"slot_durations\": [\n 15,\n 30\n ]\n },\n \"timebounds\": {\n \"weekly\": {\n \"1\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n },\n {\n \"s\": 1400,\n \"e\": 1800,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n },\n \"2\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"daily\": {\n \"2026-10-15\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1000,\n \"e\": 1200,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"repeat-weekly\": [\n {\n \"repeat_every\": 2,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2027-03-21\",\n \"phases\": [\n {\n \"3\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1600,\n \"e\": 1900,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n {\n \"3\": {\n \"is_enabled\": false,\n \"bounds\": []\n }\n }\n ]\n }\n ],\n \"repeat-daily\": [\n {\n \"phase_index\": 0,\n \"repeat_every\": 3,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2026-12-31\",\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1100,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n ],\n \"block\": [\n {\n \"start_date\": \"2026-10-20\",\n \"end_date\": \"2026-10-22\",\n \"start_time\": \"09:00\",\n \"end_time\": \"18:00\"\n }\n ]\n },\n \"productMap\": {\n \"product-emr\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/schedule")
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 \"name\": \"Dr. Sharma - OPD\",\n \"entity_id\": \"doc_12345\",\n \"location_id\": \"c-98765\",\n \"config\": {\n \"overbooking_limit\": 2,\n \"schedule_slot_config_enabled\": true,\n \"slot_durations\": [\n 15,\n 30\n ]\n },\n \"timebounds\": {\n \"weekly\": {\n \"1\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n },\n {\n \"s\": 1400,\n \"e\": 1800,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n },\n \"2\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"daily\": {\n \"2026-10-15\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1000,\n \"e\": 1200,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"repeat-weekly\": [\n {\n \"repeat_every\": 2,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2027-03-21\",\n \"phases\": [\n {\n \"3\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1600,\n \"e\": 1900,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n {\n \"3\": {\n \"is_enabled\": false,\n \"bounds\": []\n }\n }\n ]\n }\n ],\n \"repeat-daily\": [\n {\n \"phase_index\": 0,\n \"repeat_every\": 3,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2026-12-31\",\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1100,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n ],\n \"block\": [\n {\n \"start_date\": \"2026-10-20\",\n \"end_date\": \"2026-10-22\",\n \"start_time\": \"09:00\",\n \"end_time\": \"18:00\"\n }\n ]\n },\n \"productMap\": {\n \"product-emr\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"schedule_id": "<string>",
"business_id": "<string>",
"name": "<string>",
"archive": true,
"default": true,
"userCreatedDefault": true,
"config": {
"overbooking_limit": 123,
"block_over_existing_bookings": true,
"schedule_slot_config_enabled": true,
"slot_durations": [
123
]
},
"createdAt": "<string>",
"updatedAt": "<string>",
"timebounds": {},
"assignment": {
"products": [
"<string>"
],
"error": "<string>"
},
"confs_created": [
"<string>"
]
}
}{
"success": false,
"error": "name is required"
}{
"success": false,
"error": "<string>"
}Create Schedule
Overview
Creates a schedule for an entity_id in a location_id — entity_id is your doctor id, location_id is your clinic id. A schedule holds booking config (overbooking limit, slot-duration mode) and, optionally, its timebounds (weekly / daily / repeat-weekly / repeat-daily / block rules) and a product assignment map, all in one call. This endpoint is primarily for setting the timebounds — the s/e windows a doctor is available in, and (for service-based schedules) the conf_ids bookable in each window.
Duration-based vs. service-based schedules
config.schedule_slot_config_enabled decides how every bound’s slots get sliced, and whether that bound may carry conf_ids:
- Duration-based (
schedule_slot_config_enabled: true): requires at least one entry inconfig.slot_durations. Slots are sliced at a fixed length picked fromslot_durations. Bounds intimeboundsmust not includeconf_ids— sending any is rejected with400. - Service-based (
schedule_slot_config_enabledfalse or omitted): every bound must includeconf_ids— the services bookable in that window. Valid ids come from the Service Configuration APIs (Get Service Conf List,Get Service Conf Details) for the schedule’sentity_id; an id the entity doesn’t own, or an empty list, is rejected with400. There is no schedule- level slot duration here — each slot is sliced using thedurationstored on the attached service (conf_id), so different services in the same bound can produce differently-sized slots.
product-widget can only be assigned to one schedule per (entity_id, location_id) pair — a second assignment returns 409.
Notes & Considerations
Read more : (API Reference - Get Appointment Slots) section — this API returns schedules assigned to product-widget.
curl --request POST \
--url https://api.eka.care/schedule \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"name": "Dr. Sharma - OPD",
"entity_id": "doc_12345",
"location_id": "c-98765",
"config": {
"overbooking_limit": 2,
"schedule_slot_config_enabled": true,
"slot_durations": [
15,
30
]
},
"timebounds": {
"weekly": {
"1": {
"is_enabled": true,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": [
"conf_abc123"
]
},
{
"s": 1400,
"e": 1800,
"conf_ids": [
"conf_abc123"
]
}
]
},
"2": {
"is_enabled": true,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": [
"conf_abc123"
]
}
]
}
},
"daily": {
"2026-10-15": {
"is_enabled": true,
"bounds": [
{
"s": 1000,
"e": 1200,
"conf_ids": [
"conf_abc123"
]
}
]
}
},
"repeat-weekly": [
{
"repeat_every": 2,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2027-03-21",
"phases": [
{
"3": {
"is_enabled": true,
"bounds": [
{
"s": 1600,
"e": 1900,
"conf_ids": [
"conf_abc123"
]
}
]
}
},
{
"3": {
"is_enabled": false,
"bounds": []
}
}
]
}
],
"repeat-daily": [
{
"phase_index": 0,
"repeat_every": 3,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2026-12-31",
"is_enabled": true,
"bounds": [
{
"s": 900,
"e": 1100,
"conf_ids": [
"conf_abc123"
]
}
]
}
],
"block": [
{
"start_date": "2026-10-20",
"end_date": "2026-10-22",
"start_time": "09:00",
"end_time": "18:00"
}
]
},
"productMap": {
"product-emr": true
}
}
'import requests
url = "https://api.eka.care/schedule"
payload = {
"name": "Dr. Sharma - OPD",
"entity_id": "doc_12345",
"location_id": "c-98765",
"config": {
"overbooking_limit": 2,
"schedule_slot_config_enabled": True,
"slot_durations": [15, 30]
},
"timebounds": {
"weekly": {
"1": {
"is_enabled": True,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": ["conf_abc123"]
},
{
"s": 1400,
"e": 1800,
"conf_ids": ["conf_abc123"]
}
]
},
"2": {
"is_enabled": True,
"bounds": [
{
"s": 900,
"e": 1300,
"conf_ids": ["conf_abc123"]
}
]
}
},
"daily": { "2026-10-15": {
"is_enabled": True,
"bounds": [
{
"s": 1000,
"e": 1200,
"conf_ids": ["conf_abc123"]
}
]
} },
"repeat-weekly": [
{
"repeat_every": 2,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2027-03-21",
"phases": [{ "3": {
"is_enabled": True,
"bounds": [
{
"s": 1600,
"e": 1900,
"conf_ids": ["conf_abc123"]
}
]
} }, { "3": {
"is_enabled": False,
"bounds": []
} }]
}
],
"repeat-daily": [
{
"phase_index": 0,
"repeat_every": 3,
"anchor_date": "2026-09-21",
"start_date": "2026-09-21",
"end_date": "2026-12-31",
"is_enabled": True,
"bounds": [
{
"s": 900,
"e": 1100,
"conf_ids": ["conf_abc123"]
}
]
}
],
"block": [
{
"start_date": "2026-10-20",
"end_date": "2026-10-22",
"start_time": "09:00",
"end_time": "18:00"
}
]
},
"productMap": { "product-emr": True }
}
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({
name: 'Dr. Sharma - OPD',
entity_id: 'doc_12345',
location_id: 'c-98765',
config: {
overbooking_limit: 2,
schedule_slot_config_enabled: true,
slot_durations: [15, 30]
},
timebounds: {
weekly: {
'1': {
is_enabled: true,
bounds: [
{s: 900, e: 1300, conf_ids: ['conf_abc123']},
{s: 1400, e: 1800, conf_ids: ['conf_abc123']}
]
},
'2': {is_enabled: true, bounds: [{s: 900, e: 1300, conf_ids: ['conf_abc123']}]}
},
daily: {
'2026-10-15': {is_enabled: true, bounds: [{s: 1000, e: 1200, conf_ids: ['conf_abc123']}]}
},
'repeat-weekly': [
{
repeat_every: 2,
anchor_date: '2026-09-21',
start_date: '2026-09-21',
end_date: '2027-03-21',
phases: [
{
'3': {is_enabled: true, bounds: [{s: 1600, e: 1900, conf_ids: ['conf_abc123']}]}
},
{'3': {is_enabled: false, bounds: []}}
]
}
],
'repeat-daily': [
{
phase_index: 0,
repeat_every: 3,
anchor_date: '2026-09-21',
start_date: '2026-09-21',
end_date: '2026-12-31',
is_enabled: true,
bounds: [{s: 900, e: 1100, conf_ids: ['conf_abc123']}]
}
],
block: [
{
start_date: '2026-10-20',
end_date: '2026-10-22',
start_time: '09:00',
end_time: '18:00'
}
]
},
productMap: {'product-emr': true}
})
};
fetch('https://api.eka.care/schedule', 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/schedule",
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([
'name' => 'Dr. Sharma - OPD',
'entity_id' => 'doc_12345',
'location_id' => 'c-98765',
'config' => [
'overbooking_limit' => 2,
'schedule_slot_config_enabled' => true,
'slot_durations' => [
15,
30
]
],
'timebounds' => [
'weekly' => [
'1' => [
'is_enabled' => true,
'bounds' => [
[
's' => 900,
'e' => 1300,
'conf_ids' => [
'conf_abc123'
]
],
[
's' => 1400,
'e' => 1800,
'conf_ids' => [
'conf_abc123'
]
]
]
],
'2' => [
'is_enabled' => true,
'bounds' => [
[
's' => 900,
'e' => 1300,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
'daily' => [
'2026-10-15' => [
'is_enabled' => true,
'bounds' => [
[
's' => 1000,
'e' => 1200,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
'repeat-weekly' => [
[
'repeat_every' => 2,
'anchor_date' => '2026-09-21',
'start_date' => '2026-09-21',
'end_date' => '2027-03-21',
'phases' => [
[
'3' => [
'is_enabled' => true,
'bounds' => [
[
's' => 1600,
'e' => 1900,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
[
'3' => [
'is_enabled' => false,
'bounds' => [
]
]
]
]
]
],
'repeat-daily' => [
[
'phase_index' => 0,
'repeat_every' => 3,
'anchor_date' => '2026-09-21',
'start_date' => '2026-09-21',
'end_date' => '2026-12-31',
'is_enabled' => true,
'bounds' => [
[
's' => 900,
'e' => 1100,
'conf_ids' => [
'conf_abc123'
]
]
]
]
],
'block' => [
[
'start_date' => '2026-10-20',
'end_date' => '2026-10-22',
'start_time' => '09:00',
'end_time' => '18:00'
]
]
],
'productMap' => [
'product-emr' => true
]
]),
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/schedule"
payload := strings.NewReader("{\n \"name\": \"Dr. Sharma - OPD\",\n \"entity_id\": \"doc_12345\",\n \"location_id\": \"c-98765\",\n \"config\": {\n \"overbooking_limit\": 2,\n \"schedule_slot_config_enabled\": true,\n \"slot_durations\": [\n 15,\n 30\n ]\n },\n \"timebounds\": {\n \"weekly\": {\n \"1\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n },\n {\n \"s\": 1400,\n \"e\": 1800,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n },\n \"2\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"daily\": {\n \"2026-10-15\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1000,\n \"e\": 1200,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"repeat-weekly\": [\n {\n \"repeat_every\": 2,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2027-03-21\",\n \"phases\": [\n {\n \"3\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1600,\n \"e\": 1900,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n {\n \"3\": {\n \"is_enabled\": false,\n \"bounds\": []\n }\n }\n ]\n }\n ],\n \"repeat-daily\": [\n {\n \"phase_index\": 0,\n \"repeat_every\": 3,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2026-12-31\",\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1100,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n ],\n \"block\": [\n {\n \"start_date\": \"2026-10-20\",\n \"end_date\": \"2026-10-22\",\n \"start_time\": \"09:00\",\n \"end_time\": \"18:00\"\n }\n ]\n },\n \"productMap\": {\n \"product-emr\": true\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/schedule")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Dr. Sharma - OPD\",\n \"entity_id\": \"doc_12345\",\n \"location_id\": \"c-98765\",\n \"config\": {\n \"overbooking_limit\": 2,\n \"schedule_slot_config_enabled\": true,\n \"slot_durations\": [\n 15,\n 30\n ]\n },\n \"timebounds\": {\n \"weekly\": {\n \"1\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n },\n {\n \"s\": 1400,\n \"e\": 1800,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n },\n \"2\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"daily\": {\n \"2026-10-15\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1000,\n \"e\": 1200,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"repeat-weekly\": [\n {\n \"repeat_every\": 2,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2027-03-21\",\n \"phases\": [\n {\n \"3\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1600,\n \"e\": 1900,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n {\n \"3\": {\n \"is_enabled\": false,\n \"bounds\": []\n }\n }\n ]\n }\n ],\n \"repeat-daily\": [\n {\n \"phase_index\": 0,\n \"repeat_every\": 3,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2026-12-31\",\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1100,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n ],\n \"block\": [\n {\n \"start_date\": \"2026-10-20\",\n \"end_date\": \"2026-10-22\",\n \"start_time\": \"09:00\",\n \"end_time\": \"18:00\"\n }\n ]\n },\n \"productMap\": {\n \"product-emr\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/schedule")
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 \"name\": \"Dr. Sharma - OPD\",\n \"entity_id\": \"doc_12345\",\n \"location_id\": \"c-98765\",\n \"config\": {\n \"overbooking_limit\": 2,\n \"schedule_slot_config_enabled\": true,\n \"slot_durations\": [\n 15,\n 30\n ]\n },\n \"timebounds\": {\n \"weekly\": {\n \"1\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n },\n {\n \"s\": 1400,\n \"e\": 1800,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n },\n \"2\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1300,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"daily\": {\n \"2026-10-15\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1000,\n \"e\": 1200,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n \"repeat-weekly\": [\n {\n \"repeat_every\": 2,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2027-03-21\",\n \"phases\": [\n {\n \"3\": {\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 1600,\n \"e\": 1900,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n },\n {\n \"3\": {\n \"is_enabled\": false,\n \"bounds\": []\n }\n }\n ]\n }\n ],\n \"repeat-daily\": [\n {\n \"phase_index\": 0,\n \"repeat_every\": 3,\n \"anchor_date\": \"2026-09-21\",\n \"start_date\": \"2026-09-21\",\n \"end_date\": \"2026-12-31\",\n \"is_enabled\": true,\n \"bounds\": [\n {\n \"s\": 900,\n \"e\": 1100,\n \"conf_ids\": [\n \"conf_abc123\"\n ]\n }\n ]\n }\n ],\n \"block\": [\n {\n \"start_date\": \"2026-10-20\",\n \"end_date\": \"2026-10-22\",\n \"start_time\": \"09:00\",\n \"end_time\": \"18:00\"\n }\n ]\n },\n \"productMap\": {\n \"product-emr\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"schedule_id": "<string>",
"business_id": "<string>",
"name": "<string>",
"archive": true,
"default": true,
"userCreatedDefault": true,
"config": {
"overbooking_limit": 123,
"block_over_existing_bookings": true,
"schedule_slot_config_enabled": true,
"slot_durations": [
123
]
},
"createdAt": "<string>",
"updatedAt": "<string>",
"timebounds": {},
"assignment": {
"products": [
"<string>"
],
"error": "<string>"
},
"confs_created": [
"<string>"
]
}
}{
"success": false,
"error": "name is required"
}{
"success": false,
"error": "<string>"
}Headers
"auth"
Body
Schedule name. Required, non-empty.
Doctor/entity id this schedule is scoped to.
Clinic/location id this schedule is scoped to.
Show child attributes
Show child attributes
Availability rules to create alongside the schedule. Each block below is independent — include only the rule types you need.
Show child attributes
Show child attributes
Assigns/unassigns this schedule to products. Keys are product-emr or product-widget, values are true to assign, false to unassign. product-widget allows only one active schedule per (entity_id, location_id).
Show child attributes
Show child attributes
Was this page helpful?

