Lawfficient API

Errors

A single error envelope and the HTTP status codes the API uses.

Successful responses return the resource (or a { "data", "next_cursor" } page) verbatim. Errors use a single envelope:

{
  "error": {
    "code": "insufficient_scope",
    "message": "The API key does not grant leads:read.",
    "details": null
  }
}
  • code — a stable, machine-readable snake_case string. Branch on this, not the message.
  • message — a human-readable description; may change.
  • details — optional structured context, present only for some errors.

Status codes

StatusMeaning
200OK
201Created (a new lead from push, or a consultation from book)
400Malformed request (bad JSON, invalid body)
401Missing or invalid API key
403Key disabled, or missing the required scope
404No such resource (or it belongs to another firm)
413Request body too large
429Rate limit exceeded
500Unexpected server error
503The API is temporarily unavailable / not configured

Common codes

codeStatusWhen
missing_key401No Authorization header
invalid_key401Key doesn't match an active key
key_disabled403Key has been disabled
insufficient_scope403Key lacks the required scope
not_found404Resource doesn't exist for this firm
rate_limited429Too many requests for this key
internal_error500Unexpected failure
unavailable503API not configured / temporarily down

A cross-firm id reads as 404 not_found, never 403 — the API doesn't reveal whether a resource exists in another firm.

On this page