Cloud API Reference

The HAVOC Cloud REST API uploads scan results from your own CI, reads back scans and findings, and manages teams and repositories. This page lists every endpoint the service has — nothing more.

Base URL: https://havoc.cloud/api/v1
HTTPS only. Requests and responses are JSON; send Accept: application/json so validation errors come back as JSON rather than a redirect.

Authentication

Every endpoint except the plans list and the two login endpoints needs a Laravel Sanctum personal access token, sent as a bearer token:

Authorization: Bearer 17|LqW3n0pX8s4VtB1cYgZ6hJ2kR9mD5fA7eN0uQ3iT

A Sanctum token is two parts joined by a pipe — the token's numeric id, then the secret. Send the whole string, pipe included. Create one in the dashboard under API Keys; the value is shown once, at creation, and cannot be retrieved afterwards. Revoking a key there takes effect immediately.

A token belongs to a user, not to a team, and can reach exactly the teams that user is a member of. There is no separate organisation credential.

Key access

When you create a key you choose what it may do. Full access can do anything your account can. CI upload only can do exactly one thing — upload scan results — which is what makes it safe to store in a third-party CI secret store: it cannot read your findings and cannot spend AI credits.

AbilityAllows
scans:ingestUpload scan results produced by your own CI
scans:readList and view scans and their findings
scans:writeAsk HAVOC to scan a connected repository
repositories:readList repositories
repositories:writeAdd and remove repositories
teams:readRead teams and members
teams:writeCreate teams and invite members
ai:useAI triage, auto-fix and exploit tests

A Full access key holds Sanctum's * wildcard rather than a list of the eight, so it keeps working when a new ability is added. Keys created before this choice existed hold the same wildcard and keep working unchanged.

A token missing the ability an endpoint requires is refused with 403, whatever its owner's permissions are.

Every endpoint

This is the whole API. Any token means a valid token with no particular ability; Public means no token at all.

MethodPathRequires
POST/api/v1/auth/loginPublic
POST/api/v1/auth/githubPublic
GET/api/v1/userAny token
DELETE/api/v1/auth/tokenAny token
POST/api/v1/scans/ingestscans:ingest
GET/api/v1/repositories/{repository}/scansscans:read
POST/api/v1/repositories/{repository}/scansscans:write
GET/api/v1/scans/{scan}scans:read
GET/api/v1/scans/{scan}/findingsscans:read
GET/api/v1/teams/{team}/repositoriesrepositories:read
POST/api/v1/teams/{team}/repositoriesrepositories:write
DELETE/api/v1/teams/{team}/repositories/{repository}repositories:write
GET/api/v1/teamsteams:read
GET/api/v1/teams/{team}teams:read
GET/api/v1/teams/{team}/membersteams:read
POST/api/v1/teamsteams:write
POST/api/v1/teams/{team}/invitationsteams:write
POST/api/v1/findings/{finding}/ai/triageai:use
PATCH/api/v1/findings/{finding}/ai/triage/overrideai:use
POST/api/v1/findings/{finding}/ai/auto-fixai:use
POST/api/v1/findings/{finding}/ai/exploit-testai:use
GET/api/v1/findings/{finding}/ai/exploit-test/downloadai:use
POST/api/v1/findings/{finding}/ai/exploit-test/verifyai:use
GET/api/v1/teams/{team}/ai/usageai:use
GET/api/plansPublic

Tokens from the API

Keys made in the dashboard are the normal route. These two endpoints exist so a program can mint a token of its own; both are throttled to 10 requests per minute per IP, and both issue a full access token.

Log in with email and password

POST/api/v1/auth/login
# Request body (JSON)
{
  "email": "dev@acme.test",
  "password": "...",
  "device_name": "release-runner"
}

# 200
{
  "token": "17|LqW3n0pX8s4VtB1cYgZ6hJ2kR9mD5fA7eN0uQ3iT",
  "user": { "id": 4, "name": "Dana", "email": "dev@acme.test", "avatar_url": null, "github_connected": true, "created_at": "..." }
}

Bad credentials return 422, not 401: the failure is reported as a validation error on email.

Exchange a GitHub token

POST/api/v1/auth/github

Takes github_token and device_name and returns the same body as above, creating the HAVOC account on first use. An invalid GitHub token returns 401.

Who am I

GET/api/v1/user

Returns the token owner. No ability is required: every token, however narrow, can identify itself.

Revoke the current token

DELETE/api/v1/auth/token

Deletes the token used to make the call and returns a message. Also needs no ability — a token can always revoke itself. It does not touch your other keys.

