Docs/Secrets API/Environments
REST API Reference

Environments API

Create, list, and configure deployment environments (production, staging, development, preview) within a project.

Create Environment

Adds a new isolated deployment stage to an existing project. Protected environments enforce strict policy approval requirements.


Create EnvironmentAuth

Add a new environment to a project.

Payload Example

{
  "name": "Staging",
  "slug": "staging",
  "is_protected": false
}

Status Codes

  • Name
    201
    Type
    HTTP
    Description
    Environment successfully created.
  • Name
    400
    Type
    HTTP
    Description
    Slug collision or invalid naming convention.
  • Name
    404
    Type
    HTTP
    Description
    Parent project not found.

Request Parameters

  • Name
    name
    Type
    string
    Required
    Description
    Descriptive stage label (e.g. Staging).
  • Name
    slug
    Type
    string
    Required
    Description
    Unique URL-safe stage identifier (e.g. staging).
  • Name
    is_protected
    Type
    boolean
    Description
    Restricts secret deletion and export to administrators only.
Request
POST/v1/secrets/projects/{id}/environments
Response 201

We use cookies and similar technologies to measure traffic and improve the site. You can choose which categories to allow. Manage Preferences.