All guides

Send leads from your app

Leads are the people who could become customers. Send them to cuil.si from your own code and they show up in Leads, with a timeline entry saying they came through the API. The leads part of the API is in beta, so it can still change with 30 days' notice.
  1. 1Add or update a lead

    POST /leads adds a person, or fills in the empty fields of the lead with the same email (then the same phone). Nothing already there is overwritten: 201 means new, 200 means it existed. Send what they agreed to in consent, such as the checkbox text they saw. It's a retry-safe request, so a retry never makes a second lead.

    curl -X POST "https://cuil.si/api/v1/leads" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "email": "[email protected]",
        "first_name": "Asha",
        "company": { "name": "Chai Co", "domain": "chai.example" },
        "tags": ["website"],
        "source": "api",
        "consent": { "channel": "email", "purpose": "enquiry", "basis": "asked_to_be_contacted",
                     "text": "Yes, please contact me about my enquiry." }
      }'
    # 201 { "lead": { "id": "...", ... }, "is_new": true, "changed": [...], "warnings": [] }
    # 200 when a lead with that email (or phone) already existed: only its empty fields were filled in.
  2. 2Send many at once

    POST /leads/batch takes up to 100 leads and answers with one result for each, in the same order. One bad lead doesn't stop the others.

    curl -X POST "https://cuil.si/api/v1/leads/batch" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"items": [{"email": "[email protected]", "first_name": "Ravi"}, {"phone": "+919812345678"}]}'
    # { "items": [ { "index": 0, "ok": true, "lead_id": "...", "is_new": true, ... },
    #              { "index": 1, "ok": true, ... } ] }   One result per lead, in the same order.
  3. 3Respect the do-not-contact list

    Before you email or call people from your own system, check them with POST /suppressions/check. When someone opts out on your side, add them with POST /suppressions so cuil.si never contacts them either. We keep only a fingerprint of the address, not the address itself.

    # Before your own emails or calls: is anyone on the do-not-contact list?
    curl -X POST "https://cuil.si/api/v1/suppressions/check" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"emails": ["[email protected]"], "phones": ["+919812345678"]}'
    # { "items": [ { "kind": "email", "value": "[email protected]", "valid": true, "do_not_contact": false, ... } ] }
    
    # Someone unsubscribed in your own system: add them so cuil.si never contacts them either.
    curl -X POST "https://cuil.si/api/v1/suppressions" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"kind": "email", "value": "[email protected]", "reason": "unsubscribed", "source": "my-crm"}'
  4. 4Move them along the pipeline

    PATCH /leads/{lead_id} with a stage moves the lead and its deal. Add a webhook for lead.created, lead.stage_changed, deal.won and deal.lost to hear about changes made in the app. A CSV import sends one lead.imported instead of an event for every row.

    curl -X PATCH "https://cuil.si/api/v1/leads/LEAD_ID" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"stage": "qualified", "deal_value_minor": 2500000}'
    # The lead (and its deal) moves to "qualified"; 2500000 paise is Rs 25,000.
    # Stage keys come from GET https://cuil.si/api/v1/pipelines.
  5. 5Change many at once, and hand out tasks

    POST /leads/bulk-actions moves, tags, lists or gives up to 500 leads to a teammate in one request, and says which ones it skipped and why. POST /lead-tasks makes a to-do for your team, such as a call; it is refused for people who said no to that kind of contact.

    curl -X POST "https://cuil.si/api/v1/leads/bulk-actions" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{"lead_ids": ["LEAD_ID_1", "LEAD_ID_2"], "action": "add_tag", "tag": "trade fair"}'
    # { "done": 1, "skipped": [ { "lead_id": "LEAD_ID_2", "reason": "We couldn't find this lead." } ] }
    
    curl -X POST "https://cuil.si/api/v1/lead-tasks" -H "Authorization: Bearer $CUILSI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"lead_id": "LEAD_ID_1", "kind": "call", "title": "Call about the quote", "due_at": "2026-11-02T10:00:00+05:30"}'
    # 201 { "id": "...", "kind": "call", "status": "open", ..., "warning": null }