Skip to main content

API status codes

Every Log Lens JSON API response carries a standard HTTP status code. Success responses return the requested payload; errors return a JSON body of {"error": "..."} with the message describing what went wrong.

Reference

CodeMeaningWhen you see it
200OKThe request succeeded. Default for reads and most writes (status changes, tag assignment, sync, reindex, deletion).
201CreatedA new resource was created - a manual issue, tag, module, or connector.
400Bad RequestA runtime failure that is not a missing resource - for example an incoming import that is already running for the application, or an occurrence whose archived source file is unavailable.
401UnauthorizedAn API key is configured but the request presented none or the wrong one.
403ForbiddenA state-changing request was blocked as cross-origin.
404Not FoundUnknown api endpoint, or a resource whose lookup reports it is not found (for example an unknown issue id).
405Method Not AllowedThe endpoint does not accept the HTTP method you used.
422Unprocessable EntityThe request was understood but a parameter was invalid or missing.
500Server ErrorAn unexpected failure. The full exception is written to the PHP error log.

Notes

401 - authentication. Only enforced when an API key is set (auth.token). Present it as X-Log-Lens-Token or Authorization: Bearer <token>. With no key configured, the API is unauthenticated by default. See API key authentication.

403 - cross-origin. Applies to every method except GET, HEAD, and OPTIONS. A request whose Origin host differs from the Host is blocked. Non-browser clients (curl, cron, the AI skills) send no Origin and pass through. See Cross-origin (CSRF) protection.

405 - method. Each endpoint declares its allowed methods; the error message lists them, e.g. GET or POST required. Writing endpoints like reindex, bulk-issues, and delete-logs require POST.

422 vs 400 vs 404. A bad parameter (missing id, severities that is not an array) returns 422. A runtime failure returns 400, unless its message reports the resource was not found, which returns 404.