sota.io

Environment Variables

Manage encrypted environment variables for your projects.

Set Environment Variable

POST /v1/projects/:id/envs
curl -X POST https://api.sota.io/v1/projects/550e8400-.../envs \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"key": "DATABASE_URL", "value": "postgres://..."}'

Uses UPSERT -- if the key already exists, the value is updated.

Request Body

FieldTypeRequiredDescription
keystringYesVariable name
valuestringYesVariable value

Response (200 OK):

{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "project_id": "550e8400-e29b-41d4-a716-446655440000",
    "key": "DATABASE_URL",
    "value": "postgres://...",
    "created_at": "2026-02-25T10:00:00Z",
    "updated_at": "2026-02-25T10:00:00Z"
  }
}

List Environment Variables

GET /v1/projects/:id/envs
curl https://api.sota.io/v1/projects/550e8400-.../envs \
  -H "Authorization: Bearer <token>"

Response:

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "key": "DATABASE_URL",
      "value": "postgres://...",
      "created_at": "2026-02-25T10:00:00Z",
      "updated_at": "2026-02-25T10:00:00Z"
    }
  ]
}

Delete Environment Variable

DELETE /v1/projects/:id/envs/:key
curl -X DELETE https://api.sota.io/v1/projects/550e8400-.../envs/DATABASE_URL \
  -H "Authorization: Bearer <token>"

Returns 204 No Content.

Encryption

All environment variable values are encrypted at rest using AES-256-GCM. They are decrypted only when injected into the container at runtime.

Auto-Injected Variables

These variables are automatically available in every container without manual configuration:

VariableDescription
PORTAlways 8080 -- your app must listen on this port
DATABASE_URLPostgreSQL connection string (only if managed database is provisioned)