Prepare a branch's next Continuous Security analysis
const url = 'https://zkao.io/api/v1/projects/example/repositories/example/continuous-testing/prepare';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"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/continuous-testing/prepare \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "example" }'Requires scope: automations:write. Plans the branch’s next analysis without running it. It works whether automatic analysis is on or off. Preparing spends no credits. A preparation already in progress on the branch is reused. When nothing has changed since the plan was last prepared, the branch’s conversation with zkao says so and the plan stays as it is. Responds 400 when the branch does not exist or has no active Continuous Security, and 409 while the repository is still being prepared.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "branch": "example"}Responses
Section titled “ Responses ”OK
object
Example
{ "preparing": true}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" }}