Vai al contenuto
Docs menuMCP and API reference / API reference
On this page
  1. Run an action
  2. Routes
  3. Actions that need a yes
  4. Error codes

API reference

Run any Lefine action from your own code over HTTPS, with an API key.

Base URL: https://dash.lefine.ai. Send your key as Authorization: Bearer lfn_.... Create keys in Settings → API keys; a key is shown once.

Run an action

Every action has a name, the same names the MCP tools use. lefine_find lists them with their input.

Terminal
curl -X POST https://dash.lefine.ai/v1/ops/strings.apps.list \  -H "Authorization: Bearer $LEFINE_TOKEN" \  -H "Content-Type: application/json" \  -d '{"input": {}}'

A success is { "ok": true, "data": ... }. An error is { "ok": false, "error": { "code": "...", "message": "..." } }.

Routes

Method and pathWhat it does
GET /v1/mewho the key is: user, workspace, scopes, apps
POST /v1/ops/{name}run one action; body { "input": ..., "approval"?: "..." }
GET /v1/approvals/{id}where an approval stands
POST /v1/mcpthe same actions as MCP tools
GET /health{ "ok": true }

Actions that need a yes

Publishing actions do not run on the first call:

  1. The answer is HTTP 428 with code APPROVAL_REQUIRED and approval: { id, url, expiresAt, preview }.
  2. A person opens url and approves.
  3. Send the same action and input again with "approval": "<id>". It runs once, only if the change is still what the person saw.

Error codes

CodeHTTPMeaning
UNAUTHORIZED401the key is missing, revoked or expired
FORBIDDEN403the key may not do this
MODULE_OFF403the module is off in the workspace
NOT_FOUND404
BAD_INPUT400
CONFLICT409someone changed it since you read it
APPROVAL_REQUIRED / APPROVAL_PENDING428waits for a person
APPROVAL_REFUSED409declined, expired, used, or stale
PAYMENT_REQUIRED402the workspace has no plan
RATE_LIMITED429a connected app asked Lefine to slow down
UNAVAILABLE503a connected app did not answer; try later
INTERNAL500
Was this page helpful?