Environment Variables
Environment variables are key-value pairs injected into your app at runtime. Secret variables are encrypted at rest and masked in API responses.
sync endpoint to push changes to running containers without a full redeploy, or trigger a new deployment.List Env Vars
/workspaces/{wsId}/apps/{appId}/env-varsReturns all environment variables for the specified app. Values marked as secret are masked with *** in responses.
Response
[
{
"id": "env_01hx...",
"key": "DATABASE_URL",
"value": "***",
"isSecret": true,
"createdAt": "2025-04-10T09:00:00Z",
"updatedAt": "2025-04-10T09:00:00Z"
},
{
"id": "env_02hx...",
"key": "PORT",
"value": "3000",
"isSecret": false,
"createdAt": "2025-04-10T09:00:00Z",
"updatedAt": "2025-04-10T09:00:00Z"
}
]curl -X GET "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/apps/{appId}/env-vars" \
-H "Authorization: Bearer dor_sk_your_key_here"Create Env Var
/workspaces/{wsId}/apps/{appId}/env-varsCreates a new environment variable. Keys must follow the ^[A-Z_][A-Z0-9_]*$ format - uppercase letters, digits, and underscores only.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| key | string | required | Variable name. Must match ^[A-Z_][A-Z0-9_]*$ (e.g. DATABASE_URL, PORT) |
| value | string | required | Variable value. Stored encrypted when isSecret is true. |
| isSecret | boolean | optional | Mark the value as sensitive. Masked in responses. Default: false |
Response
{
"id": "env_01hx...",
"key": "DATABASE_URL",
"value": "***",
"isSecret": true,
"createdAt": "2025-04-17T12:00:00Z",
"updatedAt": "2025-04-17T12:00:00Z"
}curl -X POST "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/apps/{appId}/env-vars" \
-H "Authorization: Bearer dor_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"key": "DATABASE_URL",
"value": "postgres://user:pass@host:5432/db",
"isSecret": true
}'Update Env Var
/workspaces/{wsId}/apps/{appId}/env-vars/{envVarId}Updates the value or secret flag of an existing environment variable. The key cannot be changed - delete and recreate the variable instead.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| value | string | optional | New value for the variable |
| isSecret | boolean | optional | Update the secret flag. Changing to true encrypts the stored value. |
Response
{
"id": "env_01hx...",
"key": "DATABASE_URL",
"value": "***",
"isSecret": true,
"createdAt": "2025-04-10T09:00:00Z",
"updatedAt": "2025-04-17T15:00:00Z"
}curl -X PATCH "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/apps/{appId}/env-vars/{envVarId}" \
-H "Authorization: Bearer dor_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"value": "postgres://user:newpass@host:5432/db"
}'Delete Env Var
/workspaces/{wsId}/apps/{appId}/env-vars/{envVarId}Permanently deletes an environment variable. The change takes effect in running containers only after a sync or redeploy.
Response
{
"id": "env_01hx...",
"key": "DATABASE_URL",
"deletedAt": "2025-04-17T16:00:00Z"
}curl -X DELETE "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/apps/{appId}/env-vars/{envVarId}" \
-H "Authorization: Bearer dor_sk_your_key_here"Bulk Upsert
/workspaces/{wsId}/apps/{appId}/env-vars/bulkCreates or updates multiple environment variables in a single request. Existing variables with matching keys are updated; new keys are created. Variables not present in the payload are left unchanged.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| vars | array | required | Array of env var objects. Each object must include key and value. isSecret is optional. |
| vars[].key | string | required | Variable name. Must match ^[A-Z_][A-Z0-9_]*$ |
| vars[].value | string | required | Variable value |
| vars[].isSecret | boolean | optional | Mark the value as sensitive. Default: false |
Response
{
"upserted": 2,
"vars": [
{
"id": "env_01hx...",
"key": "DATABASE_URL",
"value": "***",
"isSecret": true
},
{
"id": "env_02hx...",
"key": "PORT",
"value": "3000",
"isSecret": false
}
]
}curl -X POST "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/apps/{appId}/env-vars/bulk" \
-H "Authorization: Bearer dor_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"vars": [
{ "key": "DATABASE_URL", "value": "postgres://...", "isSecret": true },
{ "key": "PORT", "value": "3000" }
]
}'Sync to Runtime
/workspaces/{wsId}/apps/{appId}/env-vars/syncPushes the current set of environment variables to running containers. The app process is restarted to pick up the new values - no full redeploy or image rebuild is triggered.
Response
{
"synced": true,
"restartTriggered": true,
"syncedAt": "2025-04-17T16:30:00Z"
}curl -X POST "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/apps/{appId}/env-vars/sync" \
-H "Authorization: Bearer dor_sk_your_key_here"