REST basics
How every call works, with approvals, safe retries, dry runs, lists and history.
The request
Every capability is one call:
POST $FLITO_URL/api/cap/{capability id}
Authorization: Bearer $FLITO_API_KEY
Content-Type: application/json
{"input": {...}, "approved": true, "idempotencyKey": "..."}inputis the capability's input, as its reference page describes. Send{}when it takes none.approvedis only for changes that need approval.idempotencyKeymakes a change safe to retry.
A body that is not valid JSON is read as {}, so the capability answers that its fields are missing.
The answer
A call that ran answers 200:
{
"result": { "...": "the capability's output" },
"commitId": "…",
"eventId": "…",
"idempotentReplay": false
}resultis the capability's output.commitIdnames the version a change made, for records that keep versions. It isnullfor reads.idempotentReplayistruewhen the answer is a replay of an earlier call with the same key.
Any other status is an error with code, message and correlationId. See Errors and limits.
Reads and changes
Reads change nothing. A change runs at once, as the key's person, emails and other sends included. Each one is kept in the record's history with who made it, where the app can undo it.
Changes that need approval
Some changes are hard to undo: deleting, archiving and merging records, sending quotes for signature, bulk email and broadcasts, sending invoices, and switching automations on. With an API key they answer 409 APPROVAL_REQUIRED unless the body says "approved": true:
curl -s "$FLITO_URL/api/cap/company.archive" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"id": "cmp_…"}, "approved": true}'For AI agents calling REST
Set "approved": true only after the person you work for said yes to that exact change. Over
MCP, Flito's own tools handle this for you.
Each capability's reference page says whether it needs approval: always, never, or depending on the input (an automation needs it only when it is switched on).
Safe retries
A network error can leave you not knowing whether a change ran. Send an idempotency key with each change, and send the same key when you retry:
curl -s "$FLITO_URL/api/cap/task.create" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: import-2026-11-10-row-42" \
-d '{"input": {"title": "Call Ada back", "priority": "high"}}'- Put it in the
Idempotency-Keyheader or in the body asidempotencyKey. The body wins when both are there. - A key counts for 24 hours, per capability.
- The same key with the same input replays the first answer, with
"idempotentReplay": true. Nothing runs twice. - The same key with a different input answers
409 IDEMPOTENCY_CONFLICT. - Only calls that worked are remembered, so a retry after an error runs again.
- Retry after the first call has answered. Two calls sent at the same moment with the same key can both run.
Dry runs
POST $FLITO_URL/api/cap/{id}/dry-run with {"input": {...}} runs the change, rolls it back, and answers what it would have done. It never needs approved.
{
"diffs": [{ "entityType": "contacts", "entityId": "con_…", "before": { "...": "..." }, "after": { "...": "..." } }],
"sideEffects": ["…"],
"warnings": [],
"approvalRequired": false
}Use it to show a person exactly what a change will do before you make it.
Lists, search and paging
List capabilities (company.list, contact.list, deal.list, lead.list and the like) share these inputs:
search: words to match on names, emails and the like.limit: up to 200 (500 fortask.list), 50 when left out.offset: how many to skip, for the next page.sortFieldandsortDir(ascordesc), orsortsfor up to three.filter: conditions on any field, below.archivedfor archived records only,includeArchivedfor both.
They answer {"rows": [...], "rowCount": n}, where rowCount counts every match. Page until you have them all:
async function listAll(capability, input = {}) {
const rows = []
for (let offset = 0; ; offset += 200) {
const res = await fetch(`${process.env.FLITO_URL}/api/cap/${capability}`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.FLITO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ input: { ...input, limit: 200, offset } }),
})
const { result } = await res.json()
rows.push(...result.rows)
if (rows.length >= result.rowCount || result.rows.length === 0) return rows
}
}Filters
A filter is groups of conditions, joined with and or or:
{
"combinator": "and",
"groups": [
{
"combinator": "or",
"conditions": [
{ "column": { "field": "lifecycleStage" }, "operator": "eq", "value": "customer" },
{ "column": { "field": "lifecycleStage" }, "operator": "eq", "value": "prospect" }
]
}
]
}Operators: eq, neq, contains, not_contains, contains_any, not_contains_any, starts_with, ends_with, gt, gte, lt, lte, between, in, not_in, is_empty, is_not_empty, is_true, is_false. A workspace's own fields work too: discover lists them.
History and undo
Changes to companies, contacts and deals keep versions, and their answer carries the commitId. To see a record's versions:
curl -s "$FLITO_URL/api/config/commits?objectType=contacts&objectId=con_…" \
-H "Authorization: Bearer $FLITO_API_KEY"GET $FLITO_URL/api/config/commits/{commitId} shows one version and what it changed. To undo it, call config.revert with {"commitId": "…"}. That needs the config:revert scope, which owners and admins hold.
Ids and values
- Ids are a prefix and a UUID:
cmp_companies,con_contacts,deal_deals,lead_leads,task_tasks. - Dates and times are ISO 8601, such as
2026-11-10or2026-11-10T15:00:00Z. - Money is a number in the workspace's currency (
workspace.currencyfrom discover). - In an update, a field you leave out stays as it is, and
nullclears it.
Tracing a call
Send an X-Correlation-Id header with any value you like. Errors carry it back as correlationId, so you can match a failure to your own logs. When you leave it out, Flito makes one.
Shortcuts for common records
A few plain REST routes call the same capabilities:
POST /api/companies,/api/contacts,/api/activitiescreate one. The body is the input itself, not wrapped ininput, and they answer201.PATCH /api/companies/{id}(and contacts, activities) updates one.GET /api/companies?search=&limit=(and contacts, activities) lists them;GET /api/companies/{id}reads one.
They take no approved flag. Everything else goes through /api/cap/{id}.
Was this page useful?