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 AI model/provider, set the post-message delay before classification runs, and hold the triggerPrompt / categorizationToolDescription.
  • Categories — the buckets the AI sorts each lead into. Each has a name and a descriptionthat tells the AI when to use it. A lead's bucket is stored on the contact as lead_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.

Get the full configuration

GET/v2.0/leads/segmentation

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."
      }
    ]
  }
}
Try it — API Playground

Replace / apply a full configuration

PUT/v2.0/leads/segmentation

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

ParameterTypeDescription
isCategorizationEnabledbooleanMaster switch for AI categorisation
isFollowupEnabledbooleanMaster switch for automated follow-ups
delaynumberSeconds to wait after a lead's message before classifying
modelstringAI model id, e.g. gpt-5-mini
providerstringAI provider, e.g. openai or deepseek
triggerPromptstringClassification system prompt
categorizationToolDescriptionstringTool description shown to the AI
categoriesobject[]{ name, description, fuDisabled?, followups?[] } — replaces all categories
defaultFollowupsobject[]{ delay, prompt, active }[] — replaces the default set
audienceSegmentsobject[]{ key, name, valueType, options?, description }[] — replaces all insights
cURL
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/v2.0/leads/segmentation/settings

Patch just the scalar settings without touching categories, follow-ups or insights. Send any subset of the fields below.

Body

ParameterTypeDescription
isCategorizationEnabledbooleanMaster switch for AI categorisation
isFollowupEnabledbooleanMaster switch for automated follow-ups
delaynumberSeconds before classification runs
modelstringAI model id
providerstringAI provider
triggerPromptstringClassification system prompt
categorizationToolDescriptionstringTool description shown to the AI
cURL
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" }'
Try it — API Playground