Cancel booking
curl --request PUT \
--url https://v2.flabs.in/client/crm/booking/{leadId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Patient cancelled"
}
'import requests
url = "https://v2.flabs.in/client/crm/booking/{leadId}/cancel"
payload = { "reason": "Patient cancelled" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Patient cancelled'})
};
fetch('https://v2.flabs.in/client/crm/booking/{leadId}/cancel', 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://v2.flabs.in/client/crm/booking/{leadId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Patient cancelled'
]),
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;
}HttpResponse<String> response = Unirest.put("https://v2.flabs.in/client/crm/booking/{leadId}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Patient cancelled\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://v2.flabs.in/client/crm/booking/{leadId}/cancel");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"reason\": \"Patient cancelled\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"success": true,
"leadId": "6530a4a6f1d2c8b7e9a54321",
"bookingStatus": "Cancelled",
"scheduledAt": "2026-11-28T04:30:00.000Z"
}{
"success": false,
"status": 400,
"message": "Bad Request",
"error": {
"details": "first_name is required"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Bookings
Cancel Booking
Cancels a booking you created, exactly as the lab’s CRM does. Its status becomes Cancelled, and the reason and source (“Client API”) appear in the booking’s history.
- When: until the sample is collected. Once the booking is
Completed(sample collected, bill raised) it can no longer be cancelled; a bookingIn Progress(phlebotomist on the way or at the door) can. - Assigned phlebotomist: unassigned and notified that the visit is off.
Errors (the reason is in error.details):
400:reasonmissing; or the booking is already cancelled, or completed.404: no such booking, or it is not one you created through this API.409: the booking was cancelled or completed while your request was in flight.
A retried cancel never cancels twice: the retry answers 400 or 409, and booking.cancelled is sent once.
PUT
/
client
/
crm
/
booking
/
{leadId}
/
cancel
Cancel booking
curl --request PUT \
--url https://v2.flabs.in/client/crm/booking/{leadId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Patient cancelled"
}
'import requests
url = "https://v2.flabs.in/client/crm/booking/{leadId}/cancel"
payload = { "reason": "Patient cancelled" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Patient cancelled'})
};
fetch('https://v2.flabs.in/client/crm/booking/{leadId}/cancel', 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://v2.flabs.in/client/crm/booking/{leadId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Patient cancelled'
]),
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;
}HttpResponse<String> response = Unirest.put("https://v2.flabs.in/client/crm/booking/{leadId}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Patient cancelled\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://v2.flabs.in/client/crm/booking/{leadId}/cancel");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"reason\": \"Patient cancelled\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"success": true,
"leadId": "6530a4a6f1d2c8b7e9a54321",
"bookingStatus": "Cancelled",
"scheduledAt": "2026-11-28T04:30:00.000Z"
}{
"success": false,
"status": 400,
"message": "Bad Request",
"error": {
"details": "first_name is required"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Path Parameters
The leadId returned by Create Lead or Booking.
Body
application/json
Was this page helpful?