Skip to content

Your first request

  1. Create a free account at klozeo.com and generate an API key.

  2. Create your first lead:

    Terminal window
    curl -X POST https://api.klozeo.com/api/v1/leads \
    -H "X-API-Key: sk_live_your_key" \
    -H "Content-Type: application/json" \
    -d '{
    "name": "Acme Corporation",
    "source": "website",
    "email": "[email protected]",
    "city": "San Francisco"
    }'

    Response (201 Created):

    {
    "id": "cl_01234567-89ab-cdef-0123-456789abcdef",
    "message": "Lead created successfully",
    "created_at": 1703520000
    }

    A few things to note in this response:

    • The response confirms the write and gives you the lead’s id. Fetch the full lead with GET /leads/{id}.
    • created_at is in Unix seconds (not milliseconds). For JavaScript: new Date(1703520000 * 1000) → December 25, 2023.
    • If a lead with the same email already exists, Klozeo merges into it instead: the status is 200 OK, id is the existing lead’s, and the body includes "duplicate": true.
  3. List your leads:

    Terminal window
    curl https://api.klozeo.com/api/v1/leads \
    -H "X-API-Key: sk_live_your_key"
  4. Filter by city:

    Terminal window
    curl "https://api.klozeo.com/api/v1/leads?filter=and.eq.city.San+Francisco" \
    -H "X-API-Key: sk_live_your_key"

All API endpoints are prefixed with:

https://api.klozeo.com/api/v1