Kinds
The
live environment cannot be created, renamed to another slug, or deleted.
What differs between live and sandbox
The
environment field on runs and webhooks is a compatibility label with two values. Use the key’s environment slug, not this label, to tell two sandboxes apart.
Slugs and names
Some older orgs have a sandbox with the slug
test. It keeps working, but no new environment can take that slug.
Manage environments in the portal
Open Settings, then Environments. You need the admin or developer role. You can:- create a sandbox (slug, optional name),
- rename one,
- delete a sandbox that no API key, webhook endpoint or run still uses.
Manage environments with the API
The environment routes accept organization keys only. A scoped key gets403 insufficient_capability. Any organization key, from any environment, can manage all of the org’s environments.
Create a sandbox:
201:
slug and name.
Deleting a sandbox
A sandbox can be deleted only when nothing references it. Every API key ever created for it counts, including revoked keys: revoking a key does not clear the blocker. Its webhook endpoints and its runs also count. Runs are removed by the 90-day retention purge, except runs flagged to be kept. While anything remains, the API answers409 with a count of each blocker:
blockers object instead of details. A successful delete answers 204 with no body.
Errors
Next
Authentication and access
Keys, capabilities and which routes need a live key.
Sandbox fixtures
Drive a run to a chosen terminal state without calling any provider.