Upload scan results from CI

POST/api/v1/scans/ingest

For a scan that already ran in your own CI — this is what the CLI and the GitHub Action use when you give them an API key. Requires the scans:ingest ability. The repository is identified by its GitHub id rather than an internal one, and is created on first upload, so no dashboard setup is needed beyond adding the secret.

Re-uploading the same commit_sha updates that scan rather than creating a second one: a workflow re-run, a job matrix and a retried flake are all the same scan of the same code, and the team is billed once. The previous upload's findings are replaced, not added to.

Severity counts, totals and the grade are not accepted: they are computed from the findings actually stored, so the summary can never disagree with the rows behind it. A single upload may carry at most 2,000 findings.

If you belong to exactly one team, you never need team_id. Send it if you belong to several: the same GitHub repository can exist under more than one of your teams, and team_id is what picks one — both when filing a repository seen for the first time and when choosing between copies that already exist. Rather than guess, an upload that is ambiguous is refused with a 422 that names your team ids, so nothing is filed under the wrong team or billed to it.

# Request body (JSON)
{
  "repository": {
    "github_id": "987654",
    "full_name": "acme/storefront",
    "default_branch": "main"
  },
  "team_id": 3,
  "commit_sha": "a1b2c3d4e5f6a7b8c9d0a1b2c3d4e5f6a7b8c9d0",
  "branch": "main",
  "pr_number": 42,
  "pr_head_sha": "b2c3d4e5f6a7b8c9d0a1b2c3d4e5f6a7b8c9d0a1",
  "scanner_version": "0.4.1",
  "result": {
    "findings": [
      {
        "analyzer": "MassAssignmentAnalyzer",
        "severity": "critical",
        "title": "Unguarded model",
        "description": "The model declares no $fillable.",
        "file": "app/Models/Order.php",
        "line": 12,
        "recommendation": "Add a $fillable list.",
        "cwe": "CWE-915"
      }
    ],
    "authorizationCoverage": { "coveredActions": 132, "totalActions": 147 },
    "metadata": {}
  }
}
FieldRequiredNotes
repository.github_idyesA rename keeps the id and changes the name, so history survives a rename
repository.full_nameyesowner/name; refreshed on every upload
repository.default_branchnoDefaults to branch when the repository is created
team_idnoWhich of your teams this upload belongs to. Read on every upload — see below
commit_shayesFull 40-character hex SHA, not an abbreviation. This is the dedupe key
branchyes
pr_numberno
pr_head_shanoFull 40-character hex SHA
scanner_versionyes
result.findingsyesMay be empty, but must be present. Max 2,000
result.findings[].severityyesOne of critical, high, medium, low, info
result.authorizationCoveragenocoveredActions and totalActions as counts, not a percentage
result.metadatanoOnly metadata.degraded is read, and only if it is an object; it becomes the scan's degraded field. Any other key under metadata is accepted and discarded

Fields other than these are ignored rather than rejected, so a newer CLI can send more without breaking against an older server.

Responses

StatusMeaning
201Stored. The body is the scan, in the shape shown under Scans, with trigger_type: "ci" and status: "completed"
402The team's monthly scan allowance is spent. The scan itself is unaffected — only the upload was declined. Re-uploading a commit already stored never hits this
403The token lacks scans:ingest, or the team_id given is not a team you belong to
409Another upload of this same commit is still being written. Retry
422Invalid payload, or the repository cannot be placed: your account has no team, or belongs to several and no team_id was sent, or this repository exists in more than one of your teams. The message names the remedy
Uploads never fail your build. The scan has already decided whether your build passes before the upload is attempted, so the CLI treats every refusal here as a warning and exits zero. These status codes are for humans reading CI logs.

Scans and findings

List a repository's scans

GET/api/v1/repositories/{repository}/scans

Newest first, 20 per page. The page size is fixed; there is no per_page parameter. Pass ?page=2 for the next page, or follow the links in the response. There are no filter parameters — the repository in the path is the only selector.

curl -H "Authorization: Bearer 17|LqW3..." \
  "https://havoc.cloud/api/v1/repositories/41/scans?page=2"

The body is a Laravel paginated collection: data (an array of scans), plus links and meta with current_page, last_page and total.

Get one scan

GET/api/v1/scans/{scan}

Returns the scan with its findings loaded, under a data key.

