---
title: "Endpoints"
description: "The API routes most integrations use, grouped, with method, path, required scope and what each does. The generated pages list every route."
---

The routes most integrations use, grouped. Everything below is relative to
`/api/v1`, except the two operational probes in [System](#system), which are
not. The generated endpoint pages in this API reference list every route a
customer can call, including the git host and notification routes this page
leaves out. The operator's staff console (`/api/v1/staff/*`) is not among them:
it takes no customer credential and answers `404` outside the operator's
network ([Staff console](/deployment/staff-console)).

The **scope** column names the permission a machine credential needs. Where it
reads *human only*, the permission is one no API key may hold. See
[Scopes](/api-reference/scopes) for why each is withheld.

The OpenAPI specification (rendered as the endpoint pages in this API
reference, less the staff console) describes exactly the routes the router
registers, and a Go test
keeps it that way: it enumerates the routes the router actually registers and
fails the build if any is missing from the specification, or if the
specification names a route that does not exist. Nothing tests that this page
lists them all.
Stated with its limits, because a guard whose limits are not stated gets
trusted beyond them. The test covers routes and methods, not request and
response **schemas**, which are hand-written and can still drift.

## Credentials

Managed by a person, used by a machine. Every route here requires
`apikeys:manage`, which no API key may hold, so this whole group is reachable
only with a browser session.

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/api-keys` | human only | List the organisation's keys, including revoked and expired ones |
| `POST` | `/api-keys` | human only | Issue a key. The secret is in the response and nowhere else, ever |
| `GET` | `/api-keys/scopes` | human only | The scopes a key may be granted, served rather than hard-coded in clients |
| `DELETE` | `/api-keys/{id}` | human only | Revoke a key. Immediate, idempotent, and the row is kept |

See [Authentication](/api-reference/authentication) for the credential
lifecycle and [Rotate an API key](/how-to/rotate-an-api-key) for the
procedure.

## Registry credentials

What a scan presents to a registry that requires authentication. Requires the
`private_registries` entitlement, on Pro and Enterprise.

`credentials:manage` is one no API key may hold. A credential that could store
or rotate a registry credential could decide what a tenant's scans authenticate
to, and therefore which images they pull, so this group is reachable only with
a browser session, and only by an administrator. `credentials:read` is
grantable, because no route here returns a secret.

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/registry-credentials` | `credentials:read` | List stored credentials with their status. Never a secret |
| `POST` | `/registry-credentials` | human only | Store one. `402` when the plan does not include private registries, `409` when the registry already has one |
| `PUT` | `/registry-credentials/{id}/secret` | human only | Rotate the secret in place. The registry cannot be changed here |
| `PUT` | `/registry-credentials/{id}/enabled` | human only | Disable or re-enable. Re-enabling returns it to `unverified` |
| `POST` | `/registry-credentials/{id}/verify` | human only | Re-test it against its registry |
| `DELETE` | `/registry-credentials/{id}` | human only | Delete it permanently |

**There is no endpoint that reads a stored secret back**, at any role. A secret
that can be fetched is one that ends up in a screenshot; if you lose it, rotate
it.

Rotation and deletion are deliberately **not** gated on the entitlement. A
tenant who has downgraded must always be able to replace or withdraw a secret
they gave us. A leaked credential that cannot be revoked until the customer
buys a plan is a security outcome no billing decision should produce.

A scan whose credential cannot be resolved **fails** rather than falling back to
an anonymous pull, which would risk reporting a public image's findings as
yours.

Registry credentials are managed in the dashboard under **Settings →
Registries**, where they can be stored, verified against the registry,
rotated, disabled and deleted. The endpoints below are the same surface for
automation; neither is a second source of truth.

## Scans

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/scans` | `scans:read` | List scans, cursor-paginated, newest first. Optional `asset_id` filter |
| `POST` | `/scans` | `scans:create` | Request a container image scan. `202` accepted, `200` when an existing scan was returned |
| `GET` | `/scans/{id}` | `scans:read` | Read one scan. The endpoint a pipeline polls |
| `POST` | `/scans/{id}/cancel` | `scans:create` | Stop a queued or running scan of any kind. `409` when it has already finished |
| `GET` | `/dast/targets` | `assets:read` | List dynamic scan targets, and whether the scan engine is reachable |
| `POST` | `/dast/targets` | `assets:write` | Add a web application. Queues a first passive check |
| `GET` | `/dast/targets/{id}` | `assets:read` | Read one target, with what to publish to prove ownership |
| `PATCH` | `/dast/targets/{id}` | `assets:write` | Change limits, the authentication header (write-only) or the OpenAPI document |
| `DELETE` | `/dast/targets/{id}` | `assets:write` | Stop scanning an application. Its asset and findings are kept |
| `POST` | `/dast/targets/{id}/verify` | `assets:write` | Check ownership now. `200` either way; read `verified` |
| `POST` | `/dast/targets/{id}/scans` | `scans:create` | Scan a target: active if ownership is still proven when it runs, passive otherwise |
| `GET` | `/scans/{id}/sarif` | `findings:read` | The scan's findings as a SARIF 2.1.0 log (`application/sarif+json`). `409` until the scan is terminal. See [Findings on pull requests with SARIF](/integrations/sarif-code-scanning) |

Requesting a scan:

```bash
curl -s -X POST https://app.trustivan.com/api/v1/scans \
  -H "Authorization: Bearer $TRUSTIVAN_KEY" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: build-$CI_PIPELINE_ID" \
  -d '{"image": "alpine:3.21"}'
```

`202` means work accepted, not work done, because pulling and unpacking an image takes
seconds to minutes. `200` means an existing scan was returned, so a client can
tell a deduplicated retry from a new scan without guessing.

The image reference is untrusted input, validated at the boundary. Private and
link-local registries, embedded credentials, URL schemes and traversal segments
are refused with a message naming the rule.

`GET /scans/{id}` reports `database_state` alongside the result: how fresh the
advisory data behind it was. A scan run against stale data reports "no
vulnerabilities" with exactly the same confidence as a correct one.

## Assets and schedules

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/assets` | `assets:read` | List assets with open-finding counts, cursor-paginated |
| `GET` | `/assets/{id}` | `assets:read` | Read one asset and its severity breakdown |
| `GET` | `/assets/{id}/findings` | `findings:read` | List one asset's findings, cursor-paginated |
| `GET` | `/assets/{id}/schedule` | `schedules:read` | Read an asset's rescan schedule. `404` when there is none |
| `PUT` | `/assets/{id}/schedule` | `schedules:write` | Create or replace it |
| `DELETE` | `/assets/{id}/schedule` | `schedules:write` | Remove it |
| `GET` | `/assets/{id}/runtime` | `assets:read` | [Code to cloud](/configuration/code-to-cloud): the workloads and functions running an image (by digest, or by tag and labelled weaker), or what a workload runs; up to 200 placements |
| `GET` | `/assets/{id}/grade` | `assets:read` | The asset's [posture grade](/concepts/posture-grades) from A to F, the rules that set it, and 30 days of history |
| `GET` | `/stats/grades` | `assets:read` | Grades for the organization, each asset kind, environment and owner, the 10 worst assets and a 30-day trend |
| `PATCH` | `/assets/{id}` | `assets:write` | Record who owns an asset, which environment it runs in, and how much it matters. Absent fields are left alone |
| `DELETE` | `/assets/{id}` | `assets:write` | Retire an asset. **Archives rather than deletes**: findings, components, scans and graph edges all survive, and the asset leaves the listing, the roll-ups and your asset count. A `reason` is required |
| `POST` | `/assets/{id}/restore` | `assets:write` | Return an archived asset to service |
| `GET` | `/schedules` | `schedules:read` | List the organisation's recurring scans |

`PUT` rather than `POST` for a schedule, because a schedule is a singleton per
asset: sending the same request twice must leave exactly one, which a partial
unique index enforces even under a race.

```bash
curl -s -X PUT https://app.trustivan.com/api/v1/assets/$ASSET_ID/schedule \
  -H "Authorization: Bearer $TRUSTIVAN_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"enabled": true, "frequency": "daily", "timezone": "Europe/Berlin"}'
```

`timezone` is an IANA name, and a daily or weekly schedule keeps that zone's clock
through daylight saving. It is optional: a new schedule is `UTC`, and an update that
omits it keeps what the schedule has.

Digest-pinned assets are refused: they have no tag to re-resolve, so a
"rescan" would either re-read identical bytes forever or silently scan
`:latest`, which is a different image from the one you are watching.

## Findings

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/findings` | `findings:read` | List findings. Filters: `status`, `severity`, `kind`, `asset_id`, `known_exploited`, `reachability` (`reachable`, `not_reachable`, `unknown`, comma-separated), `malicious`, `min_epss` (0 to 1), `q` (an advisory or rule ID, or a package name, matched as a case-insensitive substring), `identifier` (one advisory or rule ID, matched exactly), `asset_kind` (comma-separated asset kinds, such as `container_image,repository`) and `sla` (`overdue` or `due_soon`, against the organisation's own remediation targets) |
| `GET` | `/findings/groups` | `findings:read` | Findings grouped by issue (`kind` and `identifier`), worst first, with a count, the number of assets and a per-status breakdown for each. Takes every `/findings` filter plus `limit` (default 100, at most 200); not paginated, and `truncated` says when the limit cut the list |
| `GET` | `/findings/{id}` | `findings:read` | Read one finding with a page of its timeline |
| `GET` | `/findings/{id}/events` | `findings:read` | A finding's audit trail, cursor-paginated |
| `PATCH` | `/findings/{id}` | `findings:write`, or `findings:suppress` to suppress | Change one finding's lifecycle state |
| `POST` | `/findings/bulk` | `findings:write`, or `findings:suppress` for `suppress` | Apply one action to up to 500 findings |
| `POST` | `/findings/{id}/rotate` | `findings:write` | Record that a leaked secret was rotated or revoked. A `note` is required. Not a status change. See [Secret scanning](/security/secret-scanning#remediation) |

Enumerate with `order=recent`. It is the order whose keys are immutable and
whose traversal is therefore exhaustive; `severity` is the backlog view and can
miss rows that move. See [Pagination](/api-reference/pagination).

`status: "resolved"` is refused by `PATCH`. Resolution means a scan that would
have found the vulnerability did not: evidence, not opinion. Requesting the
state a finding is already in succeeds and writes nothing.

The audit trail names its actor structurally: `actor_user_id` for a person,
`actor_api_key_id` for a machine, `scan_id` for a scan, and none of them for an
unattended system action such as a suppression expiring. No audit row ever
claims a person did something a pipeline did.

Bulk actions are **verbs, not target statuses**. The verbs are `suppress`,
`unsuppress` and `triage`:

```bash
curl -s -X POST https://app.trustivan.com/api/v1/findings/bulk \
  -H "Authorization: Bearer $TRUSTIVAN_KEY" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: build-4471-triage" \
  -d '{
        "action": "triage",
        "finding_ids": ["1b6c...", "9d2f...", "4a71..."]
      }'
