Documentation menu

API reference

Errors

One error shape, a short list of status codes, and a machine-readable code for the cases an agent should handle differently.

Error shape

HTTP/1.1 403 Forbidden
Content-Type: application/json

{
  "success": false,
  "error": "This token has knowledge:read — POST /api/ai/knowledge/bases/…/entries needs knowledge:write",
  "code": "INSUFFICIENT_SCOPE",
  "details": { "required": "knowledge:write", "scopes": ["knowledge:read"] }
}

error is for humans and may change wording; branch on code and the HTTP status. 401 responses carry success and error only.

Status codes

StatusMeaningRetry?
400Invalid body or a rule violation (unknown node type, duplicate question, limit exceeded). details carries field errors when there are any.No — fix the request.
401Missing, unrecognised, revoked or expired token.No — check the token on the API page.
402Your credit balance in this workspace is empty (INSUFFICIENT_CREDITS; balance in details.balance).After topping up.
403The token's scope does not cover this call (INSUFFICIENT_SCOPE), the resource is not enabled for the workspace, or the action is app-only (deleting a base).No — adjust the token or do it in the app.
404Base, entry, source, flow, node, edge or execution not found in your workspace — or the id is not a UUID.No — check the id.
500Something failed on our side.Once, then contact support with the request.

Error codes

CodeWhat to do
BAD_REQUESTValidation failed. Look at details.fieldErrors.
INSUFFICIENT_SCOPEThe token lacks the scope in details.required. Create a token with that access, or tick the resource.
INSUFFICIENT_CREDITSBalance is 0 in this workspace. details.balance is the current value.
FORBIDDENAllowed for a session but not for this token — for example a legacy key on another base, or deleting a base.
NOT_FOUNDThe id does not exist in your workspace.

Submissions are the one exception to "errors are HTTP errors": a failed extraction returns 200 with { "status": "error", "error": "…" } so that partial progress (entries already indexed) is not lost. The same applies to a node test that fails.