{
  "data": {
    "id": 9182,
    "repository_id": 41,
    "commit_sha": "a1b2c3d4e5f6a7b8c9d0a1b2c3d4e5f6a7b8c9d0",
    "branch": "feature/bulk-transactions",
    "trigger_type": "ci",
    "status": "completed",
    "pr_number": 42,
    "total_findings": 3,
    "critical_count": 0,
    "high_count": 1,
    "medium_count": 1,
    "low_count": 1,
    "info_count": 0,
    "authorization_coverage": "89.80",
    "covered_actions": 132,
    "total_actions": 147,
    "coverage_state": "full",
    "degraded": null,
    "started_at": "2026-03-05T04:12:33+00:00",
    "completed_at": "2026-03-05T04:12:51+00:00",
    "duration_seconds": 18,
    "created_at": "2026-03-05T04:12:30+00:00",
    "findings": [ ... ]
  }
}
FieldNotes
statusqueued, running, completed or failed
trigger_typemanual, pr, push, scheduled or ci. ci means the result was uploaded to the ingest endpoint
authorization_coverageA percentage, serialised as a string with two decimals. null when the scan measured none
covered_actions / total_actionsThe counts behind that percentage, so you can render 132/147 and re-aggregate across repositories without averaging percentages
coverage_statefull, reduced, or not_reported for a scan that predates the field. Tells “this scan lost nothing” apart from “this scan said nothing”
degradedWhere coverage was lost — a parse failure, an unreadable directory — or null. If this is set, total_findings is not a complete count of the repository
error_messagePresent only when status is failed
Read coverage_state before you gate on counts. A scan whose coverage was reduced still reports total_findings, and that number is a count of what was looked at, not of what exists.

List a scan's findings

GET/api/v1/scans/{scan}/findings

Ordered critical first, then high, medium, low, info. 50 per page, again fixed, again paged with ?page=. Returns data, links and meta.

{
  "data": [
    {
      "id": 55012,
      "scan_id": 9182,
      "fingerprint": "7f1c...",
      "analyzer": "MassAssignmentAnalyzer",
      "severity": "high",
      "title": "Unguarded model",
      "description": "The model declares no $fillable.",
      "file": "app/Models/Order.php",
      "line": 12,
      "recommendation": "Add a $fillable list.",
      "cwe": "CWE-915",
      "status": "open",
      "is_new": true,
      "created_at": "2026-03-05T04:12:51+00:00"
    }
  ]
}

fingerprint is a hash of four things: the analyzer, the file, the line and the title. Two reports of the same issue at the same line in the same file match; move the code down a line and the fingerprint changes.

is_new is measured against the repository's baseline, not against the previous scan. A finding is marked new when its fingerprint is absent from the repository's most recent baseline — so a repository with no baseline yet has every finding of every scan marked is_new: true. Read it as “not in the baseline”, never as “appeared since last time”.

There is no endpoint for listing findings across scans, and none for changing a finding's status — dismissing and resolving happen in the dashboard.

Ask HAVOC to run a scan

POST/api/v1/repositories/{repository}/scans

The opposite direction to the ingest endpoint: this one asks the service to clone and scan a repository itself, so it only works on a repository that is connected — one HAVOC holds credentials for. Both fields are optional; branch falls back to the repository's default branch.

# Request body (JSON)
{
  "commit_sha": "a1b2c3d4e5f6a7b8c9d0a1b2c3d4e5f6a7b8c9d0",
  "branch": "main"
}

Returns 202 with the queued scan under data — status: "queued", trigger_type: "manual" — and the work happens on a queue; poll GET /api/v1/scans/{scan} for the result. A repository that is not connected returns 422; a spent monthly allowance returns 402 with an upgrade_url.

Repositories

List a team's repositories

GET/api/v1/teams/{team}/repositories

Every repository in the team, ordered by full name, as a JSON array — not paginated. Each entry carries id, team_id, github_id, name, full_name, default_branch, connected and created_at.

Add a repository

POST/api/v1/teams/{team}/repositories

Team admins only. Takes github_id, name, full_name and an optional default_branch, and returns 201 with the repository. github_id must be unique within the team. Over the plan's repository limit returns 402 with an upgrade_url.

You do not need this to upload from CI — the ingest endpoint creates the repository on first upload.

Remove a repository

DELETE/api/v1/teams/{team}/repositories/{repository}

Team admins only. Returns a message. This deletes the repository record and its scan history.

Teams

List your teams

GET/api/v1/teams

A JSON array of the teams the token's owner belongs to, each with id, name, slug, owner_id, created_at, members_count and repositories_count. Not paginated.

Get one team

GET/api/v1/teams/{team}

The same object for a single team.

List team members

GET/api/v1/teams/{team}/members

A JSON array of members with id, name, email, avatar_url, role and joined_at.