```

A bulk caller's 500 findings are in a mix of states, so "set them all to open"
means something different to each row. An action says what the caller intends,
and the state machine decides per row whether it is reachable.

Two actions are deliberately absent. **Bulk resolve**, because no human may
assert resolution. **Bulk reopen**, because it has no legitimate use and would
be an excellent way to undo a colleague's triage across an entire asset.

The response carries `batch_id`, `requested`, `applied`, `already_applied`,
`rejected` and per-item `results`. See
[Errors and limits](/api-reference/errors).

## Policies and verdicts

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/policies` | `policies:read` | List policies, enabled first |
| `POST` | `/policies` | human only | Create a policy, disabled and with no rules |
| `GET` | `/policies/{id}` | `policies:read` | Read a policy and its current rules |
| `PATCH` | `/policies/{id}` | human only | Enable or disable a policy |
| `GET` | `/policies/{id}/versions` | `policies:read` | List a policy's immutable versions, newest first |
| `POST` | `/policies/{id}/versions` | human only | Add an immutable version |
| `POST` | `/scans/{id}/verdict` | `verdicts:request` | Decide whether a scan satisfied the policy |
| `GET` | `/scans/{id}/verdicts` | `scans:read` | Every decision recorded for a scan |
| `GET` | `/verdicts` | `policies:read` | The organisation's recent decisions |

