Skip to main content
On the edge gateway every save of an API’s Worker creates a deployment: an immutable snapshot of the files it runs, the template, the variables and the bindings. Your API’s hosts ({api}.jojapi.net and your custom hosts) serve the production deployment. Every other active deployment has its own URL, so you can test a change before your consumers see it, share an exact version, and go back to a previous one without rebuilding anything.
Deployments exist for APIs served by the edge gateway (the Worker tab). Open Worker → Deployments in the Studio, or use the CLI.

URLs

Every URL goes through the same gateway: API keys, subscriptions, plans, quotas, rate limits, billing and request logs work exactly as on production. Calls to a deployment URL are billed like any other call. Each answer carries x-jojapi-deployment: {id}, so you always know which version responded.

What a save does

A variable or binding change never carries unpromoted code into production: it is built from the code production runs. Console logging is a Worker setting, not part of a deployment; switching it applies to production and every active deployment at once.

Promote and roll back

Promote serves a deployment on your production hosts within seconds. You can add a release note: promotions and their notes appear as Releases on your API’s public page, with a “last updated” date. Consumers never see unpromoted deployments. Roll back returns production to the deployment it served before. A deployment carries its variables and bindings, so rolling back restores their values too — secrets included. If you rotated a leaked key, deploy again after the rollback. Stateful objects keep one shared state: every deployment of an API talks to the same objects as production. A class that production does not have yet starts with its own empty state in a preview and moves to the shared state when that deployment is promoted.

Access

Your production hosts always serve every subscriber. The access setting only concerns a deployment’s own URL, and it appears on every deployment except the one in production:
  • My keys only (default): only API keys of your own account can call the URL; anyone else gets 403 Deployment Is Private.
  • Public URL: any subscriber of your API can call it, billed as usual. Share it to let a consumer pin an exact version while production moves on.
The --preview URL is always for your keys only.

Active and archived deployments

An active deployment is deployed and callable. Three active deployments per API are included in compute usage; beyond that, each costs the list price of $0.02 per deployment per month, prorated by day. To keep routine saves free, the oldest active deployment is archived automatically once more than three are active — except production, the previous production, the latest deployment, public deployments and those you Keep active. An archived deployment keeps its snapshot but no longer runs: its URL answers 410 Deployment Archived with your production URL. Activate brings it back in seconds (and keeps it active); promoting an archived deployment activates it as well. The last 100 deployments of an API are retained. An API can keep up to 50 deployments active; write to support if you need more.

CLI and Management API

To deploy from a GitHub repository — a preview for every pull request, production on every merge — see Deploy from GitHub. The same actions are Management API routes: provider-api-edge-deployments, promote-api-edge-deployment, rollback-api-edge and update-api-edge-deployment (access, Keep active, archive, activate), with the code:read and code:write scopes.