API
Deployments
List deployments, read build and runtime logs, redeploy and promote.
See Builds and Environments for how deployments are created by pushes and what each status means.
Every route below, with its parameters, request and response, errors and samples, is in the API reference.
| Route | What it does |
|---|---|
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. |
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. |
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. |
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. |
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. |
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. |
GET /v1/orgs/:orgId/deployments | Lists deployments across Serverless App Services, newest first. Pass the returned cursor to get the next page. |
GET /v1/orgs/:orgId/deployments/:deploymentId | A deployment and a summary of its Serverless App Service. |
GET /v1/orgs/:orgId/deployments/:deploymentId/logs | Build output, starting at the first build step. |
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. |
POST /v1/orgs/:orgId/deployments/:deploymentId/redeploy | Builds the deployment's commit again as a new deployment with the same target. |
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. |
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). |
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. |
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. |