Skip to main content
POST
/
v1
/
ai
/
suggest-meetings
Suggest Meetings
curl --request POST \
  --url https://api.example.com/v1/ai/suggest-meetings \
  --header 'Content-Type: application/json' \
  --data '
{
  "contact_ids": [
    {}
  ],
  "window_days": 123,
  "count": 123,
  "only_open_deals": true
}
'
{
  "data": {
    "suggestions": [
      {
        "contact_id": "<string>",
        "contact_name": "<string>",
        "reason": "<string>",
        "deal_id": "<string>",
        "opportunity_value": 123,
        "priority": "<string>",
        "suggested_agenda": [
          {}
        ],
        "suggested_when": "<string>",
        "confidence": 123
      }
    ],
    "credits_remaining": 123
  }
}
This endpoint consumes 3 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_ids
array
Optional array of contact UUIDs to rank. When omitted, the endpoint considers the entire pipeline.
window_days
integer
default:"14"
Horizon in days for the suggested meeting time.
count
integer
default:"5"
Number of suggestions to return (1 - 20).
only_open_deals
boolean
default:"true"
Restrict to contacts associated with open deals.

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-meetings \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"count": 5, "window_days": 14}'

Example Response

{
  "data": {
    "suggestions": [
      {
        "contact_id": "123e4567-e89b-12d3-a456-426614174000",
        "contact_name": "Jane Doe",
        "reason": "Open deal in Proposal stage with no meeting scheduled in the last 21 days.",
        "deal_id": "deal_01HY1",
        "opportunity_value": 45000,
        "priority": "high",
        "suggested_agenda": [
          "Review fee proposal",
          "Walk through engagement scope",
          "Confirm kick-off date"
        ],
        "suggested_when": "Within the next 3 business days",
        "confidence": 0.87
      }
    ],
    "credits_remaining": 4858
  }
}

Errors

StatusCodeDescription
400validation_errorInvalid count or window_days
401invalid_keyInvalid or expired API key
402insufficient_creditsWorkspace credit balance is exhausted
403insufficient_permissionsMissing write:ai permission
429rate_limitedRate limit exceeded