Publish a finding as a public artifact
const url = 'https://zkao.io/api/v1/projects/example/findings/example/publish';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"noteId":"example","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/findings/example/publish \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "noteId": "example", "withPassword": true }'Requires scope: publish. Pin a note as the published note via noteId.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The finding id, or the ZK- label shown on the finding page (the id’s last eight characters, prefix optional). A label that matches more than one finding in the project is refused with 409 conflict; use the full id.
Request Body
Section titled “Request Body”object
A note id on the finding to pin as the published note.
Generate a password to gate access to the public artifact.
Examplegenerated
{ "noteId": "example", "withPassword": true}Responses
Section titled “ Responses ”OK
object
Slug in /public/{scans,findings}/
The generated access password when withPassword was requested; otherwise null.
Examplegenerated
{ "artifactId": "example", "publicId": "example", "accessPassword": "example"}Invalid request
object
object
Example
{ "error": { "code": "unauthorized" }}Missing, malformed, expired, or revoked token
object
object
Example
{ "error": { "code": "unauthorized" }}The token lacks the required scope
object
object
Example
{ "error": { "code": "unauthorized" }}Resource not in this token’s project or repo allowlist
object
object
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
Example
{ "error": { "code": "unauthorized" }}
