Get started

Environment Variables API

Environment Variables API

Manage environment variables for your project. Variables are scoped per stage (Live or Test).

GET/organizations/:orgId/projects/:projectId/environments?stage=production

List all environment variables for a stage.

Response
{
  "environments": [
    {
      "id": 1,
      "stage": "production",
      "name": "DATABASE_URL",
      "value": "mysql://...",
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T..."
    }
  ]
}
POST/organizations/:orgId/projects/:projectId/environments

Create a new environment variable.

Request
{
  "stage": "production",
  "name": "API_SECRET",
  "value": "sk_live_abc123"
}
Response
{
  "environment": {
    "id": 2,
    "stage": "production",
    "name": "API_SECRET",
    "value": "sk_live_abc123",
    "createdAt": "2026-03-20T...",
    "updatedAt": "2026-03-20T..."
  }
}
PUT/organizations/:orgId/projects/:projectId/environments/:envId

Update an environment variable. Both name and value are optional.

Request
{
  "value": "sk_live_updated_value"
}
Response
{
  "environment": {
    "id": 2,
    "stage": "production",
    "name": "API_SECRET",
    "value": "sk_live_updated_value",
    "createdAt": "2026-03-20T...",
    "updatedAt": "2026-03-24T..."
  }
}
DELETE/organizations/:orgId/projects/:projectId/environments/:envId

Delete an environment variable.