Book an appointment
curl --request POST \
--url https://docistra.com/api/v1/appointments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "A-55012",
"doctor_id": "ext:D-7",
"branch_id": "ext:B-1",
"start": "2026-12-03T17:30:00+02:00",
"patient": {
"external_id": "P-10293",
"name": "Mona Samy",
"phone": "01012345678"
},
"notify_patient": true
}
'import requests
url = "https://docistra.com/api/v1/appointments"
payload = {
"external_id": "A-55012",
"doctor_id": "ext:D-7",
"branch_id": "ext:B-1",
"start": "2026-12-03T17:30:00+02:00",
"patient": {
"external_id": "P-10293",
"name": "Mona Samy",
"phone": "01012345678"
},
"notify_patient": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'A-55012',
doctor_id: 'ext:D-7',
branch_id: 'ext:B-1',
start: '2026-12-03T17:30:00+02:00',
patient: {external_id: 'P-10293', name: 'Mona Samy', phone: '01012345678'},
notify_patient: true
})
};
fetch('https://docistra.com/api/v1/appointments', 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://docistra.com/api/v1/appointments",
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([
'external_id' => 'A-55012',
'doctor_id' => 'ext:D-7',
'branch_id' => 'ext:B-1',
'start' => '2026-12-03T17:30:00+02:00',
'patient' => [
'external_id' => 'P-10293',
'name' => 'Mona Samy',
'phone' => '01012345678'
],
'notify_patient' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://docistra.com/api/v1/appointments"
payload := strings.NewReader("{\n \"external_id\": \"A-55012\",\n \"doctor_id\": \"ext:D-7\",\n \"branch_id\": \"ext:B-1\",\n \"start\": \"2026-12-03T17:30:00+02:00\",\n \"patient\": {\n \"external_id\": \"P-10293\",\n \"name\": \"Mona Samy\",\n \"phone\": \"01012345678\"\n },\n \"notify_patient\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://docistra.com/api/v1/appointments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"A-55012\",\n \"doctor_id\": \"ext:D-7\",\n \"branch_id\": \"ext:B-1\",\n \"start\": \"2026-12-03T17:30:00+02:00\",\n \"patient\": {\n \"external_id\": \"P-10293\",\n \"name\": \"Mona Samy\",\n \"phone\": \"01012345678\"\n },\n \"notify_patient\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docistra.com/api/v1/appointments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"A-55012\",\n \"doctor_id\": \"ext:D-7\",\n \"branch_id\": \"ext:B-1\",\n \"start\": \"2026-12-03T17:30:00+02:00\",\n \"patient\": {\n \"external_id\": \"P-10293\",\n \"name\": \"Mona Samy\",\n \"phone\": \"01012345678\"\n },\n \"notify_patient\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"object": "appointment",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"status": "reserved",
"type": "reservation",
"patient_id": "<string>",
"patient_external_id": "<string>",
"doctor_id": "<string>",
"doctor_external_id": "<string>",
"branch_id": "<string>",
"branch_external_id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"queue_number": 123,
"source": "<string>",
"notes": "<string>",
"cancel_reason": "<string>",
"rescheduled_from_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"patient_notified": {
"via": "whatsapp_text",
"reason": "<string>"
}
}{
"error": "slot_taken"
}{
"error": "slot_taken"
}{
"error": "slot_taken"
}Appointments
Book an appointment
Runs every booking rule Docistra has: working hours, days off, breaks, clashes, queue days. Send start for a timed day or date for a queue (walk-in numbers) day. The patient is only messaged when notify_patient is true.
POST
/
appointments
Book an appointment
curl --request POST \
--url https://docistra.com/api/v1/appointments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "A-55012",
"doctor_id": "ext:D-7",
"branch_id": "ext:B-1",
"start": "2026-12-03T17:30:00+02:00",
"patient": {
"external_id": "P-10293",
"name": "Mona Samy",
"phone": "01012345678"
},
"notify_patient": true
}
'import requests
url = "https://docistra.com/api/v1/appointments"
payload = {
"external_id": "A-55012",
"doctor_id": "ext:D-7",
"branch_id": "ext:B-1",
"start": "2026-12-03T17:30:00+02:00",
"patient": {
"external_id": "P-10293",
"name": "Mona Samy",
"phone": "01012345678"
},
"notify_patient": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'A-55012',
doctor_id: 'ext:D-7',
branch_id: 'ext:B-1',
start: '2026-12-03T17:30:00+02:00',
patient: {external_id: 'P-10293', name: 'Mona Samy', phone: '01012345678'},
notify_patient: true
})
};
fetch('https://docistra.com/api/v1/appointments', 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://docistra.com/api/v1/appointments",
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([
'external_id' => 'A-55012',
'doctor_id' => 'ext:D-7',
'branch_id' => 'ext:B-1',
'start' => '2026-12-03T17:30:00+02:00',
'patient' => [
'external_id' => 'P-10293',
'name' => 'Mona Samy',
'phone' => '01012345678'
],
'notify_patient' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://docistra.com/api/v1/appointments"
payload := strings.NewReader("{\n \"external_id\": \"A-55012\",\n \"doctor_id\": \"ext:D-7\",\n \"branch_id\": \"ext:B-1\",\n \"start\": \"2026-12-03T17:30:00+02:00\",\n \"patient\": {\n \"external_id\": \"P-10293\",\n \"name\": \"Mona Samy\",\n \"phone\": \"01012345678\"\n },\n \"notify_patient\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://docistra.com/api/v1/appointments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"A-55012\",\n \"doctor_id\": \"ext:D-7\",\n \"branch_id\": \"ext:B-1\",\n \"start\": \"2026-12-03T17:30:00+02:00\",\n \"patient\": {\n \"external_id\": \"P-10293\",\n \"name\": \"Mona Samy\",\n \"phone\": \"01012345678\"\n },\n \"notify_patient\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docistra.com/api/v1/appointments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"A-55012\",\n \"doctor_id\": \"ext:D-7\",\n \"branch_id\": \"ext:B-1\",\n \"start\": \"2026-12-03T17:30:00+02:00\",\n \"patient\": {\n \"external_id\": \"P-10293\",\n \"name\": \"Mona Samy\",\n \"phone\": \"01012345678\"\n },\n \"notify_patient\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"object": "appointment",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"status": "reserved",
"type": "reservation",
"patient_id": "<string>",
"patient_external_id": "<string>",
"doctor_id": "<string>",
"doctor_external_id": "<string>",
"branch_id": "<string>",
"branch_external_id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"queue_number": 123,
"source": "<string>",
"notes": "<string>",
"cancel_reason": "<string>",
"rescheduled_from_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"patient_notified": {
"via": "whatsapp_text",
"reason": "<string>"
}
}{
"error": "slot_taken"
}{
"error": "slot_taken"
}{
"error": "slot_taken"
}Authorizations
Headers
Body
application/json