Authentication
Every request carries an API key. A key belongs to one workspace, its scopes say what it may do, and it can never do more than the member who created it.
Send your API key as a bearer token in the Authorization header of every request:
curl https://api-prod.lodol.com/api/v1/workflows \
-H "Authorization: Bearer $LODOL_API_KEY"A request without a valid key gets 401 Unauthorized.
Create a key
Create and revoke keys in Lodol under API Keys in the sidebar. Only members whose role has the Manage API keys permission can: owners and admins, and any custom role given it.
- A key belongs to one workspace. Every request it makes works with that workspace's workflows and runs, and its runs count toward that workspace's plan.
- You see the full key once, when you create it. Lodol keeps only its first characters and a hash, so a lost key can't be recovered: revoke it and create another.
- Keys look like
sk_live_followed by a random string with 256 bits of entropy. - Keys can expire. Set an expiry when you create a key, and create a new one before it lapses.
The number of keys a workspace can have depends on its plan:
| Plan | API keys |
|---|---|
| Free | 1 |
| Builder | 10 |
| Pro | 40 |
| Enterprise | Custom |
Scopes
Each key has one or more scopes, which decide the endpoints it can call:
| Scope | Allows |
|---|---|
workflows:read | Listing workflows and reading a workflow, its versions, its next runs and its settings, and listing and reading folders |
workflows:write | Creating, changing and duplicating workflows, checking one before it's saved, restoring a past version, changing a workflow's settings, and creating, renaming and moving folders |
workflows:execute | Starting, stopping and retrying runs, turning workflows on and off, and answering approval requests |
executions:read | Listing runs and reading a run, listing and reading approval requests, and reading the workspace's usage |
values:read | Listing and reading values |
values:write | Creating and changing values, and adding, replacing and removing the rows of a table |
values:delete | Deleting values. Not included unless you tick Delete values when you create the key. |
workflows:delete | Deleting workflows and folders, restoring them, and listing the Trash. Not included unless you tick Delete workflows, folders, documents and websites when you create the key. |
executions:delete | Deleting runs. Not included unless you tick Delete runs when you create the key. |
connections:read | Listing and reading connections, and testing one. Not included unless you tick See connected apps when you create the key. |
connections:write | Connecting an app with credentials, and removing a connection. Not included unless you tick Connect and remove apps when you create the key. |
Only API keys can hold the two connections scopes. AI tools that connect to Lodol by signing in are never offered them; they can be offered every other scope, the three that delete included, which a person ticks by name.
The scopes for runs keep the names executions:read and executions:delete, which keys and AI tools already hold.
GET /me and the catalog of apps, actions and triggers need no scope: any valid key can call them.
Scopes add up: a key with workflows:read and workflows:execute can list and run workflows, but can't read runs without executions:read. Give each key only the scopes its job needs.
A key acts for the member who created it
A request has to be allowed by both the key's scopes and the role of the member who created the key:
- Running, stopping or retrying a workflow, or answering an approval request, also needs the creator's role to include Run workflows.
- Creating a workflow also needs the creator's role to include Create workflows, and changing one needs Edit workflows and edit access to that workflow.
- Deleting a workflow also needs the creator's role to include Delete workflows.
- Deleting a run also needs the creator's role to include Delete runs.
- Creating, changing or deleting a value also needs the creator's role to allow managing the workspace's values, or, for a value only one workflow uses, Edit workflows and edit access to that workflow.
- Connecting an app, or removing a connection, also needs the creator's role to include Run workflows for a personal connection, or Manage apps for one shared with the workspace.
If the creator's role loses a permission, their keys lose it too. If the creator leaves the workspace, their keys stop working on every endpoint, so create replacement keys before someone leaves.
See what a key can do
Returns the workspace a key belongs to, the member it acts for, and its scopes. Any valid key can call it, so it's a quick way to check a key works, or to see why a request was refused.
curl https://api-prod.lodol.com/api/v1/me \
-H "Authorization: Bearer $LODOL_API_KEY"Response 200:
{
"workspace": { "id": "665f1a2b3c4d5e6f7a8b9c00", "name": "Acme", "handle": "acme" },
"member": { "id": "665f1a2b3c4d5e6f7a8b9c0e", "name": "Ada Lovelace", "email": "ada@example.com" },
"key": {
"name": "Invoice sync",
"prefix": "sk_live_3zzc",
"scopes": ["workflows:read", "workflows:execute", "executions:read"],
"expires_at": "2027-03-01T00:00:00+00:00"
}
}Fields
workspaceobject- The workspace the key belongs to: its id, name and handle.
memberobject- The member who created the key, whom it acts for: their id, name and email.
keyobject- The key itself: its name, prefix (its first characters, as the API Keys page shows them), scopes, and expires_at, when it stops working, in ISO 8601, or null if it doesn't expire.
Keep keys safe
- Never put a key in code that runs in a browser or a mobile app, or commit it to a repository.
- Keep keys in environment variables or a secrets manager.
- Use one key per integration, with the fewest scopes it needs, so you can revoke one without breaking the others.
- Revoke keys you no longer use.
Quickstart
Create an API key, start a workflow run from your code, and read its result. About five minutes.
Errors and retries
The error codes the API returns and what to do about each, the request ID to quote to support, which requests are safe to retry, and how idempotency keys stop a retry from doing the work twice.