Previews
A preview is a copy of a cube, built from the head commit of an open pull request and served at its own address. Previews follow the cube's tracked branch: the pull requests into it from a branch of the same repository get previews. A pull request from a fork gets none.
Endpoints
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previewsGETGet the preview settings of a cube/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ settingsPUTTurn previews on or off for a cube/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ settingsGETGet a preview/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}DELETERemove a preview/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}POSTBuild a preview again/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ redeployGETStream the logs of a preview/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ logsGETStream the logs of a preview build/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ builds/ {build-id}/ logsGETStream the logs of a preview deployment/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ deployments/ {deployment-id}/ logsRead the preview settings first. enabled says whether previews are on. available says whether they can be turned on, and when they can't, reason says why: a cube made from a link has no previews, because Cubecen does not see its pull requests. Turn them on with a Full key:
curl -sS -X PUT "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/settings" \
-H "Authorization: Bearer $CUBECEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'Open pull requests get their previews within about 10 minutes. New pull requests and pushes get theirs within seconds. Turning previews on needs a plan that has them, else the answer is 402 with PLAN_LIMIT_REACHED. Turning them off is always allowed. It closes every preview of the cube.
List the previews to see them: the open ones first, then those closed in the last seven days. A preview's status says where it is. While it is pending, waiting, building or deploying, read the list every 10 seconds. When it is ready, it is served at url. A push builds the new head, and the previous version keeps serving at the same address meanwhile. limits.max_open is how many previews a cube can have open at once.
The logs of a preview work like the logs of a cube, a build and a deployment. Take a build's ID and a deployment's ID from the preview's release. To build a preview's head again, redeploy it. To close one until the next push to its pull request, remove it.
List the previews of a cube
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previewsReturns the pull request previews of a cube: the open ones first, then those closed in the last seven days, the most recently updated first, at most 50. It needs only read access. The list is not paged. Pull requests into the branch the cube deploys from get previews when their branch is in the same repository; a pull request from a fork gets none.
A preview is a copy of the cube, built from the head commit of a pull request into the cube's tracked branch and served at its own address. limits.max_open is how many previews a cube can have open at once, and limits.idle_days is how many days without a push make Cubecen remove a preview. For each preview, status says where it is, release is its newest build and the deployment that follows it (their IDs open its logs), and error explains a wait or a failure.
The list is empty when the cube has no previews. Turn previews on with updatePreviewSettings. While a preview is pending, waiting, building or deploying, read the list every 10 seconds.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
Responses
| Status | Description |
|---|---|
| 200 | The previews of the cube, and the limits that apply to them. PreviewList object2 fieldsdataarray of objectrequiredThe previews. data items13 fieldsidstringrequiredThe preview's ID. pull_requestobjectrequiredThe pull request that the preview builds. pull_request object9 fieldsnumberintegerrequiredThe pull request's number. titlestringrequiredThe pull request's title. authorstringrequiredThe GitHub login that opened it. urlstringrequiredIts page on GitHub. Empty until Cubecen has read the pull request. head_refstringrequiredThe branch it comes from. base_refstringrequiredThe branch it targets: the cube's tracked branch. head_shastring | nullrequiredThe newest head commit that Cubecen knows of. It is ahead of head_received_atstring | nullrequiredWhen Cubecen learned of draftbooleanrequired
statusstringrequired
One of: urlstring | nullrequiredWhere the preview is served, once it has served, until it closes. Its last successful deployment keeps serving while a newer build is on its way or has failed. releaseobject | nullrequiredThe preview's newest build and the deployment that follows it. errorobjectWhy the preview waits or has failed. error object2 fieldscodestringrequiredA short code for the failure, such as messagestringrequiredWhat went wrong, in words you can show. close_reasonstringWhy the preview was closed, or is closing. One of: created_atstringrequiredWhen the preview was made. updated_atstringrequiredWhen the preview last changed. ready_atstring | nullrequiredWhen the preview first served. closed_atstring | nullrequiredWhen the preview was closed. expires_atstring | nullrequiredWhen an open preview goes away if there is no new push. sizestring | nullrequiredThe size the preview runs at: limitsobjectrequiredThe limits that apply to the previews of a cube. limits object2 fieldsmax_openintegerrequiredThe most previews a cube can have open at once. idle_daysintegerrequiredThe days without a push after which a preview is removed. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews" \
-H "Authorization: Bearer $CUBECEN_API_KEY"{
"data": [
{
"id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
"pull_request": {
"number": 42,
"title": "New checkout page",
"author": "octocat",
"url": "https://github.com/acme/storefront/pull/42",
"head_ref": "feature/checkout",
"base_ref": "main",
"head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"head_received_at": "2026-10-25T09:40:18Z",
"draft": false
},
"status": "ready",
"url": "https://web-acme-pr42-8c1d0e.cubecen.app",
"release": {
"build_id": "bld_00000006a0fdd794980f85f9c353bf",
"deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
"commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"release_status": "DEPLOYED",
"env_version": "e3a91c2",
"started_at": "2026-10-25T09:40:44Z"
},
"created_at": "2026-10-25T09:38:02Z",
"updated_at": "2026-10-25T09:43:10Z",
"ready_at": "2026-10-25T09:43:10Z",
"closed_at": null,
"expires_at": "2026-11-01T09:40:18Z",
"size": "small"
},
{
"id": "c92f1b68-0d47-4e35-8a6c-5f3b7e1d9a20",
"pull_request": {
"number": 40,
"title": "Fix the footer links",
"author": "hubot",
"url": "https://github.com/acme/storefront/pull/40",
"head_ref": "fix/footer",
"base_ref": "main",
"head_sha": "b73a5f7f0d6cadd7602fbb6440a9434b4e1c8a90",
"head_received_at": "2026-10-23T15:12:44Z",
"draft": false
},
"status": "closed",
"url": null,
"release": {
"build_id": "bld_00000003a0fdd794980f85f9c353bf",
"deployment_id": "dpl_00000004a0fdd794980f85f9c353bf",
"commit_sha": "b73a5f7f0d6cadd7602fbb6440a9434b4e1c8a90",
"release_status": "DEPLOYED",
"env_version": "e3a91c2",
"started_at": "2026-10-23T15:13:10Z"
},
"close_reason": "merged",
"created_at": "2026-10-23T15:10:51Z",
"updated_at": "2026-10-24T08:02:37Z",
"ready_at": "2026-10-23T15:16:20Z",
"closed_at": "2026-10-24T08:02:37Z",
"expires_at": null,
"size": "small"
}
],
"limits": {
"max_open": 3,
"idle_days": 7
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "DATABASE_UNAVAILABLE",
"message": "Database unavailable",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Get the preview settings of a cube
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ settingsReturns whether pull request previews are on for a cube, and whether they can be turned on. It needs only read access.
enabled is the switch. available says whether it can be turned on now. When it cannot, reason says why: PUBLIC_REPOSITORY (the cube was made from a link, so Cubecen does not see its pull requests), APPLICATION_NOT_READY (the cube is not active), PLAN (the organization's plan has no previews), REPOSITORY_NOT_ACCESSIBLE (the cube's GitHub connection is gone) or GITHUB_PERMISSIONS_MISSING (an owner of the GitHub account has not approved the permissions that previews need: approve_url is the page where they do). branch is the tracked branch: the pull requests into it get previews.
What the GitHub account has granted is read from GitHub at most once an hour, and again when its owner approves new permissions. Change the switch with updatePreviewSettings.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
Responses
| Status | Description |
|---|---|
| 200 | The preview settings of the cube. PreviewSettings object6 fieldsenabledbooleanrequiredWhether previews are on. availablebooleanrequiredWhether previews can be turned on now. reasonstring | nullrequiredWhy they cannot be turned on. approve_urlstring | nullrequiredWhere an owner of the GitHub account approves the permissions, on github.com. branchstring | nullrequiredThe tracked branch: the pull requests into it get previews. limitsobjectrequiredThe limits that apply to the previews of a cube. limits object2 fieldsmax_openintegerrequiredThe most previews a cube can have open at once. idle_daysintegerrequiredThe days without a push after which a preview is removed. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 422 | The request is well formed but cannot be carried out. |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 502 | A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff. |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/settings" \
-H "Authorization: Bearer $CUBECEN_API_KEY"{
"enabled": true,
"available": true,
"reason": null,
"approve_url": null,
"branch": "main",
"limits": {
"max_open": 3,
"idle_days": 7
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "GITHUB_INSTALLATION_REMOVED",
"message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "GITHUB_UNAVAILABLE",
"message": "GitHub is temporarily unavailable; retry the same request",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "GITHUB_RATE_LIMITED",
"message": "GitHub's rate limit was reached. Try again in about a minute",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Turn previews on or off for a cube
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ settingsTurns pull request previews on or off for a cube. It needs a key with full access.
Send {"enabled": true} or {"enabled": false}. enabled is required. The answer is the settings, as getPreviewSettings shows them.
Turning previews on first asks GitHub again what the account has granted. It is refused when previews cannot be turned on: with 402 PLAN_LIMIT_REACHED while the organization's plan has no previews (error.limit is previews), with 409 APPLICATION_NOT_READY while the cube is not active, and with 422 GITHUB_PERMISSIONS_MISSING, REPOSITORY_NOT_ACCESSIBLE, GITHUB_INSTALLATION_REMOVED or GITHUB_INSTALLATION_SUSPENDED when GitHub does not allow it. The pull requests that are already open get their previews within about 10 minutes. New pull requests and pushes get theirs within seconds.
Turning previews off is always allowed. It closes every preview of the cube: their cubes are deleted and GitHub is told. Turning previews on again brings back the previews of the pull requests that are still open.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
Body
| Name | Type | Description |
|---|---|---|
enabledrequired | boolean |
|
Responses
| Status | Description |
|---|---|
| 200 | The preview settings after the change. PreviewSettings object6 fieldsenabledbooleanrequiredWhether previews are on. availablebooleanrequiredWhether previews can be turned on now. reasonstring | nullrequiredWhy they cannot be turned on. approve_urlstring | nullrequiredWhere an owner of the GitHub account approves the permissions, on github.com. branchstring | nullrequiredThe tracked branch: the pull requests into it get previews. limitsobjectrequiredThe limits that apply to the previews of a cube. limits object2 fieldsmax_openintegerrequiredThe most previews a cube can have open at once. idle_daysintegerrequiredThe days without a push after which a preview is removed. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 402 | The organization's plan does not allow this. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 409 | The request conflicts with the current state of the resource. |
| 413 | The request body is larger than 1 MiB. |
| 415 | The request body must be JSON. Send |
| 422 | The request is well formed but cannot be carried out. |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 502 | A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff. |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS -X PUT "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/settings" \
-H "Authorization: Bearer $CUBECEN_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"enabled": true}'{
"enabled": true,
"available": true,
"reason": null,
"approve_url": null,
"branch": "main",
"limits": {
"max_open": 3,
"idle_days": 7
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request body must be valid JSON with only supported fields",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "PLAN_LIMIT_REACHED",
"message": "The Free plan does not include pull request previews; change plans to turn them on",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"limit": "previews",
"max": 0,
"used": 0,
"plan": "free"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "APPLICATION_NOT_READY",
"message": "The cube is not ready for previews",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request body is too large",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Content-Type must be application/json",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "GITHUB_PERMISSIONS_MISSING",
"message": "Approve the Cubecen GitHub App's new permissions (pull requests, commit statuses and deployments) for this account on GitHub, then try again",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "GITHUB_UNAVAILABLE",
"message": "GitHub is temporarily unavailable; retry the same request",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "GITHUB_RATE_LIMITED",
"message": "GitHub's rate limit was reached. Try again in about a minute",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Get a preview
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}Returns one pull request preview of a cube, with its newest release. It needs only read access.
status says where the preview is: pending (just seen, being set up), waiting (for a place or a build slot: error.code says which), building, deploying, ready (served at url), failed (error says why) or closed (close_reason says why). url is set once the preview has served, until it closes. A push builds the new head while the previous version keeps serving at the same address, and a failed build leaves it serving too.
release is the newest build of the preview and its automatic deployment. Its build_id and deployment_id are what getPreviewBuildLogs and getPreviewDeploymentLogs take. pull_request.head_sha is the newest commit that Cubecen knows of: it is ahead of release.commit_sha while a new commit waits to be built.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
preview-idrequired | string | The ID of the preview: the |
Responses
| Status | Description |
|---|---|
| 200 | The preview. Preview object13 fieldsidstringrequiredThe preview's ID. pull_requestobjectrequiredThe pull request that the preview builds. pull_request object9 fieldsnumberintegerrequiredThe pull request's number. titlestringrequiredThe pull request's title. authorstringrequiredThe GitHub login that opened it. urlstringrequiredIts page on GitHub. Empty until Cubecen has read the pull request. head_refstringrequiredThe branch it comes from. base_refstringrequiredThe branch it targets: the cube's tracked branch. head_shastring | nullrequiredThe newest head commit that Cubecen knows of. It is ahead of head_received_atstring | nullrequiredWhen Cubecen learned of draftbooleanrequired
statusstringrequired
One of: urlstring | nullrequiredWhere the preview is served, once it has served, until it closes. Its last successful deployment keeps serving while a newer build is on its way or has failed. releaseobject | nullrequiredThe preview's newest build and the deployment that follows it. errorobjectWhy the preview waits or has failed. error object2 fieldscodestringrequiredA short code for the failure, such as messagestringrequiredWhat went wrong, in words you can show. close_reasonstringWhy the preview was closed, or is closing. One of: created_atstringrequiredWhen the preview was made. updated_atstringrequiredWhen the preview last changed. ready_atstring | nullrequiredWhen the preview first served. closed_atstring | nullrequiredWhen the preview was closed. expires_atstring | nullrequiredWhen an open preview goes away if there is no new push. sizestring | nullrequiredThe size the preview runs at: |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/<preview-id>" \
-H "Authorization: Bearer $CUBECEN_API_KEY"{
"id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
"pull_request": {
"number": 42,
"title": "New checkout page",
"author": "octocat",
"url": "https://github.com/acme/storefront/pull/42",
"head_ref": "feature/checkout",
"base_ref": "main",
"head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"head_received_at": "2026-10-25T09:40:18Z",
"draft": false
},
"status": "ready",
"url": "https://web-acme-pr42-8c1d0e.cubecen.app",
"release": {
"build_id": "bld_00000006a0fdd794980f85f9c353bf",
"deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
"commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"release_status": "DEPLOYED",
"env_version": "e3a91c2",
"started_at": "2026-10-25T09:40:44Z"
},
"created_at": "2026-10-25T09:38:02Z",
"updated_at": "2026-10-25T09:43:10Z",
"ready_at": "2026-10-25T09:43:10Z",
"closed_at": null,
"expires_at": "2026-11-01T09:40:18Z",
"size": "small"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "DATABASE_UNAVAILABLE",
"message": "Database unavailable",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Remove a preview
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}Closes a preview until the next push to its pull request. It needs a key with full access.
The answer is 202 with the preview, which now has close_reason set to removed. Within seconds the preview is closed, its cube is deleted and GitHub is told. It comes back with the next push to the pull request. A preview that is already closed is answered as it is.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
preview-idrequired | string | The ID of the preview: the |
Responses
| Status | Description |
|---|---|
| 202 | The preview, which is being closed. Preview object13 fieldsidstringrequiredThe preview's ID. pull_requestobjectrequiredThe pull request that the preview builds. pull_request object9 fieldsnumberintegerrequiredThe pull request's number. titlestringrequiredThe pull request's title. authorstringrequiredThe GitHub login that opened it. urlstringrequiredIts page on GitHub. Empty until Cubecen has read the pull request. head_refstringrequiredThe branch it comes from. base_refstringrequiredThe branch it targets: the cube's tracked branch. head_shastring | nullrequiredThe newest head commit that Cubecen knows of. It is ahead of head_received_atstring | nullrequiredWhen Cubecen learned of draftbooleanrequired
statusstringrequired
One of: urlstring | nullrequiredWhere the preview is served, once it has served, until it closes. Its last successful deployment keeps serving while a newer build is on its way or has failed. releaseobject | nullrequiredThe preview's newest build and the deployment that follows it. errorobjectWhy the preview waits or has failed. error object2 fieldscodestringrequiredA short code for the failure, such as messagestringrequiredWhat went wrong, in words you can show. close_reasonstringWhy the preview was closed, or is closing. One of: created_atstringrequiredWhen the preview was made. updated_atstringrequiredWhen the preview last changed. ready_atstring | nullrequiredWhen the preview first served. closed_atstring | nullrequiredWhen the preview was closed. expires_atstring | nullrequiredWhen an open preview goes away if there is no new push. sizestring | nullrequiredThe size the preview runs at: |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS -X DELETE "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/<preview-id>" \
-H "Authorization: Bearer $CUBECEN_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
"pull_request": {
"number": 42,
"title": "New checkout page",
"author": "octocat",
"url": "https://github.com/acme/storefront/pull/42",
"head_ref": "feature/checkout",
"base_ref": "main",
"head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"head_received_at": "2026-10-25T09:40:18Z",
"draft": false
},
"status": "ready",
"url": "https://web-acme-pr42-8c1d0e.cubecen.app",
"release": {
"build_id": "bld_00000006a0fdd794980f85f9c353bf",
"deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
"commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"release_status": "DEPLOYED",
"env_version": "e3a91c2",
"started_at": "2026-10-25T09:40:44Z"
},
"close_reason": "removed",
"created_at": "2026-10-25T09:38:02Z",
"updated_at": "2026-10-25T13:15:27Z",
"ready_at": "2026-10-25T09:43:10Z",
"closed_at": null,
"expires_at": "2026-11-01T09:40:18Z",
"size": "small"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "DATABASE_UNAVAILABLE",
"message": "Database unavailable",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Build a preview again
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ redeployBuilds the head of an open preview again, with the current variables and the secrets marked for previews. It needs a key with full access.
The answer is 202 with the preview as it is, and the build starts within seconds. Follow it with getPreview. A preview that is closed is refused with 409 CONFLICT: a push to its pull request brings it back.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
preview-idrequired | string | The ID of the preview: the |
Responses
| Status | Description |
|---|---|
| 202 | The preview as it is. Its head is built again within seconds. Preview object13 fieldsidstringrequiredThe preview's ID. pull_requestobjectrequiredThe pull request that the preview builds. pull_request object9 fieldsnumberintegerrequiredThe pull request's number. titlestringrequiredThe pull request's title. authorstringrequiredThe GitHub login that opened it. urlstringrequiredIts page on GitHub. Empty until Cubecen has read the pull request. head_refstringrequiredThe branch it comes from. base_refstringrequiredThe branch it targets: the cube's tracked branch. head_shastring | nullrequiredThe newest head commit that Cubecen knows of. It is ahead of head_received_atstring | nullrequiredWhen Cubecen learned of draftbooleanrequired
statusstringrequired
One of: urlstring | nullrequiredWhere the preview is served, once it has served, until it closes. Its last successful deployment keeps serving while a newer build is on its way or has failed. releaseobject | nullrequiredThe preview's newest build and the deployment that follows it. errorobjectWhy the preview waits or has failed. error object2 fieldscodestringrequiredA short code for the failure, such as messagestringrequiredWhat went wrong, in words you can show. close_reasonstringWhy the preview was closed, or is closing. One of: created_atstringrequiredWhen the preview was made. updated_atstringrequiredWhen the preview last changed. ready_atstring | nullrequiredWhen the preview first served. closed_atstring | nullrequiredWhen the preview was closed. expires_atstring | nullrequiredWhen an open preview goes away if there is no new push. sizestring | nullrequiredThe size the preview runs at: |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 409 | The request conflicts with the current state of the resource. |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS -X POST "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/<preview-id>/redeploy" \
-H "Authorization: Bearer $CUBECEN_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
"pull_request": {
"number": 42,
"title": "New checkout page",
"author": "octocat",
"url": "https://github.com/acme/storefront/pull/42",
"head_ref": "feature/checkout",
"base_ref": "main",
"head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"head_received_at": "2026-10-25T09:40:18Z",
"draft": false
},
"status": "ready",
"url": "https://web-acme-pr42-8c1d0e.cubecen.app",
"release": {
"build_id": "bld_00000006a0fdd794980f85f9c353bf",
"deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
"commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
"release_status": "DEPLOYED",
"env_version": "e3a91c2",
"started_at": "2026-10-25T09:40:44Z"
},
"created_at": "2026-10-25T09:38:02Z",
"updated_at": "2026-10-25T09:43:10Z",
"ready_at": "2026-10-25T09:43:10Z",
"closed_at": null,
"expires_at": "2026-11-01T09:40:18Z",
"size": "small"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "CONFLICT",
"message": "This preview is closed; a push to its pull request brings it back",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "DATABASE_UNAVAILABLE",
"message": "Database unavailable",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Stream the logs of a preview
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ logsStreams what a preview prints, from all of its replicas, together with its pod events, as Server-Sent Events (text/event-stream). It works like getApplicationLogs, for a preview. It needs only read access.
The stream starts with a window of the output: the last tail lines (1 to 1000), or the lines since since, or the last 100 lines when you send neither. tail and since together are refused with 400. Without follow, the stream ends with an end event after the window. With follow=true it stays open and sends new lines a few seconds after they are printed.
To continue after a broken connection, send the id of the last event you received as cursor. It wins over tail and since.
A preview that has no cube of its own yet, because it is closed or not set up yet, has no logs and is answered with 404. The events are described under the response.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
preview-idrequired | string | The ID of the preview: the |
Query parameters
| Name | Type | Description |
|---|---|---|
follow | boolean |
|
cursor | string | Where to continue a stream: the |
tail | integer | Start with the last N lines, from 1 to 1000. Without |
since | string | Start at this time, as an RFC 3339 time, instead of with the last lines. Not together with |
Header parameters
| Name | Type | Description |
|---|---|---|
Last-Event-ID | string | The same as |
Responses
| Status | Description |
|---|---|
| 200 | The log lines, as a stream of Server-Sent Events. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/<preview-id>/logs" \
-H "Authorization: Bearer $CUBECEN_API_KEY""retry: 3000\n: connected\n\nid: NjMwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:44:01.204118Z\",\"source\":\"runtime\",\"pod\":\"app-9a2f1c3e-6d5b8f7c49-x7k2p\",\"line\":\"Listening on port 8080\"}\n\n: ping\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "follow must be true or false",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "follow"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "LOGS_UNAVAILABLE",
"message": "Logs are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Stream the logs of a preview build
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ builds/ {build-id}/ logsStreams the log lines of one build of a preview, from fetching the source to pushing the image, as Server-Sent Events (text/event-stream). It works like getBuildLogs, for a preview. It needs only read access.
Take the build's ID from release.build_id of the preview, as getPreview shows it. Without follow, the stream sends the lines that exist and ends with an end event. With follow=true it stays open and sends new lines a few seconds after they are printed. When the build has finished and every line is sent, the stream ends with complete: true.
To continue after a broken connection, send the id of the last event you received as cursor. tail and since are for the output of a running preview (getPreviewLogs): without a cursor, a request that has one of them is refused with 400.
Only builds of this preview are found. Any other build ID, the cube's own builds included, is 404, and so is a preview that has no cube of its own yet. The events are described under the response.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
preview-idrequired | string | The ID of the preview: the |
build-idrequired | string | The ID of the build: the |
Query parameters
| Name | Type | Description |
|---|---|---|
follow | boolean |
|
cursor | string | Where to continue a stream: the |
Header parameters
| Name | Type | Description |
|---|---|---|
Last-Event-ID | string | The same as |
Responses
| Status | Description |
|---|---|
| 200 | The log lines, as a stream of Server-Sent Events. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/<preview-id>/builds/<build-id>/logs" \
-H "Authorization: Bearer $CUBECEN_API_KEY""retry: 3000\n: connected\n\nid: NzEwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:40:48.331092Z\",\"source\":\"build\",\"step\":\"fetch\",\"line\":\"Fetching revision feature/checkout\"}\n\nid: NzEwMg\nevent: end\ndata: {\"complete\":true,\"cursor\":\"NzEwMg\"}\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "follow must be true or false",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "follow"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "LOGS_UNAVAILABLE",
"message": "Logs are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Stream the logs of a preview deployment
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ previews/ {preview-id}/ deployments/ {deployment-id}/ logsStreams the log lines of one deployment of a preview as Server-Sent Events (text/event-stream): its own steps (apply and rollout), the output of the new pods as they start, and the pod events that happen while it rolls out. It works like getDeploymentLogs, for a preview. It needs only read access.
Take the deployment's ID from release.deployment_id of the preview, as getPreview shows it. It is null until the build has succeeded. Without follow, the stream sends the lines that exist and ends with an end event. With follow=true it stays open and sends new lines a few seconds after they are printed. When the deployment has finished and every line is sent, the stream ends with complete: true.
To continue after a broken connection, send the id of the last event you received as cursor. tail and since are for the output of a running preview (getPreviewLogs): without a cursor, a request that has one of them is refused with 400.
Only deployments of this preview are found. Any other deployment ID, the cube's own deployments included, is 404, and so is a preview that has no cube of its own yet. The events are described under the response.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
preview-idrequired | string | The ID of the preview: the |
deployment-idrequired | string | The ID of the deployment: the |
Query parameters
| Name | Type | Description |
|---|---|---|
follow | boolean |
|
cursor | string | Where to continue a stream: the |
Header parameters
| Name | Type | Description |
|---|---|---|
Last-Event-ID | string | The same as |
Responses
| Status | Description |
|---|---|
| 200 | The log lines, as a stream of Server-Sent Events. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/previews/<preview-id>/deployments/<deployment-id>/logs" \
-H "Authorization: Bearer $CUBECEN_API_KEY""retry: 3000\n: connected\n\nid: ODEwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:42:20.511903Z\",\"source\":\"deploy\",\"step\":\"apply\",\"line\":\"Applying the new version\"}\n\nid: ODEwMg\nevent: end\ndata: {\"complete\":true,\"cursor\":\"ODEwMg\"}\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "follow must be true or false",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "follow"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "LOGS_UNAVAILABLE",
"message": "Logs are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}