Skip to main content
POST
/
client
/
events
/
subscribe
curl --request POST \
  --url https://v2.flabs.in/client/events/subscribe \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "labID": "your_flabs_lab_id",
  "events": [
    "bill.completed",
    "lead.created"
  ],
  "endpoint": "https://your-domain.com/webhooks/flabs",
  "protocol": "https"
}
'
{
  "success": true,
  "message": "Events subscribed successfully"
}

Overview

Register your application to receive webhook notifications for specific events in the Flabs system. This endpoint allows you to subscribe to real-time notifications when bills or reports are created, completed, or deleted.

Authentication

This endpoint requires a valid Bearer token obtained from the authentication API.

Request Parameters

All parameters are sent in the request body as JSON:
ParameterTypeRequiredDescription
labIDstringYesFlabs lab (branch) identifier. Fetch via GET /client/labs
eventsarrayYesList of event types to subscribe to
endpointstringYesYour webhook endpoint URL (must use HTTPS)
protocolstringYesProtocol for webhook delivery (only “https” is supported)
corporateUserstringCond.Party-scoped accounts only — bind the webhook to this corporate
organizationstringCond.Party-scoped accounts only — bind the webhook to this doctor/hospital
Catch-all accounts (default): do not send a party. Party-scoped accounts: you must send corporateUser or organization (not both); the webhook then receives only that party’s events. See integration modes.

Supported Events

  • bill.created - New bill created
  • bill.completed - Entire bill completed (all reports finished)
  • bill.deleted - Bill deleted from system
  • report.completed - Individual report completed
  • lead.created - New CRM lead created
  • booking.created - New CRM booking created (or a lead converted to a booking)

Authorizations

Authorization
string
header
required

JWT token obtained from the authentication endpoint

Body

application/json
labID
string
required

Flabs lab (branch) identifier. Fetch the list of labs via GET /client/labs.

events
enum<string>[]
required

List of events to subscribe to

Available options:
bill.created,
bill.deleted,
bill.completed,
report.completed,
lead.created,
booking.created
endpoint
string<uri>
required

Your webhook endpoint URL that will receive the event notifications (must accept POST requests)

protocol
enum<string>
required

Protocol for webhook delivery (only HTTPS is supported)

Available options:
https
corporateUser
string

Party-scoped accounts only. Deliver only this corporate's events to the webhook. Pass either corporateUser or organization, not both.

organization
string

Party-scoped accounts only. Deliver only this doctor/hospital's events to the webhook. Pass either corporateUser or organization, not both.

Response

Successful webhook

success
boolean
Example:

true

message
string
Example:

"Events subscribed successfully"