Leni HTTP API
Authentication and errors
Authenticate every HTTP API request with a project API key. The key is the user and organization security principal.
| Method | Value |
|---|---|
| Preferred header | X-Api-Key: <project-key> |
| Bearer header | Authorization: Bearer <project-key> |
Identity is server-owned
Client-supplied user or organization identifiers cannot impersonate another account. Query-string API keys are not supported; keep keys out of URLs and logs.
Common status codes
| Status | Meaning |
|---|---|
| 400 | Invalid path, query, or body fields. |
| 202 | The analysis was durably accepted and is still running. Poll using the returned identifiers. |
| 401 | Missing, invalid, or revoked project API key. |
| 402 | Sandbox quota or funded production credit is unavailable. |
| 404 | The requested owner-scoped resource does not exist or is not accessible. |
| 429 | Per-key rate limit exceeded. Respect the Retry-After header. |
| 500 / 502 | Leni or an upstream dependency could not complete the request. Retry only idempotent operations. |
curl -sS "https://api.prod.ca-central-1.leni.co/users/custom-analysts" \
-H "X-Api-Key: $LENI_API_KEY"