Authoring policy requires `policies:manage`, which is not grantable to a key:
the verdict exists so a build cannot decide its own outcome, and a credential
that could both request a verdict and rewrite the policy behind it would make
every scan pass.

A policy is created **disabled and with no rules**. One that started enforcing
the moment it was created would break a pipeline before its author had read it
back. Rules never change in place. A change issues version N+1, which leaves
the reasoning behind every existing verdict intact. At most one policy may be
enabled per scope, because evaluating several would leave "did this scan pass"
with no single answer.

**The endpoint a CI job calls to learn whether to ship:**

```bash
curl -s -X POST https://app.trustivan.com/api/v1/scans/$SCAN_ID/verdict \
  -H "Authorization: Bearer $TRUSTIVAN_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}'
```

```json
{
  "id": "e81b...",
  "scan_id": "3f4a...",
  "policy_name": "Release gate",
  "policy_version": 4,
  "result": "fail",
  "blocking": true,
  "summary": "2 critical findings matched rule no-criticals",
  "considered": 137,
  "suppressed": 6,
  "rules": [ ... ]
}
```

`201` on create, `200` on replay, because it is idempotent per (scan, policy version),
enforced by a unique constraint. **The result is in the body, never in the HTTP
status.** Branch on `blocking`. Every rule is reported, fired or not, because a
`pass` has to be explainable too.

`GET /scans/{id}/verdicts` returning several is normal and is the point: a scan
evaluated under version 1 and again under version 4 has two decisions, and the
first remains exactly as it was. Historical verdicts are never recomputed.

## Webhooks

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/webhooks` | `webhooks:read` | The organisation's endpoints, and the subscribable event types |
| `POST` | `/webhooks` | human only | Register a destination. The response carries `secret`, once |
| `GET` | `/webhooks/deliveries` | `webhooks:read` | Recent delivery attempts. Optional `endpoint_id` filter |
| `GET` | `/webhooks/{id}` | `webhooks:read` | One endpoint, without its secret |
| `PATCH` | `/webhooks/{id}` | human only | Enable or disable an endpoint |
| `DELETE` | `/webhooks/{id}` | human only | Delete an endpoint and its delivery history |
| `POST` | `/webhooks/{id}/rotate-secret` | human only | Issue a new signing secret |

Managing webhooks requires `webhooks:manage`, which is not grantable to a key.
An endpoint is a destination every future matching event is copied to, so a
machine credential that could add one could stream an organisation's findings
somewhere the organisation never chose.

Signing secrets have **no read path at all**. They are returned once by create
and once by rotate, and TRUSTIVAN has no way to show them again, which is what
makes "we cannot leak it in a screenshot" a property of the system rather than
a policy.

Rotation keeps the previous secret working for an overlap window, and
deliveries are signed with both until it closes. Receivers accept a delivery if
**any** signature in the header verifies, which is what makes rotation a change
a customer can make on their own schedule rather than an outage.

Subscribable events are `scan.completed`, `verdict.recorded` and
`finding.state_changed`. An endpoint must name the ones it wants: one that
received everything would be one whose owner cannot reason about what it will
be sent.

Disabling is reversible and keeps the delivery history; deleting is not.
Re-enabling clears the consecutive-failure count, so an operator who has fixed
their receiver is not disabled again by the failures that preceded the fix.

## System

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/health` | none | Liveness. Checks nothing. **Not** under `/api/v1` |
| `GET` | `/ready` | none | Readiness. Checks dependencies and returns `503`. **Not** under `/api/v1` |
| `GET` | `/stats` | `assets:read` | The organisation's security posture in one request: assets, open findings by severity and by status (`status_counts`), how many are past their remediation target or due within 7 days (`sla`), the open backlog by finding kind, asset kind and severity (`finding_breakdown`), and scans in flight |
| `GET` | `/stats/posture` | `assets:read` | Thirty days of opened and resolved findings, the open backlog by kind, known-exploited and fixable counts, mean time to resolve, and the assets carrying the most risk |
| `GET` | `/system/status` | authenticated | Dependencies, advisory-data freshness, and this organisation's own scanning activity |
| `GET` | `/github/available-repos` | authenticated | Repositories visible to the GitHub App installation |
| `POST` | `/github/webhook` | none, signature-verified | GitHub webhook receiver |