Create a team

POST/api/v1/teams

Takes name. Returns 201 with the new team, owned by the token's owner.

Invite a member

POST/api/v1/teams/{team}/invitations

Team admins only. Takes email, sends the invitation, and returns 201 with a message and the invitation's id, email and role.

AI features

The dashboard's AI tools over the API. Every endpoint here requires ai:use, which is why a CI upload key cannot reach them — but they do not all cost the same, and only three of them call a model at all.

EndpointSpends AI allowanceCan return
TriageYes, one call429 over today's allowance, 503 if the provider is unreachable
Auto-fixYes, one call429, 503, plus 422 and 502 below
Generate exploit testYes, one call429, 503
Override triageNo — it records your decision and calls no modelNeither 429 nor 503
Download exploit testNo — it returns code already generated404 only
Verify exploit testOnly indirectly, on the queue — see belowNeither, synchronously
AI usageNo — read-onlyNeither

Where 503 is returned the body carries both an error and a fallback describing what to do by hand. The allowance is a daily count per team.

Triage a finding

POST/api/v1/findings/{finding}/ai/triage

Returns ai_classification, ai_confidence, ai_triage_reasoning and ai_triaged_at.

Override a triage result

PATCH/api/v1/findings/{finding}/ai/triage/override

Takes classification: true_positive, false_positive or needs_review. Returns ai_triage_override and the effective_classification — your override wins over the model's.

Generate an auto-fix pull request

POST/api/v1/findings/{finding}/ai/auto-fix

Opens a pull request on your repository and returns auto_fix_pr_url, auto_fix_attempts and auto_fix_pr_created_at. Needs a connected GitHub account on the token's owner. A finding type auto-fix does not support, or a missing GitHub connection, returns 422; a GitHub-side failure returns 502.

Generate an exploit test

POST/api/v1/findings/{finding}/ai/exploit-test

Returns exploit_test_code, exploit_test_generated_at, a suggested download_filename and exploit_verified_status.

Download an exploit test

GET/api/v1/findings/{finding}/ai/exploit-test/download

The generated test as a text/plain attachment. 404 if none has been generated.

Re-run verification of an exploit test

POST/api/v1/findings/{finding}/ai/exploit-test/verify

Queues verification and returns 202 with exploit_verified_status as it stands; the result is written asynchronously, so poll the finding rather than reading the response as an outcome. Where verification is unavailable for that finding it returns 200 and a message saying so, rather than an error.

The queued run may regenerate the exploit test once, which does spend one AI call — but only after a first attempt that errored without timing out, and only if the team is not already at its daily allowance. A run that passes, fails cleanly or times out regenerates nothing. None of that can reach you as a 429 or 503 on this request, because it happens after the response.

AI usage for a team

GET/api/v1/teams/{team}/ai/usage

A usage summary plus remaining_requests_today and the team's plan. Takes an optional days (1–365, default 30).

Plans

GET/api/plans

The public pricing data behind the pricing page. No token, and no /v1 — this one sits outside the versioned prefix. Returns the active plans with their limits; a limit of null means unlimited.

Errors and limits

Errors are JSON. Most carry a message; validation failures add an errors object keyed by field; the AI endpoints and the rate limiter use error instead.

StatusWhen
401Missing, malformed or revoked token
402A plan limit: monthly scans, or repositories. Where the refusal comes from a dashboard action the body also carries an upgrade_url
403The token lacks the required ability, or the account cannot see that team, repository or finding, or is not an admin of the team
404No such record — or one you cannot see
409Ingest only: a concurrent upload of the same commit
422Validation failed, or the request cannot be carried out as asked — a disconnected repository, an unresolvable team, an unsupported auto-fix
429Per-minute rate limit, or the daily AI allowance
502GitHub rejected an action taken on your behalf
503The AI provider was unavailable. The body says what to do instead

Rate limits

Authenticated requests are limited per minute, per user, by the plan of the team they belong to. Every response carries X-RateLimit-Limit and X-RateLimit-Remaining; a 429 adds Retry-After and a retry_after in seconds — read your own limit from the header rather than from the table below.

If you belong to more than one team, which of their plans sets your limit is not currently defined — unlike an upload, which refuses to guess and asks for team_id. Assume the least generous of them.

PlanRequests per minute
Free30
Solo60
Team120
Business300
Enterprise600

An account on no team gets 30. The two login endpoints are limited separately, to 10 requests per minute per IP, before any token exists.

Something missing? This page is the whole API as it stands today. If you need an endpoint that is not here, write to support@havoc.cloud and tell us what you are building.