Base URL
Each organization has its own Earnie deployment at its own address. It’s the address you use to sign in, for example:/v1/ on that address. In the API reference, set the tenant field to your organization’s part of the address to send requests to your own deployment.
Authenticating
Send an API key in theAuthorization header of every request:
Choosing scopes
A key’s scopes decide which operations it can call. For example, listing projects needsprojects:read, and submitting a scan needs scans:write. Give each key only the scopes its job needs.
Three presets cover the common jobs:
- CI pipeline: submit scans and read verdicts
- Coding agent (MCP): read posture, findings, and policies, and submit scans
- Read-only reporter: read posture without changing anything
Your first request
List the projects in your organization. The key needsprojects:read.
id in the paths of other operations, for example GET /v1/projects/{projectId}. To find a project’s id from its slug or repository, use GET /v1/projects:resolve.
Paging through lists
Earnie pages lists that can grow large. There are two styles, and each operation’s reference shows which one it uses. Offset paging. Sendlimit and offset. The response carries the page in items and the full count in total. For example, the findings list returns 20 findings by default and up to 1000 per page:
limit, and leave out cursor for the first page. Each response carries a next_cursor. Pass it as cursor to get the next page. On the last page, next_cursor is null or absent. The audit log, policy violations, and policy evaluations use cursors.
Some short lists, such as the projects list, return everything in one response.
Errors
Every error response has the same JSON body:code in your scripts. It is a fixed, machine-readable value. message is for people to read and can change. A few validation errors add fields that explain what to fix, and each operation’s reference documents them.
Failed authentication attempts
Earnie limits how quickly one client address can retry after failed authentication. After a burst of rejected keys it answers429 with the code rate_limited and a Retry-After header. Earnie doesn’t count requests made with a valid key. If you see 429, check the key before you retry.
What’s next
- API keys: create and scope a key
- Earnie CLI: scan and check verdicts from a pipeline without calling the API yourself