Skip to main content

Endpoint

POST /backend/leads

Body Parameters

name
string
required
Lead’s full name
phone
string
required
Phone with country code (E.164 format)
email
string
Email address
company
string
Company name
status_id
string
Initial status ID
tag_ids
array
Array of tag IDs
custom_fields
object
Custom field values

Request Example

curl -X POST "https://api.leavo.ai/backend/leads" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Smith",
    "phone": "+15551234567",
    "email": "[email protected]",
    "company": "XYZ Company",
    "status_id": "status-uuid",
    "tag_ids": ["tag-uuid-1", "tag-uuid-2"],
    "custom_fields": {
      "source": "website",
      "interest": "product-a"
    }
  }'

Response

{
  "success": true,
  "data": {
    "id": "new-lead-uuid",
    "name": "John Smith",
    "phone": "+15551234567",
    "email": "[email protected]",
    "company": "XYZ Company",
    "status": {
      "id": "status-uuid",
      "name": "New",
      "color": "#10B981"
    },
    "tags": [
      {
        "id": "tag-uuid-1",
        "name": "VIP",
        "color": "#F59E0B"
      }
    ],
    "custom_fields": {
      "source": "website",
      "interest": "product-a"
    },
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Possible Errors

CodeDescription
VALIDATION_ERRORInvalid data
ALREADY_EXISTSPhone already registered
NOT_FOUNDStatus or tag not found