All endpoints on this page are [User] — they require a signed-in user session and are not available to API keys.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
GET | /environments?org_id= | List environments in an organization | [User] |
POST | /environments | Create an environment | [User] |
GET | /environments/:id | Get an environment | [User] |
PATCH | /environments/:id | Update an environment | [User] |
DELETE | /environments/:id | Delete an environment | [User] |
List environments
GET /environments
Lists the environments in an organization, each with a count of the tenants it contains.
The organization whose environments to list.
Create an environment
POST /environments
Creates a new environment in an organization.
The organization to create the environment in.
Display name for the environment.
Environment type — one of
dev, staging, production, custom, or personal. The type determines the prefix of keys created in it (sk_live_ for production/personal, sk_test_ otherwise).Only administrative roles (
owner, billing_admin) may create environments.Get an environment
GET /environments/:id
Returns a single environment, including counts of the tenants and API keys it contains.
The environment ID.
Update an environment
PATCH /environments/:id
Updates any supplied mutable field.
The environment ID.
New display name.
New environment type —
dev, staging, production, custom, or personal. Future keys created in the environment use the prefix associated with this type.active or inactive.Only administrative roles may update an environment.
Delete an environment
DELETE /environments/:id
Permanently deletes an environment and the tenants, keys, and content within it.
The environment ID.
Next steps
Tenancy
See how environments, tenants, and keys fit together.
Tenants
Provision tenants inside an environment.
API keys
Create keys scoped to this environment.