6 endpoints · base URL https://flexysure.intrepidprojects.co.ke/api/v1
The CRM pipeline. Creating a prospect takes Insurance Cloud's field names (p_name, status, products[], assign_to[]) and answers in its shape; listing, reading, updating, logging activity and converting to a client are Flexysure additions in the {data, meta, links} shape with cursor pagination. Agents (an actor with own-records visibility, or X-Agent-Code/X-Agent-Key) see prospects they created or are assigned to; staff see all.
Insurance Cloud compatible. status is matched case-insensitively to new, contacted, quoted, negotiating, won or lost ("New" works); anything else is 422. Expected premium and commission are derived from products[].
Scope
crm
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.
Headers
Header
Meaning
Authorization
Bearer <access_token> (scope crm)
Idempotency-Key
Required. Unique per write; a replay returns the first response.
X-Agent-Code
Optional. Agent code of the selling agent; the call runs with that agent's visibility.
X-Agent-Key
Optional, with X-Agent-Code. The agent's API key; a mismatch returns 403 agent_denied.
Body fields
Field
Type
Required
Description
p_name
string
Yes
Prospect (person or company) name.
Example: Kilima Farm Supplies
status
string
Yes
Pipeline stage.
One of: New, Contacted, Quoted, Negotiating, Won, LostExample: New
email
string
No
Contact email.
Example: ops@kilimafarm.co.ke
phone
string
No
Kenyan mobile (07…, 01…, +2547…). Stored as 07XXXXXXXX.
Example: 0712345678
sector
string
No
Example: Agriculture
insurer_id
integer
No
Preferred insurer (GET /insurers).
Example: 1
alt_name
string
No
Alternative contact person.
alt_phone
string
No
alt_email
string
No
start_date
string
No
Y-m-d.
Example: 2026-10-14
due_date
string
No
Y-m-d. When the deal should close.
follow_up_date
string
No
Y-m-d. Drives the follow-ups due/overdue lists.
notes
string
No
rating
string
No
hot, warm or cold (any case), or Insurance Cloud's 1–5: 4–5 hot, 3 warm, 1–2 cold.
Example: hot
business_source_id
integer
No
Walk-in, Referral, Web, Agent, Bancassurance.
prospect_type_id
integer
No
Individual, SME, Corporate, SACCO member.
products
object[]
No
Products being discussed. Expected premium and commission are the sums of these rows.
products[].product
string
Yes
Example: Motor private comprehensive
products[].product_id
integer
No
Standard product id (GET /products), if any.
products[].comm_rate
number
No
Commission rate in percent.
Example: 10
products[].premium
number
No
Expected premium, whole shillings.
Example: 85000
products[].commission
number
No
Shillings. Derived from premium × comm_rate when omitted.
assign_to
integer[]
No
Staff user ids (GET /sales-people, /risk-managers). Assigned agents can see the prospect.
Send only what changes. name or Insurance Cloud's p_name; products replaces the product list (totals re-derived); assign_to replaces the assignees. A status change is written to the timeline. Winning goes through the convert endpoint.
Scope
crm
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.
Headers
Header
Meaning
Authorization
Bearer <access_token> (scope crm)
Idempotency-Key
Required. Unique per write; a replay returns the first response.
X-Agent-Code
Optional. Agent code of the selling agent; the call runs with that agent's visibility.
X-Agent-Key
Optional, with X-Agent-Code. The agent's API key; a mismatch returns 403 agent_denied.
Marks the prospect won and creates its client, or links an existing client with the same phone, ID number or KRA PIN. Converting twice returns the same client. Lost prospects cannot be converted.
Scope
crm
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.
Headers
Header
Meaning
Authorization
Bearer <access_token> (scope crm)
Idempotency-Key
Required. Unique per write; a replay returns the first response.
X-Agent-Code
Optional. Agent code of the selling agent; the call runs with that agent's visibility.
X-Agent-Key
Optional, with X-Agent-Code. The agent's API key; a mismatch returns 403 agent_denied.