Skip to content

Permissions

List the permissions and templates an operator can be given. Requires users:read.

const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };
GET /admin/permissions

Returns 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();

Response: 200 OK

{
"permissions": [
{
"key": "lexicons:create",
"name": "Create Lexicons",
"description": "Upload and register new lexicon schemas",
"category": "Lexicons"
}
],
"templates": [
{
"key": "viewer",
"label": "Viewer",
"permissions": [
"lexicons:read",
"records:read",
"script-variables:read",
"scripts:read",
"users:read",
"api-keys:read",
"backfill:read",
"stats:read",
"events:read",
"metrics:read",
"dead-letters:read"
]
}
]
}

Templates are predefined permission bundles used when creating or updating operators. The order of a template’s permissions is not fixed. See the Permissions guide for the full list.