File a vulnerability report against a repository
const url = 'https://zkao.io/api/v1/projects/example/repositories/example/reports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"example","body":"example","claimedSeverity":"CRITICAL","reporter":{"name":"example","email":"example","githubLogin":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://zkao.io/api/v1/projects/example/repositories/example/reports \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "example", "body": "example", "claimedSeverity": "CRITICAL", "reporter": { "name": "example", "email": "example", "githubLogin": "example" } }'Requires scope: reports:write. Files a report into this project’s security programme for an active repository belonging to the project. GitHub private-report intake setup and repository admin access are not required. The report arrives as prose and is read and split into claims by the same step as an imported GitHub report.
Returns with intakeState: PENDING. investigateReport refuses a report until that reaches COMPLETE, so poll /projects/{projectId}/reports before asking for an investigation.
Idempotent on content: the same title and body against the same repository name the same report, so a retried call returns the original with 200 rather than filing a second copy.
Free. The reading that follows is charged to the project, and the investigation is charged when someone asks for it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
One line naming the flaw.
What the flaw is, how to reach it, and what it costs. Prose: this is read and split into claims, so write it for a reader rather than as fields. Anything past the limit would be stored and never read.
What the reporter claims, which is not an assessment. It decides how closely the report is read, so an inflated claim costs the programme more.
Who found it, all self-asserted. Used for attribution on the advisory, never for authorization.
object
Responses
Section titled “ Responses ”Already filed, by an identical earlier call
object
The identifier investigateReport takes.
Always PENDING here. The report is queued to be read and split into claims, and an investigation waits for COMPLETE.
Examplegenerated
{ "publicId": "example", "intakeState": "example"}Filed
object
The identifier investigateReport takes.
Always PENDING here. The report is queued to be read and split into claims, and an investigation waits for COMPLETE.
Examplegenerated
{ "publicId": "example", "intakeState": "example"}Invalid request
object
object
Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.
Example
{ "error": { "code": "unauthorized" }}Missing, malformed, expired, or revoked token
object
object
Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.
Example
{ "error": { "code": "unauthorized" }}The token lacks the required scope
object
object
Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.
Example
{ "error": { "code": "unauthorized" }}Resource not in this token’s project or repo allowlist
object
object
Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.
Example
{ "error": { "code": "unauthorized" }}A compare-and-set (expectedContent) missed: the guidance changed since it was read. Re-read the current guidance and retry.
object
object
Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.
Example
{ "error": { "code": "unauthorized" }}Rate limited. Either the token’s spend limit for the current period is reached (on launch), or the token is sending too many requests. Wait the number of seconds in the Retry-After header before retrying.
object
object
Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Seconds to wait before retrying.
