Permissions
const TOKEN = "hv_..."; // your API keyconst headers = { Authorization: `Bearer ${TOKEN}` };const TOKEN = "hv_..."; // your API keyconst headers = { Authorization: `Bearer ${TOKEN}` };let token = "hv_..."; // your API keytoken := "hv_..." // your API key# All examples assume $TOKEN is an API key (hv_...)AUTH="Authorization: Bearer $TOKEN"List permissions
Section titled “List permissions”GET /admin/permissionsReturns all available permission definitions and permission templates. When the Spaces feature flag is disabled, spaces-related permissions and template entries are excluded.
interface PermissionDef { key: string; name: string; description: string; category: string;}
interface PermissionTemplate { key: string; label: string; permissions: string[];}
interface PermissionsResponse { permissions: PermissionDef[]; templates: PermissionTemplate[];}
const response = await fetch("http://127.0.0.1:3000/admin/permissions", { headers,});const data: PermissionsResponse = await response.json();const response = await fetch("http://127.0.0.1:3000/admin/permissions", { headers,});const data = await response.json();let client = reqwest::Client::new();let response = client .get("http://127.0.0.1:3000/admin/permissions") .bearer_auth(token) .send() .await?;let data: serde_json::Value = response.json().await?;req, _ := http.NewRequest("GET", "http://127.0.0.1:3000/admin/permissions", nil)req.Header.Set("Authorization", "Bearer "+token)resp, err := http.DefaultClient.Do(req)curl http://127.0.0.1:3000/admin/permissions -H "$AUTH"Response: 200 OK
{ "permissions": [ { "key": "lexicons:create", "name": "Create Lexicons", "description": "Upload lexicon schemas", "category": "Lexicons" } ], "templates": [ { "key": "viewer", "label": "Viewer", "permissions": ["lexicons:read", "records:read", "stats:read", "events:read"] } ]}Templates are predefined permission bundles used when creating or updating users. See the Permissions guide for the full list.

