SDK reference

Deployments

Each route's function in the SDK, its call beside the same request in cURL.
postProtectionToken

POST/v1/protection/token

A two-minute sign-in link to a protected host for the signed-in person: a deployment's own URL, or the production host or a custom domain of a project that protects everything. They need deployments:read in its organization and, when the project limits it to groups, to be in one of them or an owner or admin. People only, not keys.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/protection/token' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "host": "example"
  }'
postOrgProjectsUploads

POST/v1/orgs/:orgId/projects/:projectId/uploads

A presigned PUT URL (15 minutes) for one source archive of size bytes (gzipped tar, at most 250 MB). Send the archive with exactly the returned headers, then start a deployment with the uploadId.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/uploads' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "size": 1
  }'
postOrgProjectsUploadsPlan

POST/v1/orgs/:orgId/projects/:projectId/uploads/plan

Plans an upload from the working tree's index (files: path → "<mode> <blob id>", at most 50,000). skip: a ready deployment of the same files and build inputs (none with force); else base and need: an earlier full upload to send only the changed files on top of; else neither (upload it whole). Writes nothing.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/uploads/plan' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "target": "production",
    "files": {}
  }'
postOrgProjectsDeployments

POST/v1/orgs/:orgId/projects/:projectId/deployments

Starts a deployment of the Serverless App Service. git: a commit of the linked repository on branch, with target (default: production for the production branch, else preview); a commit that already has a building or ready deployment for that target returns it (200) unless force. upload: the archive uploaded with uploadId, built as target.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/deployments' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "source": "git"
  }'
orgDeploymentsBuildLog

GET/v1/orgs/:orgId/deployments/:deploymentId/build-log

Build output after cursor (from the first step on), with the deployment's status. Poll with the returned cursor until done: the deployment has finished and no output is left.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}/build-log' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDeploymentsRuntimeLogsTail

GET/v1/orgs/:orgId/deployments/:deploymentId/runtime-logs/tail

Server function log events from since (epoch ms, at most an hour back; default the last minute) to now, oldest first, with event ids. q filters case-insensitively. Poll again from next, re-reading a few seconds (late events) and skipping ids already seen.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}/runtime-logs/tail' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDeployments

GET/v1/orgs/:orgId/deployments

Lists deployments across Serverless App Services, newest first. Pass the returned cursor to get the next page.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDeploymentsByDeploymentId

GET/v1/orgs/:orgId/deployments/:deploymentId

A deployment and a summary of its Serverless App Service.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDeploymentsLogs

GET/v1/orgs/:orgId/deployments/:deploymentId/logs

Build output, starting at the first build step.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}/logs' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDeploymentsRuntimeLogs

GET/v1/orgs/:orgId/deployments/:deploymentId/runtime-logs

Server function logs, newest first, at most 500 per page. range (1h, 6h, 24h, 7d; default 1h) bounds how far back; pass the returned older as before for the next page; after returns only newer events (live tail). q filters messages case-insensitively. available is false for deployments without a server function.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}/runtime-logs' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgDeploymentsRedeploy

POST/v1/orgs/:orgId/deployments/:deploymentId/redeploy

Builds the deployment's commit again as a new deployment with the same target.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}/redeploy' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgDeploymentsPromote

POST/v1/orgs/:orgId/deployments/:deploymentId/promote

Makes a ready deployment production without rebuilding: promotes a preview, or rolls back to an earlier production deployment. A promoted preview's function switches to production's variables unless the body is { "env": "preview" }. A rollback holds production there: new production builds don't go live until a deployment is promoted.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/deployments/{deploymentId}/promote' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgDeploymentHosts

GET/v1/orgs/:orgId/deployment-hosts

After a slug change: the slug the deployment hosts use (deploymentSlug), where a move takes them (move, with moving when one didn't finish), each Serverless App Service's production host before and after (conflict when the new one belongs to someone else), and the old hosts still serving (former).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/deployment-hosts' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgDeploymentHostsMove

POST/v1/orgs/:orgId/deployment-hosts/move

Moves the production hosts to the organisation's slug, or finishes a move that stopped. The old hosts keep serving production. Owners only, acting themselves; once a minute (429 with Retry-After). state is unfinished when services are left for the next attempt.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/deployment-hosts/move' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteOrgDeploymentHostsFormer

DELETE/v1/orgs/:orgId/deployment-hosts/former

Stops serving the old production hosts (all, or each host given). The names stay the organisation's. Owners only, acting themselves.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/deployment-hosts/former' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"