Publish a scan as a public artifact
POST
/projects/{projectId}/scans/{scanId}/publish
const url = 'https://zkao.io/api/v1/projects/example/scans/example/publish';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"withPassword":true}'};
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/scans/example/publish \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "withPassword": true }'Requires scope: publish. The scan must be COMPLETED.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”projectId
required
string
scanId
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
withPassword
Generate a password to gate access to the public artifact.
boolean
Examplegenerated
{ "withPassword": true}Responses
Section titled “ Responses ”OK
Media typeapplication/json
object
artifactId
required
string
publicId
required
Slug in /public/{scans,findings}/
string
accessPassword
The generated access password when withPassword was requested; otherwise null.
string | null
Examplegenerated
{ "artifactId": "example", "publicId": "example", "accessPassword": "example"}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}Missing, malformed, expired, or revoked token
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}The token lacks the required scope
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}Resource not in this token’s project or repo allowlist
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}
