Skip to main content
POST
/
v1
/
ai
/
suggest-followups
Suggest Follow-ups
curl --request POST \
  --url https://api.example.com/v1/ai/suggest-followups \
  --header 'Content-Type: application/json' \
  --data '
{
  "contact_id": "<string>",
  "count": 123,
  "lookback_days": 123,
  "channels": [
    {}
  ]
}
'
{
  "data": {
    "suggestions": [
      {
        "type": "<string>",
        "title": "<string>",
        "reason": "<string>",
        "suggested_when": "<string>",
        "draft_body": "<string>",
        "confidence": 123
      }
    ],
    "activity_summary": "<string>",
    "credits_remaining": 123
  }
}
This endpoint consumes 2 AI credits per call. If the workspace balance is insufficient, the API returns 402 insufficient_credits.

Request

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Idempotency-Key
string
Optional UUID for retry deduplication.

Body Parameters

contact_id
string
required
UUID of the contact to generate suggestions for.
count
integer
default:"3"
Number of suggestions to generate (1 - 10).
lookback_days
integer
default:"60"
Window of recent activity to consider.
channels
array
Optional whitelist of acceptable channels for suggestions: email, call, meeting, linkedin, whatsapp. Defaults to all.

Response

data
object
Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl -X POST \
  https://data.leadlex.com/functions/v1/api-gateway/v1/ai/suggest-followups \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"contact_id": "123e4567-e89b-12d3-a456-426614174000", "count": 3}'

Example Response

{
  "data": {
    "suggestions": [
      {
        "type": "email",
        "title": "Share fee proposal",
        "reason": "Jane asked for pricing on the last call and hasn't received the proposal yet.",
        "suggested_when": "Today",
        "draft_body": "Hi Jane, following up on our call on Tuesday - please find our flat-fee proposal attached...",
        "confidence": 0.9
      },
      {
        "type": "meeting",
        "title": "Schedule legal review session",
        "reason": "Next step in the sales cycle per prior conversation notes.",
        "suggested_when": "Next week",
        "draft_body": null,
        "confidence": 0.78
      }
    ],
    "activity_summary": "3 emails and 1 meeting with Jane in the last 14 days; last touch was a discovery call on 2026-04-15.",
    "credits_remaining": 4861
  }
}

Errors

StatusCodeDescription
400validation_errorMissing or malformed contact_id
401invalid_keyInvalid or expired API key
402insufficient_creditsWorkspace credit balance is exhausted
403insufficient_permissionsMissing write:ai permission
404not_foundContact not found in this workspace
429rate_limitedRate limit exceeded