Lead Segmentation
Lead segmentationis Sendiee's AI Lead Studio. It auto-classifies every inbound lead and re-engages them automatically. The entire configuration lives in one document per organisation, with four parts:
- Settings — turn the system on (
isCategorizationEnabled), pick the AImodel/provider, set the post-messagedelaybefore classification runs, and hold thetriggerPrompt/categorizationToolDescription. - Categories — the buckets the AI sorts each lead into. Each has a
nameand adescriptionthat tells the AI when to use it. A lead's bucket is stored on the contact aslead_category. Addressed by name. - Insights (audience segments) — structured data fields the AI extracts from the conversation (e.g. budget, city, interests). Values land on the contact as
lead_segments. Addressed by key. See Lead Insights. - Follow-ups — timed re-engagement messages attached to a category, falling back to a shared default set. See Lead Follow-ups.
Recommended agent flow
GET /v2.0/leads/segmentationto read the current state, then create or adjust categories & insights, set follow-ups, and finally enable the system via PATCH /v2.0/leads/segmentation/settings.Get the full configuration
Returns settings plus categories (with their follow-ups), default follow-ups, and insights in a single payload.
curl -X GET "https://api.sendiee.com/v2.0/leads/segmentation" \
-H "Authorization: Bearer YOUR_API_KEY"{
"success": true,
"data": {
"isCategorizationEnabled": true,
"isFollowupEnabled": true,
"delay": 1800,
"model": "gpt-5-mini",
"provider": "openai",
"triggerPrompt": "Classify this lead based on the conversation…",
"categorizationToolDescription": "Use this tool to set the lead category…",
"categories": [
{
"name": "Hot Lead",
"description": "Ready to buy, asked about pricing or checkout.",
"fuDisabled": false,
"followups": [
{
"delay": 600,
"prompt": "Nudge them to complete the purchase.",
"active": true
}
]
}
],
"defaultFollowups": [
{
"delay": 3600,
"prompt": "Re-engage the customer.",
"active": true
}
],
"audienceSegments": [
{
"key": "budget",
"name": "Budget",
"valueType": "text",
"options": [],
"description": "The customer's stated budget."
}
]
}
}Replace / apply a full configuration
Bulk-replace the configuration — ideal for applying a complete template in one call. Only the top-level keys you include are replaced; anything you omit is left untouched. This endpoint does not cascade category renames to existing contacts — use PATCH /v2.0/leads/categories/{name} for that.
Body
| Parameter | Type | Description |
|---|---|---|
| isCategorizationEnabled | boolean | Master switch for AI categorisation |
| isFollowupEnabled | boolean | Master switch for automated follow-ups |
| delay | number | Seconds to wait after a lead's message before classifying |
| model | string | AI model id, e.g. gpt-5-mini |
| provider | string | AI provider, e.g. openai or deepseek |
| triggerPrompt | string | Classification system prompt |
| categorizationToolDescription | string | Tool description shown to the AI |
| categories | object[] | { name, description, fuDisabled?, followups?[] } — replaces all categories |
| defaultFollowups | object[] | { delay, prompt, active }[] — replaces the default set |
| audienceSegments | object[] | { key, name, valueType, options?, description }[] — replaces all insights |
curl -X PUT "https://api.sendiee.com/v2.0/leads/segmentation" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"isCategorizationEnabled": true,
"model": "gpt-5-mini",
"provider": "openai",
"categories": [
{ "name": "Hot Lead", "description": "Ready to buy.", "followups": [
{ "delay": 600, "prompt": "Nudge to checkout.", "active": true }
]},
{ "name": "Cold Lead", "description": "Just browsing." }
],
"defaultFollowups": [
{ "delay": 3600, "prompt": "Re-engage the customer.", "active": true }
],
"audienceSegments": [
{ "key": "budget", "name": "Budget", "valueType": "text", "description": "Stated budget." }
]
}'{
"success": true,
"data": {
"isCategorizationEnabled": true,
"categories": [
"…"
],
"audienceSegments": [
"…"
]
}
}Update settings only
Patch just the scalar settings without touching categories, follow-ups or insights. Send any subset of the fields below.
Body
| Parameter | Type | Description |
|---|---|---|
| isCategorizationEnabled | boolean | Master switch for AI categorisation |
| isFollowupEnabled | boolean | Master switch for automated follow-ups |
| delay | number | Seconds before classification runs |
| model | string | AI model id |
| provider | string | AI provider |
| triggerPrompt | string | Classification system prompt |
| categorizationToolDescription | string | Tool description shown to the AI |
curl -X PATCH "https://api.sendiee.com/v2.0/leads/segmentation/settings" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "isCategorizationEnabled": true, "delay": 1800, "model": "gpt-5-mini" }'Plan limits are enforced
403 PLAN_FEATURE_DISABLED; exceeding max_lead_categories, max_ai_followups or max_ai_insights returns 403 PLAN_LIMIT_EXCEEDED.