Replace all global environment variables in the sandbox. This operation clears existing variables and sets new ones.
This replaces ALL environment variables. Use PATCH /env to merge variables instead.
Endpoint
Request
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
Body Parameters
| Parameter | Type | Required | Description |
|---|
env_vars | object | Yes | Dictionary of environment variables |
Example Request
curl -X PUT https://sandbox_abc123xyz.hopx.dev/env \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"env_vars": {
"DATABASE_URL": "postgres://localhost/prod",
"API_KEY": "sk-prod-123",
"DEBUG": "false"
}
}'
Response
Success (204 No Content)
Empty response on success.
Status Codes
| Code | Description |
|---|
| 204 | Variables set successfully |
| 400 | Invalid request |
| 401 | Unauthorized |
Use Cases
Reset Variables
curl -X PUT https://sandbox_abc123xyz.hopx.dev/env \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"env_vars": {
"ENVIRONMENT": "production",
"LOG_LEVEL": "info"
}
}'
Next Steps