`/health` and `/ready` are separate on purpose. A liveness probe that consulted
the database would restart every instance during a failover, turning a
recoverable dependency outage into a total one.

`/system/status` reports the caller's **own** organisation's activity and no
cross-tenant figures: a queue depth would tell every customer how much work
every other customer is doing. It carries no role requirement, because a viewer
who cannot tell a stale database from a clean image is exactly the person the
staleness will mislead. Prometheus metrics are a different thing on a different
listener and are never on this API.

`POST /github/webhook` verifies the signature, fails closed on a bad one, and
**acknowledges without processing**. It does not scan pull requests. The work
it once dispatched belonged to a product TRUSTIVAN is not.

`GET /github/available-repos` lists what a GitHub App installation can see. It
is the mechanism a future integration would need; it does not itself scan
anything.

## Session

Human-facing. Every route here is unauthenticated in the sense that it does not
require an existing session, and the four credential endpoints are rate-limited
per source address at 10 requests per minute, counted across every API replica
(in Redis, falling back to each replica's own count if Redis is unreachable).
Behind a reverse proxy, the source address is the proxy unless
`TRUSTED_PROXIES` names it; the shipped production Compose file and Kubernetes
overlay set it.

| Method | Path | Description |
|---|---|---|
| `POST` | `/auth/signup` | Create an account. Session cookies are set; the body carries no credential |
| `POST` | `/auth/login` | Start a browser session. Answers `200` with `mfa_required` and a challenge token, **not** cookies, when the account has a second factor |
| `POST` | `/auth/refresh` | Renew a browser session |
| `POST` | `/auth/logout` | End a session. Clears the cookies **and** revokes the refresh token |
| `POST` | `/auth/exchange` | Redeem a single-use OAuth handoff code. Can also answer `mfa_required`, since every provider callback funnels through one handoff |
| `GET` | `/auth/github` | Begin GitHub sign-in. `302` to the provider |
| `GET` | `/auth/github/callback` | GitHub callback. `302` with a single-use code |
| `GET` | `/auth/github-app` | Begin GitHub App installation |
| `GET` | `/auth/github-app/callback` | GitHub App callback |
| `GET` | `/auth/gitlab` | Begin GitLab sign-in |
| `GET` | `/auth/gitlab/callback` | GitLab callback |
| `GET` | `/auth/google` | Begin Google sign-in |
| `GET` | `/auth/google/callback` | Google callback |
| `GET` | `/me` | The authenticated user. Human sessions only. An API key has no user to describe |
| `POST` | `/me/verify-email` | Mail a verification link to your own address (at most one a minute; `503` when no mail is configured). The token is never returned outside development |
| `POST` | `/auth/verify-email` | Redeem a verification token. Public and rate-limited; the token is the authority |
| `POST` | `/me/password` | Change your password: the current one, plus a current TOTP code when MFA is on. Ends every session, this one included. Refusals carry a `code` (`current_password_incorrect`, `mfa_required`, `weak_password`, `no_password`) |
| `POST` | `/auth/password/forgot` | Mail a reset link, valid 30 minutes and once. The same `202` whether or not the address has an account |
| `POST` | `/auth/password/reset` | Set a new password from a reset link. Ends every session; `400` with `code` `invalid_reset_link` or `weak_password`; `403` under SSO enforcement |

The OAuth callbacks redirect with a **single-use code** rather than a token in
the URL, and the dashboard redeems it over `POST /auth/exchange`. A token in a
redirect URL ends up in browser history, in a referrer header and in every
proxy log between here and there.

A provider sign-in whose email matches an existing account is **linked only when
both sides have verified the address**: the provider says it verified it
(Google `verified_email`, GitHub's primary address marked verified, GitLab
`confirmed_at`) and the existing account verified it here. Otherwise the
callback answers `409` and nothing is linked. Linking on an unverified address
would hand the account to whoever registered that address first.

Logout revokes the refresh token as well as clearing the cookies, so a copy
captured earlier cannot be replayed after the user believes they have signed
out.

## Second factor

Two halves that must not be confused.

`POST /auth/mfa/verify` is **public**: it is the second step of a login, so the
caller holds a challenge token and no session, and requiring one would make the
challenge unanswerable. Everything under `/auth/mfa` sits behind an ordinary
session and is **human only**. A machine credential has no second factor, and
each of these answers `403` to one rather than failing further down.

| Method | Path | Description |
|---|---|---|
| `POST` | `/auth/mfa/verify` | Exchange a challenge token and a code for a session. Public, rate-limited |
| `POST` | `/auth/mfa/required-enrollment` | A sign-in held because the organization requires MFA and the account has none: issue a TOTP secret against the challenge token. Public, rate-limited |
| `POST` | `/auth/mfa/required-enrollment/confirm` | Confirm that factor and receive the session and recovery codes. Public, rate-limited |
| `GET` | `/auth/mfa` | Enrolment state, and how many recovery codes remain |
| `POST` | `/auth/mfa/enroll` | Issue a TOTP secret and its `otpauth://` URI. The only time the secret is returned |
| `POST` | `/auth/mfa/confirm` | Switch the factor on. Returns the recovery codes, once |
| `DELETE` | `/auth/mfa` | Turn it off. Requires a current code in the body |
| `POST` | `/auth/mfa/recovery-codes` | Replace the recovery codes with a fresh set |

**A correct password alone never produces a session** once a factor is
confirmed. It produces a challenge, and the response deliberately does not
identify the user. Branch on `mfa_required`, not on the status code: it is
`200` either way, and a client that reads `200` as "signed in" lands on an
authenticated page with no session.

`code` accepts a six-digit TOTP code or a recovery code, and both are
single-use. A step already spent is refused even while still inside its time
window. Every failure answers the same `401`, because telling them apart would
tell an attacker whether a captured token is still live.

Enrolment, disable and regeneration each demand a current code **in addition
to** the session. A session alone must not be enough to remove the factor;
that is the step that turns a stolen session back into a stolen account.
Confirming enrolment revokes every other session and re-issues this browser's.

Two-factor is per-user and opt-in. An organisation cannot yet require it of
its members. Enterprise SSO deliberately defers to your own identity provider.

## Members and invitations

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/members` | `members:read` | The organisation's members, most privileged first, each with how the membership arrived |
| `GET` | `/members/invitations` | `members:read` | Every invitation, settled ones included. Never the token |
| `POST` | `/members/invitations` | human only | Invite somebody. The response carries `token`, once. `402` when the plan has no free seat |
| `DELETE` | `/members/invitations/{id}` | human only | Withdraw an outstanding invitation |
| `PATCH` | `/members/{userId}` | human only | Change a member's role |
| `DELETE` | `/members/{userId}` | human only | Remove a member. Their sessions go with the membership |
| `POST` | `/invitations/preview` | authenticated | What an invitation offers. No tenant scope, because the holder is not yet a member |
| `POST` | `/invitations/accept` | authenticated | Accept one. Matched against the signed-in user's own address. The response names the organisation joined (`organization_id`); accepting does not switch you into it. `402` only if the organisation is over its seat limit |

The two redemption routes are `POST` rather than `GET` with the token in the
path, deliberately: a token in a URL reaches the access log, the browser
history, the `Referer` header of every asset the page loads, and any proxy in
between. A body does not.

`owner` is accepted by `PATCH /members/{userId}` and refused by
`POST /members/invitations`. Promoting somebody already present is ownership
transfer; offering ownership by email could leave a tenant with an owner who
never agreed to be one.

The invitation is also mailed to the invitee as a link to the dashboard's
accept page. The response carries that link as `accept_url` and says whether it
was mailed (`emailed`); when no mail is configured it was not, and delivering
it is the administrator's to do.

## Notifications

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/notifications/settings` | `members:read` | Which events are mailed, to which members, and whether a Slack webhook is set (never the URL) |
| `PUT` | `/notifications/settings` | `webhooks:manage`, human only | Replace them. Recipients must be members, and are re-checked when each alert is sent. The Slack URL must be https and is stored encrypted; omit it to keep, send `""` to remove |

Two events alert: new critical or high findings first seen by a scan, and a
`FAIL` policy verdict.

## Organisations

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/me/orgs` | human only | The organisations you belong to, your role in each, and which is active |
| `PUT` | `/me/active-org` | human only | Act in another of your organisations, from the next request on and in every session you hold, NHI Security included. `404` for one you do not belong to |
| `POST` | `/orgs` | human only | Create an organisation. You become its owner and are switched into it; it starts on the Free plan |
| `PATCH` | `/orgs/current` | `organization:manage` | Rename the organisation you are acting in. Never grantable to a key |
| `GET` | `/orgs/current/export` | `organization:delete` | Everything the tenant holds, as JSON or a ZIP of CSV sheets. Owner only |
| `GET` | `/orgs/current/deletion` | any member | The pending erasure, or `null`. Every member can see one, not only owners |
| `POST` | `/orgs/current/deletion` | `organization:delete` | Schedule the erasure. Owner only, the name must be typed back, never your personal organisation, and nothing is erased for seven days |
| `DELETE` | `/orgs/current/deletion` | `organization:delete` | Cancel a scheduled erasure. `404` when there is nothing to cancel |

Any request may carry `X-Expected-Organization: <id>`. If it would act in a
different organisation, because you switched in another tab, it is refused
with `409` and `code: organization_changed` before anything happens.

## Workloads and authorization

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/workloads` | `workloads:read` | The tenant's non-human principals, their delegations and standing |
| `POST` | `/workloads` | human only | Delegate a workload. Counts against the plan's non-human identity ceiling |
| `POST` | `/workloads/{id}/rotate` | human only | Replace a workload's credential, keeping the workload. The new one is returned once |
| `DELETE` | `/workloads/{id}` | human only | Revoke one |
| `POST` | `/authz/decide` | authenticated | May the calling principal perform this action? |
| `GET` | `/authz/audit-chain` | `identity:read` | Whether the administrative audit trail was tampered with |

`/authz/decide` answers about the **calling** principal only. One that answered
about an arbitrary principal would be an oracle for probing what other agents
may do. It is a `POST` because the question carries a resource and attributes,
and a refusal is recorded, so it is not a safe method.

## Software inventory

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/components` | `assets:read` | Search the estate's software inventory |
| `GET` | `/components/{id}` | `assets:read` | One component, and what depends on it |
| `GET` | `/assets/{id}/components` | `assets:read` | What one asset contains |
| `GET` | `/assets/{id}/relationships` | `assets:read` | How an asset relates to the rest of the estate: one hop, both directions |
| `GET` | `/assets/{id}/graph` | `assets:read` | Walk the estate graph. `direction` (`up` or `down`) is required; `depth` defaults to 2 and is clamped to the server maximum, with the depth actually walked reported in the response |

## Bills of materials

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/assets/{id}/sbom` | `assets:read` | Render an asset's inventory as CycloneDX 1.5 or SPDX 2.3 |
| `POST` | `/assets/{id}/sbom` | `scans:create` | Import a bill of materials into an asset's inventory. Finds nothing; see `/sbom/uploads` |
| `POST` | `/sbom/uploads` | `scans:create` | Upload a bill of materials and scan it for vulnerabilities |
| `GET` | `/sbom/documents` | `assets:read` | Documents exported from and imported into this tenant |
| `GET` | `/sbom/documents/{id}` | `assets:read` | One document |

Select the format with `?format=cyclonedx` (the default) or `?format=spdx`, and
add `?download=true` for a file rather than an inline body.

Export reads, so it is `assets:read`. Import **changes the tenant's inventory**,
which is what `scans:create` already governs, so no new permission was
introduced for it.

Three properties worth relying on:

- **An import adds; it never removes.** It cannot silently shrink an inventory
  a scan established.
- **Both formats round-trip.** They share one neutral document with a single
  encoder and decoder each, so an export re-imported returns the same
  inventory rather than losing dependency edges on one of four pairwise paths.
- **Identity is the PURL**, from the same function the scanner uses. A
  document's own `bom-ref` or `SPDXID` is a document-local handle and is never
  persisted as identity.

## Licences

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/licenses` | `assets:read` | Licence inventory for one asset or the whole estate |

Takes `asset_id` to narrow to one asset, and `allow`, `deny` and
`allow_categories` to evaluate a candidate policy against the inventory. Those
parameters are supplied **per request rather than stored**, so you can ask what
a policy would flag before committing to it.

The inventory is derived from `components` on read rather than materialised. A
stored copy would go stale the moment a rescan corrected an asset. A licence is
modelled as a **fact about an asset, not a finding**, so it cannot be
suppressed; a finding that could be suppressed would let someone hide a
copyleft component from their own licence report.

## Check catalogue

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/catalogue/checks` | `findings:read` | Search the cloud, Kubernetes, static-analysis, secret and TLS checks TRUSTIVAN runs by `q` and `area`; at most 50 |
| `GET` | `/catalogue/checks/{id}` | `findings:read` | One check by ID (a finding's `identifier`) or slug: what it checks, why, how to fix it, mapped controls |

## Attack paths

The [security graph and its attack paths](/concepts/attack-paths). Built by the worker.

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/attack-paths` | `findings:read` | Paths, highest score first; `min_score`, `target_kind`, `asset_id`, `finding_id`, `limit` (1 to 200), `offset`; `graph` is the last build's state |
| `GET` | `/attack-paths/{id}` | `findings:read` | One path, every hop explained, with the findings it depends on |
| `GET` | `/assets/{id}/security-graph` | `findings:read` | The graph within `depth` (1 to 3) edges of an asset; at most 200 nodes |
| `GET` | `/security-graph/nodes` | `findings:read` | Nodes matching `q` (label or key) and `kind`, most connected first; `limit` 1 to 50 |
| `GET` | `/security-graph/neighbourhood` | `findings:read` | The graph within `depth` (1 to 3) edges of the node named by `key`; at most 200 nodes |
| `PUT` | `/security-graph/nhi-identities` | `scans:create` | NHI Security publishing the organization's non-human identities; replaces the last publication |

## Certificates

The [certificate inventory](/configuration/certificates).

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/certificates` | `assets:read` | The certificates endpoints served at their last check, soonest expiry first, with where each is served; filter by `status`, `source` and `q` |
| `GET` | `/certificates/endpoints` | `assets:read` | The TLS endpoints checked |
| `POST` | `/certificates/endpoints` | `assets:write` | Add a TLS endpoint and check it |
| `DELETE` | `/certificates/endpoints/{id}` | `assets:write` | Stop checking an endpoint you added |
| `POST` | `/certificates/endpoints/{id}/check` | `scans:create` | Check an endpoint now |
| `GET` | `/certificates/ranges` | `assets:read` | The network ranges swept for TLS and SSH services |
| `POST` | `/certificates/ranges` | `assets:write` | Add a network range to sweep |
| `DELETE` | `/certificates/ranges/{id}` | `assets:write` | Stop sweeping a range and remove its endpoints |
| `GET` | `/certificates/settings` | `assets:read` | The expiry thresholds |
| `PUT` | `/certificates/settings` | `assets:write` | Change the expiry thresholds |

## MCP

| Method | Path | Scope | Description |
|---|---|---|---|
| `POST` | `/mcp` | an API key; each tool needs its own scopes | One Model Context Protocol message over the streamable HTTP transport (2025-06-18, 2025-03-26): the [MCP server](/integrations/mcp-server)'s tools. JSON answer, or 202 for a notification; no session; an `Origin` other than the dashboard's is 403; at most 1 MiB |
| `GET`, `DELETE` | `/mcp` | none | 405: no event stream and no session |

## Compliance

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/compliance/frameworks` | `assets:read` | The framework mappings and how many controls each has |
| `GET` | `/compliance/frameworks/{id}` | `assets:read` | Assess one framework against this tenant's evidence |
| `GET` | `/compliance/frameworks/{id}/report` | `assets:read` | The same assessment as CSV or print-ready HTML |
| `GET` | `/compliance/evidence-packs` | `identity:read`, `assets:read`, `audit_export` plan feature | Stored evidence packs, newest first |
| `POST` | `/compliance/evidence-packs` | `identity:read`, `assets:read`, `audit_export` plan feature | Build, sign and store a pack for a framework and date range |
| `GET` | `/compliance/evidence-packs/{id}` | `identity:read`, `assets:read`, `audit_export` plan feature | One pack's record |
| `GET` | `/compliance/evidence-packs/{id}/download` | `identity:read`, `assets:read`, `audit_export` plan feature | `?format=json\|sig\|csv\|html` |

Frameworks: `soc2`, `iso27001`, `pci-dss`, `nist-ssdf`, `eu-cra`, `cert-in`, `rbi-csf`, `dpdp`, `hipaa`.
See [Evidence packs](/how-to/create-an-evidence-pack).

**No status is ever "compliant" or "pass."** A control is reported as evidence
present, evidence shows open issues, no data, or not covered by TRUSTIVAN. A test enforces that
vocabulary against the words "compliant", "pass", "certified",
"attested", "satisfied" and "met". A control is satisfied by an organisation's
practice, not by a tool's assertion.

Every framework also reports `controls_not_covered`, beside the total, because
a map listing only what a tool covers tells a reader their coverage is
complete. Listing the mappings discloses nothing tenant-specific, so it is
readable before you have any data.

## Audit export

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/audit/export` | `identity:read` | Stream the administrative audit trail as an auditor-ready package |

Requires the `audit_export` entitlement; a plan without it answers `402`.
Formats are `jsonl` (the default) and `csv`, bounded by `since`, `until` and
`max_rows`.

The response is **streamed rather than buffered**. A tenant's trail is
unbounded in time, and buffering one export would cost every other tenant the
memory.

Every row carries where it came from (`source_ip`, `user_agent`,
`request_id`) and its chain columns: `chain_seq`, `prev_hash`, `entry_hash` and
`chain_version`. The chain is tamper-evidence **within the database**: a row
changed, deleted or reordered there breaks verification at that position. The
export itself is not signed, so someone with full database access could
rewrite rows and recompute every later digest; an operator anchors the chains
outside the database with a signed
[`auditctl checkpoint`](/cli-reference/auditctl). The header's
`chain_head` records the position and digest at export time. Keep exports,
and a later one whose digest at that position differs shows history was
rewritten. The chain is verified before the stream opens and the result
appears in the header, with any tombstones beside it. A break **with** a
recorded erasure is a lawful deletion, a break **without** one is somebody
removing evidence, and the two are never collapsed into one status.

## Agents

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/agents` | `workloads:read` | The tenant's agents and their declared tools |
| `DELETE` | `/agents/{id}` | `workloads:manage` | Terminate an agent and close its sessions |
| `POST` | `/agents/{id}/quarantine` | `workloads:manage` | Suspend the agent's credential, reversibly |
| `DELETE` | `/agents/{id}/quarantine` | `workloads:manage` | Lift a quarantine. Only a human does this |
| `GET` | `/agents/{id}/capabilities` | `workloads:read` | What this agent may do |
| `GET` | `/agents/{id}/tools` | `workloads:read` | Its declared tools |
| `POST` | `/agents/{id}/tools` | `workloads:manage`, or the agent itself | Declare a tool |
| `DELETE` | `/agents/{id}/tools/{name}` | `workloads:manage` | Disable a tool |
| `GET` | `/agents/{id}/sessions` | `workloads:read` | Its sessions |
| `POST` | `/agents/{id}/sessions` | `workloads:manage`, or the agent itself | Open a session |
| `DELETE` | `/agents/{id}/sessions/{sessionId}` | `workloads:manage`, or the agent itself | End one |
| `GET` | `/agents/{id}/actions` | `workloads:read` | What it has asked to do |
| `POST` | `/agents/{id}/actions` | the agent itself | May I perform this action? |
| `POST` | `/agents/{id}/approvals` | `workloads:manage`, human only | Approve one irreversible action for the agent |
| `GET` | `/agents/{id}/signals` | `workloads:read` | Behavioural signals over its action history: observed, never enforced. See [AI agent security](/security/agents#observed-not-enforced-behavioural-signals) |

**There is no `POST /agents`.** An agent is a workload, created by
`POST /workloads` with `kind: "agent"`, the route that already returns the
credential exactly once and already refuses a machine caller. A second way to
mint a non-human principal would be a second place for the two to disagree
about what is grantable.

**There is no separate kill switch.** `DELETE /workloads/{id}` is it;
`DELETE /agents/{id}` calls the same revocation and additionally closes
sessions.

`POST /agents/{id}/actions` answers about the **calling** agent only, and `{id}`
must match the credential rather than the path. An endpoint answering about an
arbitrary agent would be an oracle for probing what other agents may do. It
returns `200` for every outcome including deny and quarantine, so the reasoning
survives an intermediary that treats a non-2xx as a transport failure.

Disabling a tool is deliberately **not** available to the agent itself, and an
agent may declare only a tool whose required permission its delegation grants.

A tool declared **irreversible** answers `step_up` until a human approves the
specific action: `POST /agents/{id}/approvals` with the tool, resource type and
resource ID (and a current authenticator code, if the approver has one) returns
a token the agent sends as `approval_token`. It is single-use, lapses after five
minutes, and fits only that agent, tool and resource. The agent cannot vouch
for a human itself: `human_present` is no longer read here, and
`POST /authz/decide` honours it only from a human caller.

## Scanner selection

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/settings/scanners` | `schedules:read` | The tenant's scanner selection per target kind |
| `PUT` | `/settings/scanners/{kind}` | `schedules:write` | Set the selection for one target kind |
| `DELETE` | `/settings/scanners/{kind}` | `schedules:write` | Return a target kind to the deployment default |

## Organization settings

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/settings/sla` | `policies:read` | Remediation targets, in days, per severity. A severity absent from `policy` has no target |
| `PUT` | `/settings/sla/{severity}` | human only | Set one: `{"days": N}`, where N is 1 to 1825. `critical`, `high`, `medium` or `low` |
| `DELETE` | `/settings/sla/{severity}` | human only | Remove one, back to no target (not to a default) |
| `GET` | `/settings/iac-severity-overrides` | `policies:read` | Misconfiguration rules this organization grades differently |
| `PUT` | `/settings/iac-severity-overrides/{rule_id}` | human only | Set the severity for one rule |
| `DELETE` | `/settings/iac-severity-overrides/{rule_id}` | human only | Return a rule to its default severity |
| `GET` | `/settings/secret-validity` | `findings:read` | Whether live secret validity checking is on |
| `PUT` | `/settings/secret-validity` | `organization:manage` | Turn it on or off: `{"enabled": true}`. `501` when the deployment does not offer it |

Setting a target, an override or the validity opt-in changes how every
finding in the organization is graded or what TRUSTIVAN does with your
repository's contents, so each needs a permission no API key can hold. See
[Risk scoring](/concepts/risk-scoring#sla-clocks),
[IaC scanning](/configuration/iac-scanning) and
[Secret scanning](/security/secret-scanning#validity-checking).

## Plan and entitlements

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/billing/entitlements` | authenticated | This organisation's plan, its features and current usage |
| `GET` | `/billing/plans` | authenticated | The plan catalogue |
| `POST` | `/billing/webhook` | provider signature | The billing provider's callback |
| `POST` | `/billing/checkout` | `organization:manage` | A hosted checkout URL for a plan. Mints a redirect; changes nothing |
| `POST` | `/billing/portal` | `organization:manage` | A URL into the provider's billing portal. Mints a redirect; changes nothing |

Read-mostly by design. `checkout` and `portal` are the two exceptions and they
still write nothing: each returns a short-lived URL at the payment provider,
and a plan changes only when that provider reports the purchase back over
`/billing/webhook` with a verified signature. Both are ungrantable to an API
key, and with `BILLING_PROVIDER=manual` (the default) they report that the
deployment does not sell.

## Enterprise identity

| Method | Path | Scope | Description |
|---|---|---|---|
| `GET` | `/identity/provider` | `identity:read` | The SSO configuration. Never the client secret |
| `PUT` | `/identity/provider` | owner only | Configure SAML or OIDC |
| `GET` | `/identity/mfa-policy` | `identity:read` | Whether every member must have a second factor |
| `PUT` | `/identity/mfa-policy` | owner only | Require (or stop requiring) a second factor for every member |
| `POST` | `/identity/provider/enabled` | owner only | Turn SSO sign-in on or off. Enforcement is the `enforced` field of `PUT /identity/provider` |
| `GET` | `/identity/domains` | `identity:read` | Claimed domains and their verification state |
| `POST` | `/identity/domains` | owner only | Claim a domain |
| `POST` | `/identity/domains/{id}/verify` | owner only | Prove the claim |
| `DELETE` | `/identity/domains/{id}` | owner only | Release a claim |
| `GET` | `/identity/groups` | `identity:read` | Directory groups seen in assertions, and what each grants |
| `PATCH` | `/identity/groups/{id}` | owner only | Map a group to a role. `owner` is not mappable |
| `GET` | `/identity/identities` | `identity:read` | Federated identities linked to this organisation |
| `DELETE` | `/identity/identities/{id}` | owner only | Unlink one |
| `GET` | `/identity/scim-tokens` | `identity:read` | Issued SCIM tokens, without their secrets |
| `POST` | `/identity/scim-tokens` | owner only | Issue one. The response carries the token, once |
| `DELETE` | `/identity/scim-tokens/{id}` | owner only | Revoke one |
| `GET` | `/identity/audit` | `identity:read` | The administrative identity trail, newest first; filter with `actor`, `action`, `since`, `until` |
| `POST` | `/auth/sso/start` | none | Begin an SSO sign-in. The dashboard sign-in page calls it from "Sign in with SSO" |
| `POST` | `/auth/sso/saml/acs` | none | SAML assertion consumer |
| `GET` | `/auth/sso/oidc/callback` | none | OIDC callback |

A directory group grants nothing until an owner maps it: a group
appears with a null role and stays inert. `owner` is unmappable, enforced by a
database constraint. Ownership must not be reachable from a change in somebody
else's directory.

## Routes that do not exist

Worth stating, because their absence is a design decision rather than an
omission:

- No general-purpose API client. The CI story is `curl` against a scoped key,
  or the [`trustivan`](/cli-reference/trustivan) gate that wraps exactly that
  loop. `trustivan mcp` offers an AI assistant 16 tools over existing routes.
  None of them adds a route.
- No cluster *scan* target. Misconfiguration scanning reads the files in a
  repository target ([IaC scanning](/configuration/iac-scanning)); a cluster is
  connected instead: `POST /api/v1/kubernetes/clusters` records what runs there
  and each collection checks its workloads, namespaces and RBAC
  ([Kubernetes posture](/configuration/kubernetes-posture)),
  and `POST /api/v1/cloud/accounts` reads an AWS, Azure or Google Cloud account
  read-only.
- No mail without a relay. With SMTP configured, invitations, verification,
  password reset and alerts are mailed; without it, an invitation issues a
  token and delivering it is yours to do. See
  [Send mail through your SMTP relay](/how-to/configure-smtp).
- No push-triggered scanning. `POST /github/webhook` verifies a `push`
  delivery's signature, acknowledges and stops. A `pull_request` delivery is
  different once the installation is linked and checks are on for the
  repository: it records a [pull request check](/integrations/pull-request-checks).
- No price is published. Checkout and the billing portal exist, but a plan's
  price lives in the payment provider's catalogue and none has been set up for
  this service; with `BILLING_PROVIDER=manual`, the default, nothing in the
  product can charge anyone at all.

An unrecognised path returns `404` with the standard envelope.
