List Environments
GET /v1/environments
Response
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "production",
"display_name": "Production",
"description": "Live production environment",
"color": "#22c55e",
"is_default": true,
"created_at": "2026-01-01T00:00:00.000Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "staging",
"display_name": "Staging",
"description": "Pre-production testing",
"color": "#f59e0b",
"is_default": false,
"created_at": "2026-01-15T10:00:00.000Z"
}
],
"meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}
import { KnoxCall } from "@knoxcall/sdk";
const client = new KnoxCall(); // credentials from `knoxcall login` or KNOXCALL_CLIENT_ID / KNOXCALL_CLIENT_SECRET
const environments = await client.environments.list(); // bare array — not paginated
from knoxcall import KnoxCall
client = KnoxCall() # credentials from `knoxcall login` or KNOXCALL_CLIENT_ID / KNOXCALL_CLIENT_SECRET
environments = client.environments.list() # bare list — not paginated
# Mint a 1-hour OAuth token (client_credentials) — see /api-reference/authentication
TOKEN=$(curl -s -X POST https://api.knoxcall.com/oauth/token \
-u "$KNOXCALL_CLIENT_ID:$KNOXCALL_CLIENT_SECRET" \
-d "grant_type=client_credentials" | jq -r .access_token)
curl https://api.knoxcall.com/v1/environments \
-H "Authorization: Bearer $TOKEN"