curl --request POST \
--url https://v2.flabs.in/client/crm/lead/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branchID": "6530a4a6f1d2c8b7e9a12345",
"integratorID": "EXT-LEAD-10231",
"phase": "lead",
"first_name": "Rahul",
"last_name": "Sharma",
"contact": "9876543210",
"country_code": "91",
"email": "rahul@example.com",
"age": 32,
"age_type": "year",
"gender": "male",
"address": "42 Park Street",
"pincode": "560001",
"source": "facebook_ads",
"priority": "high",
"tests": [
{
"test": "6530a4a6f1d2c8b7e9aabcde",
"cost": 350
}
],
"packages": [
{
"package": "6530a4a6f1d2c8b7e9afedcb",
"price": 1499
}
],
"unmappedTests": [
{
"name": "Vitamin D3 (custom name)",
"cost": 800
}
],
"unmappedPackages": [
{
"name": "Bridal Glow Panel",
"price": 2500
}
],
"discountAmount": 100,
"totalAmount": 4549
}
'{
"success": true,
"leadId": "6530a4a6f1d2c8b7e9a54321",
"phase": "lead",
"message": "Lead created successfully"
}{
"success": false,
"status": 400,
"message": "Bad Request",
"error": {
"details": "first_name is required"
}
}{
"success": false,
"status": 403,
"message": "Forbidden",
"error": {
"details": "branchID does not belong to your account"
}
}{
"success": false,
"status": 409,
"message": "Conflict",
"error": {
"details": "Lead with contact 9876543210 already exists today"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Create Lead or Booking
Creates a CRM entry for the patient. Set phase: "lead" (default) to drop the entry into the lead funnel — it will be auto-assigned to a telecaller and trigger a NEW_LEAD notification. Set phase: "booking" to skip the lead stage and create a confirmed booking directly — it will trigger a BOOKING_CONFIRMED notification.
curl --request POST \
--url https://v2.flabs.in/client/crm/lead/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branchID": "6530a4a6f1d2c8b7e9a12345",
"integratorID": "EXT-LEAD-10231",
"phase": "lead",
"first_name": "Rahul",
"last_name": "Sharma",
"contact": "9876543210",
"country_code": "91",
"email": "rahul@example.com",
"age": 32,
"age_type": "year",
"gender": "male",
"address": "42 Park Street",
"pincode": "560001",
"source": "facebook_ads",
"priority": "high",
"tests": [
{
"test": "6530a4a6f1d2c8b7e9aabcde",
"cost": 350
}
],
"packages": [
{
"package": "6530a4a6f1d2c8b7e9afedcb",
"price": 1499
}
],
"unmappedTests": [
{
"name": "Vitamin D3 (custom name)",
"cost": 800
}
],
"unmappedPackages": [
{
"name": "Bridal Glow Panel",
"price": 2500
}
],
"discountAmount": 100,
"totalAmount": 4549
}
'{
"success": true,
"leadId": "6530a4a6f1d2c8b7e9a54321",
"phase": "lead",
"message": "Lead created successfully"
}{
"success": false,
"status": 400,
"message": "Bad Request",
"error": {
"details": "first_name is required"
}
}{
"success": false,
"status": 403,
"message": "Forbidden",
"error": {
"details": "branchID does not belong to your account"
}
}{
"success": false,
"status": 409,
"message": "Conflict",
"error": {
"details": "Lead with contact 9876543210 already exists today"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Authorizations
JWT obtained from POST /client/auth/token.
Body
Branch identifier returned by GET /client/labs.
Your own unique ID for this lead/booking. Required. It is stored on the entry, carried onto the bill when it converts, and echoed back in webhook payloads so you can correlate events with your records.
Exactly 10 digits, no symbols or spaces.
year, month, day Corporate this entry belongs to. Party-scoped accounts must attach a party (any one of corporateUser, referredOrganization, referredHospitalOrganization).
Referring doctor (organization) identifier. Party-scoped accounts must attach a party.
Referring hospital (organization) identifier. Party-scoped accounts must attach a party.
lead enters the funnel and is auto-assigned. booking skips the funnel and creates a confirmed booking.
lead, booking Mr / Mrs / Dr / etc.
male, female, other In kilograms.
In centimetres.
Free-form location string, e.g. "12.97,77.59" or a Google Maps URL.
Veterinary only — pet owner's name.
Veterinary only — pet breed.
Veterinary only — animal category.
Channel that produced the lead, e.g. "facebook_ads", "website".
urgent, high, medium, low Show child attributes
Show child attributes
Show child attributes
Show child attributes
Tests that you couldn't match to a Flabs test ID. Sent as plain name + cost so they show up on the lead with an "unmapped" tag for the team to resolve later.
Show child attributes
Show child attributes
Packages that you couldn't match to a Flabs package ID. Sent as plain name + price so they show up on the lead with an "unmapped" tag for the team to resolve later.
Show child attributes
Show child attributes
Used when phase is booking.
Home Collection, Lab Visit ISO date-time when the booking is scheduled. Used when phase is booking.
Notes for the phlebotomist or lab.
Defaults to Pending for bookings.
Pending, Paid, Pay Later Razorpay UPI, Card, Cash Free-form key/value map. Keys must match custom fields configured in CRM settings. Example: { "utm_campaign": "summer_sale", "lead_score": 78 }.
Was this page helpful?