Getting started
Make an API key, read from your Flito and make your first change.
You need a login to your company's Flito, with a role that can make changes. This takes about five minutes.
Make an API key
In your Flito, open Settings, Integrations, API and AI and choose Create an API key.
- Name it after the script or tool that will use it.
- Access: choose Read and write for this guide. Choose Read only for anything that only reads.
- Expires: 30 days, 90 days, 1 year or no expiry.
Copy the key when it is shown. It starts with flito_pat_ and is shown only once.
Treat the key like a password
It acts as you, with your role. Keep it in a secret store or an environment variable, never in code that runs in a browser.
Set two variables
export FLITO_URL=https://crm.yourcompany.com
export FLITO_API_KEY=flito_pat_…FLITO_URL is the address you open Flito at, with no slash at the end.
Check the key
curl -s "$FLITO_URL/api/discover" -H "Authorization: Bearer $FLITO_API_KEY"The answer names the workspace, who the key acts as (you.role, you.access) and the ids of every capability the key can run. A 401 means the key is wrong, expired or revoked. See Discover your workspace for the rest of the answer.
Read something
Every capability is one POST to $FLITO_URL/api/cap/{id} with the body {"input": {...}}. This finds companies whose name matches "Acme":
curl -s "$FLITO_URL/api/cap/company.list" \
-H "Authorization: Bearer $FLITO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"search": "Acme", "limit": 5}}'The answer is {"result": {"rows": [...], "rowCount": 12}}. rowCount counts every match, not just this page.
Make a change
This adds a contact. It runs at once, as you, and is kept in the contact's history.
curl -s "$FLITO_URL/api/cap/contact.create" \
-H "Authorization: Bearer $FLITO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"firstName": "Ada", "lastName": "Lovelace", "email": "ada@example.com", "jobTitle": "Head of Operations"}}'{
"result": { "id": "con_…", "firstName": "Ada", "lastName": "Lovelace" },
"commitId": "…",
"eventId": "…",
"idempotentReplay": false
}Run it again and it answers 409 CONFLICT, naming the contact that already has that email. Creates never make a second record for the same email or company domain.
Next
Was this page useful?