Loopfour

Authentication and API keys

Authenticate API requests with the x-api-key header, choose the scopes a key needs, and create or revoke keys under Settings and API keys.

Every request to the Loopfour API carries an API key in the x-api-key header. A key belongs to one company and holds a list of scopes. Each endpoint checks for the scope it needs.

Base URL

https://workflow.loopfour.ai/api/v1

Send the key

curl https://workflow.loopfour.ai/api/v1/workflows \
  -H "x-api-key: $LOOPFOUR_API_KEY"

Keys start with wfk_live_ or wfk_test_, followed by 32 random characters. A header in any other shape is refused with 401 and the message Invalid API key format.

Keep keys on your server. Do not put a key in browser code, a public repository or a log line. Anyone holding the key can do what its scopes allow.

Create a key in Studio

Open Settings and select API keys.

Select Create key. Enter a Key name, such as "ERP sync", and choose an Expiration: 1 week, 1 month, 3 months, 6 months, 1 year, 3 years or Never. The default is 1 year.

Select Create Key. Copy the key from the dialog. Studio shows it once; Loopfour stores only a hash and the first few characters.

A key created in Studio gets this fixed set of scopes: workflows:read, workflows:write, workflows:execute, connections:read, connections:write, runs:read, runs:write and webhooks:manage. To get a key with a different set, create it through the API (below).

The API keys list shows each key's Name, Key (the stored prefix), Created, Expires and Last Used values. Revoke deletes the key at once; requests that use it then fail with 401.

Scopes

ScopeLets the key
workflows:readList and read workflows, versions and schedules; validate a workflow file. Also accepted on run, table, file, dashboard and audit-log reads (see below)
workflows:writeCreate, update, activate, pause, archive and roll back workflows; create API keys. Also accepted on table, file, dashboard and approval writes
workflows:executeStart a run, start a scheduled run now, and cancel, retry or restart a run
runs:readRead runs and run logs
runs:writeDefined, but no endpoint checks it today
connections:readList and read connections
connections:writeCreate, update and remove connections
connections:connectStart a new connection through a Studio connect link, nothing more
secrets:readList a workflow's secrets (values are masked)
secrets:writeCreate, rotate and delete workflow secrets
webhooks:manageManage the endpoints Loopfour sends run events to
tables:read, tables:writeRead or change data tables
files:read, files:writeRead or change workspace files
dashboards:read, dashboards:writeRead or change dashboards and widgets
approvals:decideApprove or reject a pending approval
audit:readRead the audit log

Some newer scopes sit next to an older one that the same route still accepts, so existing keys keep working. For an API key, workflows:read passes wherever runs:read, tables:read, files:read, dashboards:read or audit:read is checked. workflows:write passes wherever tables:write, files:write, dashboards:write or approvals:decide is checked, and connections:write passes for connections:connect.

workflows:write is enough to create a new API key with any scopes. Give it only to systems you would trust with full access to the company.

Manage keys through the API

Create a key (workflows:write):

curl -X POST https://workflow.loopfour.ai/api/v1/auth/api-keys \
  -H "x-api-key: $LOOPFOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Month-end reporting",
    "scopes": ["workflows:read", "runs:read", "tables:read"],
    "expiresAt": "2027-12-31T00:00:00.000Z"
  }'
FieldTypeRequiredMeaning
namestring, 1 to 255 charactersYesA label you will recognise later
scopesarray of scope stringsYes, at least oneScopes from the table above
expiresAtISO 8601 date-timeNoLeave it out for a key that does not expire

The 201 response holds the full key in data.key. It is returned only here.

{
  "success": true,
  "data": {
    "id": "6f1c2d3e-0000-4000-8000-000000000001",
    "name": "Month-end reporting",
    "key": "wfk_live_q3V9...",
    "keyPrefix": "wfk_live_q3V9",
    "scopes": ["workflows:read", "runs:read", "tables:read"],
    "expiresAt": "2027-12-31T00:00:00.000Z",
    "createdAt": "2026-11-12T10:00:00.000Z"
  }
}

A new key has the same environment (live or test) as the key that created it.

List keys: GET /auth/api-keys returns id, name, keyPrefix, scopes, expiresAt, lastUsedAt and createdAt for each key in the company. The secret is never returned.

Revoke a key: DELETE /auth/api-keys/:id deletes the key and returns { "success": true, "data": { "deleted": true } }, or 404 with code NOT_FOUND when no key with that id exists in the company.

Rotate a key

  1. Create a new key with the same scopes.
  2. Deploy it to the systems that call Loopfour.
  3. Check that requests succeed with the new key. Its Last Used value updates.
  4. Revoke the old key. Both keys work until you do.

Authentication errors

StatusCodeWhen
401UNAUTHORIZEDNo key or session, the key has the wrong format, the key is unknown or revoked, or the key has expired (API key has expired)
403FORBIDDENThe key is valid but lacks the scope. The message names it, for example Missing required scopes: workflows:execute

Both use the standard error body described in Errors, retries and timeouts.

Rate limits

Requests are counted per API key over a one-minute window.

CategoryLimit per minuteUsed by
Read1,000Most GET requests
Write100Most POST, PUT, PATCH and DELETE requests
Execute500Starting, cancelling, retrying and restarting runs

Inbound webhook routes are limited per sending IP address instead (10,000 per minute).

Rate-limited responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (a Unix time in seconds). Over the limit, the API returns 429 with code RATE_LIMITED and a Retry-After header in seconds. Wait that long before you retry.

On this page