API Reference
The ioenv HTTP API provides programmatic access to environment variables and secrets. All endpoints require authentication via an API token.
Base URL
https://api.ioenv.com/api/v1Authentication
Include your API token in the Authorization header:
Authorization: Bearer ioenv_xxxxxxxxxxxxTokens are scoped to a single project. Create tokens via the dashboard or CLI (ioenv token create).
Endpoints
Export Variables
Export all variables for an environment as a .env formatted string.
GET /env/{envId}/variables/exportResponse:
API_URL=https://api.internal
DB_HOST=db.cluster.local
OPENAI_KEY=sk-proj-xxxxxxxxxxxxList Variables
List all variables in an environment.
GET /env/{envId}/variablesResponse:
json
{
"variables": [
{
"key": "API_URL",
"value": "https://api.internal",
"isSecret": false,
"updatedAt": "2025-01-15T10:30:00Z"
}
]
}Set Variable
Create or update a variable.
PUT /env/{envId}/variables/{key}Body:
json
{
"value": "https://api.internal",
"isSecret": false
}Delete Variable
DELETE /env/{envId}/variables/{key}List Environments
GET /project/{projectId}/environmentsResponse:
json
{
"environments": [
{ "id": "env_abc", "name": "_base" },
{ "id": "env_def", "name": "dev" },
{ "id": "env_ghi", "name": "staging" },
{ "id": "env_jkl", "name": "prod" }
]
}Error Responses
All errors follow a consistent format:
json
{
"error": {
"code": "NOT_FOUND",
"message": "Environment not found"
}
}| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API token |
| 403 | FORBIDDEN | Token lacks required permissions |
| 404 | NOT_FOUND | Resource not found |
| 422 | VALIDATION_ERROR | Invalid request body |
| 429 | RATE_LIMITED | Too many requests |