Skip to content

REST API v1 · Resource

Sales CRM

Leads, notes, follow-up tasks and the pipeline.

API reference · Sales CRM

Endpoints

Paths are relative to https://fliok.com/api/v1. Each endpoint names the scope and the lowest key role it needs; a key without them gets 403 (see Authentication).

Every WhatsApp contact is a lead with a stage, an owner, a rating, a deal value and a timeline. The phone number is the lead’s identity, so POST /leads is safe to retry: a number you already have is recaptured (its timeline shows it came in again) instead of duplicated. Anywhere you pass a stage, lost reason or team member you can use its name or email instead of an id, and a lead can be addressed by its phone number. Reads need any key; writes need the agent role. Changes made through the API show on the lead’s timeline and fire the same automations and lead.* / task.* webhooks as changes made in the dashboard.

No code at all? Turn on Lead capture in Settings → Sales pipeline for a private URL that website forms, Zapier, Make, Pabbly and Google Sheets can POST leads to without an API key (/api/leads/capture/{token} — JSON, form or multipart).

Sales CRM

9
  • GET/leadsList leads, page-numbered. Filter by view, a filter JSON or ?q=, sort by any sortable fieldScope crm:read · viewer role or higher
  • POST/leadsAdd a lead. Idempotent by phone: a known number is recaptured, never duplicated. Stage and owner by name or emailScope crm:write · agent role or higher
  • GET/leads/{id}One lead with stage, owner, deal value and custom fields — by our id or by phone numberScope crm:read · viewer role or higher
  • PATCH/leads/{id}Move stage (with lost reason), reassign, rate, tag or edit fields. Lands on the lead’s timeline and fires automationsScope crm:write · agent role or higher
  • POST/leads/{id}/notesAdd a note to a lead’s timeline — never sent to the customerScope crm:write · agent role or higher
  • GET/tasksList follow-up tasks with counts per status (open, overdue, today, upcoming, done, cancelled)Scope crm:read · viewer role or higher
  • POST/tasksCreate a follow-up on a lead; the assignee defaults to the lead’s ownerScope crm:write · agent role or higher
  • PATCH/tasks/{id}Complete (with an outcome), cancel, reschedule or reassign a taskScope crm:write · agent role or higher
  • GET/pipelineYour pipeline stages (kind initial, active, won or lost) and lost reasonsScope crm:read · viewer role or higher

Examples

Add a lead (or recapture one you already have)

curl -X POST https://fliok.com/api/v1/leads \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+91 98765 43210",
    "name": "Asha Rao",
    "email": "asha@example.com",
    "source": "Partner portal",
    "stage": "Contacted",
    "owner": "urvi@yourcompany.com",
    "rating": 3,
    "dealValue": 250000,
    "tags": ["december"],
    "attributes": { "city": "Udaipur" },
    "note": "300 guests, wants a lake view"
  }'

List leads — a view, a filter, a search

# Won leads, biggest deals first, 25 per page
curl "https://fliok.com/api/v1/leads?view=sys:won&sort=dealValue&dir=desc&pageSize=25" \
  -H "Authorization: Bearer wa_YOUR_API_KEY"

# Any filter the dashboard can build (URL-encode it)
curl -G "https://fliok.com/api/v1/leads" \
  --data-urlencode 'filter={"match":"all","conditions":[{"field":"source","op":"in","value":["Website"]},{"field":"rating","op":"gte","value":4}]}' \
  --data-urlencode "q=asha" \
  -H "Authorization: Bearer wa_YOUR_API_KEY"

Move a lead, and log what happened

# :id is our lead id OR the phone number
curl -X PATCH https://fliok.com/api/v1/leads/+919876543210 \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "stage": "Lost", "lostReason": "Too expensive", "owner": "urvi@yourcompany.com", "addTags": ["priced-out"] }'

curl -X POST https://fliok.com/api/v1/leads/+919876543210/notes \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "body": "Asked for a quote under 2L" }'

Follow-up tasks

curl -X POST https://fliok.com/api/v1/tasks \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "leadId": "+919876543210", "type": "call", "title": "Call back with revised quote",
        "dueAt": "2026-09-16T11:00:00+05:30", "priority": "high", "assignee": "tushar@yourcompany.com" }'

curl "https://fliok.com/api/v1/tasks?status=overdue&pageSize=50" -H "Authorization: Bearer wa_YOUR_API_KEY"

curl -X PATCH https://fliok.com/api/v1/tasks/31089580-1422-48cc-becd-85c4e6689352 \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "done", "outcome": "Sent revised quote" }'

Read the pipeline

curl https://fliok.com/api/v1/pipeline -H "Authorization: Bearer wa_YOUR_API_KEY"

Rate limits

The buckets these endpoints use. Burst is how many requests you can make back-to-back from a full bucket; sustained is how fast it refills.

BucketEndpointsBurstSustained
CRM writesPOST /leads · PATCH /leads/{id} · notes · POST /tasks · PATCH /tasks/{id}12010 / sec
Lead capture URLPOST /api/leads/capture/{token} (per sending address)3030 / min

Every limit, the RateLimit-* headers and what to do on a 429: Rate limits.