Skip to main content
POST
/
client
/
crm
/
lead
/
create
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"
}

Documentation Index

Fetch the complete documentation index at: https://developer.flabslis.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

JWT obtained from POST /client/auth/token.

Body

application/json
branchID
string
required

Branch identifier returned by GET /client/labs.

integratorID
string
required

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.

first_name
string
required
contact
string
required

Exactly 10 digits, no symbols or spaces.

age
number
required
age_type
enum<string>
required
Available options:
year,
month,
day
corporateUser
string

Corporate this entry belongs to. Party-scoped accounts must attach a party (any one of corporateUser, referredOrganization, referredHospitalOrganization).

referredOrganization
string

Referring doctor (organization) identifier. Party-scoped accounts must attach a party.

referredHospitalOrganization
string

Referring hospital (organization) identifier. Party-scoped accounts must attach a party.

phase
enum<string>
default:lead

lead enters the funnel and is auto-assigned. booking skips the funnel and creates a confirmed booking.

Available options:
lead,
booking
designation
string

Mr / Mrs / Dr / etc.

last_name
string
country_code
string
default:91
email
string<email>
gender
enum<string>
Available options:
male,
female,
other
weight
number

In kilograms.

height
number

In centimetres.

address
string
pincode
string
googleLocation
string

Free-form location string, e.g. "12.97,77.59" or a Google Maps URL.

aadhaar_number
string
insurance_number
string
uhid
string
passport_number
string
owner_name
string

Veterinary only — pet owner's name.

breed
string

Veterinary only — pet breed.

category
string

Veterinary only — animal category.

source
string

Channel that produced the lead, e.g. "facebook_ads", "website".

priority
enum<string>
default:medium
Available options:
urgent,
high,
medium,
low
tests
object[]
packages
object[]
unmappedTests
object[]

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.

unmappedPackages
object[]

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.

discountAmount
number
default:0
totalAmount
number
default:0
bookingType
enum<string>

Used when phase is booking.

Available options:
Home Collection,
Lab Visit
scheduledAt
string<date-time>

ISO date-time when the booking is scheduled. Used when phase is booking.

specialInstructions
string

Notes for the phlebotomist or lab.

paymentStatus
enum<string>
default:Pending

Defaults to Pending for bookings.

Available options:
Pending,
Paid,
Pay Later
paymentMode
enum<string>
Available options:
Razorpay UPI,
Card,
Cash
customFields
object

Free-form key/value map. Keys must match custom fields configured in CRM settings. Example: { "utm_campaign": "summer_sale", "lead_score": 78 }.

Response

Lead or booking created

success
boolean
Example:

true

leadId
string

Identifier of the newly created CRM entry.

phase
enum<string>
Available options:
lead,
booking
message
string