Pipelines
11 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.
Pipeline runs, newest first#
GET
Parameters/v1/pipelines/runsscope sandboxes:readstatequery · string—
limitquery · integer—
200401403
curl -s -X GET https://api.kosa8.com/v1/pipelines/runs \ -H "Authorization: Bearer $KOSA8_API_KEY"
Run a repository's .kosa8/pipeline.yml, or its .github/workflows through act#
POST
/v1/pipelines/runsscope sandboxes:writeEach job runs in a sized sandbox made as this organization, billed and limited as any sandbox. See docs/guides/cloud-pipelines.
JSON bodyrepo_urlrequiredstringhttps:// clone URL, no credentials, such as https://github.com/acme/app.git
refstringBranch, tag, SHA or refs/… (default main)
event"push" | "pull_request" | "workflow_dispatch" | "schedule"Default workflow_dispatch
workflowstringact runs: one file in .github/workflows (default all)
jobstringact runs: one job id
inputsobjectworkflow_dispatch inputs
sizestringact runs: the sandbox size (default 4x8). Native runs size each job in the file
secretsarray of stringkosa8 secret names (each made with pipelines: true); a job gets each as NAME_IN_CAPS
token_secretstringA secret holding a token that can read the repository (private repositories)
status_secretstringA secret holding a GitHub token with commit status write: the run sets kosa8/pipelines on the commit
timeout_sintegerDefault 3600 Min 60. Max 21600.
201400401403404429
curl -s -X POST https://api.kosa8.com/v1/pipelines/runs \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
A run and its jobs (a live run's jobs are read first)#
GET
Parameters/v1/pipelines/runs/{id}scope sandboxes:readidrequiredpath · stringPipeline run id (prun_…)
200401403404
curl -s -X GET https://api.kosa8.com/v1/pipelines/runs/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"
A run's logs by job, secrets replaced with ***#
GET
Parameters/v1/pipelines/runs/{id}/logsscope sandboxes:readidrequiredpath · stringPipeline run id (prun_…)
jobquery · string—
afterquery · integerOnly chunks after this one (next from the last call)
200401403404
curl -s -X GET https://api.kosa8.com/v1/pipelines/runs/$SBX/logs \ -H "Authorization: Bearer $KOSA8_API_KEY"
Cancel a run: its sandboxes are deleted#
POST
Parameters/v1/pipelines/runs/{id}/cancelscope sandboxes:writeidrequiredpath · stringPipeline run id (prun_…)
200401403404
curl -s -X POST https://api.kosa8.com/v1/pipelines/runs/$SBX/cancel \ -H "Authorization: Bearer $KOSA8_API_KEY"
Files a native job kept (artifacts:)#
GET
Parameters/v1/pipelines/runs/{id}/artifactsscope sandboxes:readidrequiredpath · stringPipeline run id (prun_…)
200401403404
curl -s -X GET https://api.kosa8.com/v1/pipelines/runs/$SBX/artifacts \ -H "Authorization: Bearer $KOSA8_API_KEY"
Download an artifact as .tar.gz#
GET
Parameters/v1/pipelines/runs/{id}/artifacts/{job}/{idx}scope sandboxes:readidrequiredpath · stringPipeline run id (prun_…)
jobrequiredpath · stringJob name
idxrequiredpath · stringThe artifact's index in the job's artifacts:
200401403404
curl -s -X GET https://api.kosa8.com/v1/pipelines/runs/$SBX/artifacts/$JOB/$IDX \ -H "Authorization: Bearer $KOSA8_API_KEY"
Webhook and schedule triggers (no secrets)#
GET
Responses/v1/pipelines/hooksscope sandboxes:read200401403
curl -s -X GET https://api.kosa8.com/v1/pipelines/hooks \ -H "Authorization: Bearer $KOSA8_API_KEY"
Make a webhook URL for a repository's pushes and pull requests, and optionally a cron schedule#
POST
JSON body/v1/pipelines/hooksscope adminrepo_urlrequiredstring—
provider"github" | "gitlab"Default from repo_url's host
namestring—
secretstringDefault: one is made and returned once
sizestring—
secretsarray of stringkosa8 secret names (each made with pipelines: true); a job gets each as NAME_IN_CAPS
token_secretstring—
status_secretstring—
workflowstring—
timeout_sintegerMin 60. Max 21600.
cronstringm h dom mon dow (UTC): also run on this schedule
cron_refstringThe branch scheduled runs use (default main)
201400401403404409
curl -s -X POST https://api.kosa8.com/v1/pipelines/hooks \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
A git host's webhook delivery (no API key: GitHub's X-Hub-Signature-256 or GitLab's X-Gitlab-Token)#
POST
/v1/pipelines/hooks/{id}publicGitHub: push, pull_request (opened, synchronize, reopened) and ping. GitLab: Push Hook. Deliveries are deduplicated by X-GitHub-Delivery.
Parametersidrequiredpath · stringHook id (phk_…)
200202400401404
curl -s -X POST https://api.kosa8.com/v1/pipelines/hooks/$SBX \ -H 'Content-Type: application/json' -d @body.json
Delete a hook; its URL stops working#
DELETE
Parameters/v1/pipelines/hooks/{id}scope adminidrequiredpath · stringHook id (phk_…)
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/pipelines/hooks/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"