Versions API
Upload source code, stream build logs, retry failed builds, cancel, and withdraw versions. All endpoints require authentication.
POST
/api/v1/apps/:slug/versions
Upload a new version. Multipart form request (multipart/form-data, max 500 MB).
On success, a build job is queued — stream progress with the build_log endpoint.
| Field | Required | Description |
|---|---|---|
| kyper_yml | Yes | Raw YAML content of your kyper.yml |
| source_zip | No | Zip archive of your project source code (omit when using GitHub App) |
curl -X POST https://kyper.shop/api/v1/apps/invoice-hero/versions \ -H "Authorization: Bearer kpr_..." \ -F "[email protected]" \ -F "[email protected]"
{
"id": 42,
"app": "invoice-hero",
"version": "1.3.0",
"status": "pending",
"build_url": "https://kyper.shop/builds/a1b2c3d4...",
"submission_url": "https://kyper.shop/developer/apps/invoice-hero/versions/42/submission",
"message": "Build queued. Check status with: kyper push status"
}
id is used by the build_log, retry, cancel, and withdraw endpoints.
If the same version string already exists in build_failed or rejected state, it is automatically replaced.
Returns 400 for missing YAML, 409 if a build is already in progress, 422 for validation errors.
GET
/api/v1/versions/:id/build_log
Cursor-based build log streaming. Pass cursor (byte offset, default 0) to receive only new output.
Poll every 2 seconds until complete: true.
curl -H "Authorization: Bearer kpr_..." \ "https://kyper.shop/api/v1/versions/42/build_log?cursor=0"
// While building:
{"status": "building", "log": "[build] Step 3/12 : COPY ...\n", "cursor": 1847, "complete": false}
// When done:
{"status": "in_review", "log": "[scan] Trivy scan passed\n", "cursor": 4523, "complete": true}
Stop polling when complete: true. Use the returned cursor value on the next request.
POST
/api/v1/versions/:id/retry
Retry a failed build. Version must be in build_failed state.
Re-runs Docker build + Trivy scan from scratch with the same source archive.
curl -X POST https://kyper.shop/api/v1/versions/42/retry \ -H "Authorization: Bearer kpr_..."
Returns {"id": 42, "message": "Build retry queued"}. Returns 422 if not in build_failed state.
POST
/api/v1/versions/:id/cancel
Cancel a pending or building version.
The build worker checks for cancellation between steps. Cannot cancel a finished build.
curl -X POST https://kyper.shop/api/v1/versions/42/cancel \ -H "Authorization: Bearer kpr_..."
Returns {"id": 42, "message": "Build cancelled"}. Returns 422 if the version is not pending or building.
DELETE
/api/v1/versions/:id
Withdraw (delete) a version permanently. Cleans up the container image if one was built.
Cannot withdraw published or building versions.
All other states (pending, build_failed, in_review, rejected) are withdrawable.
curl -X DELETE https://kyper.shop/api/v1/versions/42 \ -H "Authorization: Bearer kpr_..."
Returns {"message": "Version 1.3.0 withdrawn"}. Returns 422 if published or building.
Version status lifecycle
| Status | Description | Allowed actions |
|---|---|---|
| pending | Queued for build | cancel, withdraw |
| building | Docker build + Trivy scan in progress | cancel |
| build_failed | Build or scan failed | retry, withdraw |
| in_review | Awaiting manual review by Kyper team | withdraw |
| published | Approved and live on the marketplace | none |
| rejected | Rejected by reviewer (check review_notes) | withdraw |