SDK reference for the Management Keys API, available in Node.js and Python.
Management Keys
List Management Keys
Returns management keys in the current workspace, ordered by creation time with the newest key first. The api_key and token_hash fields are never returned by this endpoint; only token_prefix is included.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.management_keys.list() # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.managementKeys.list(); console.log(result);}run();
Mints a new opaque management key (sk-orq-<key_id>-<secret>) in the workspace. The raw secret is returned ONCE in the response and is never retrievable afterwards. The stored record retains only token_prefix and a SHA-256 token_hash.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.management_keys.create(name="<value>", permission_mode="MANAGEMENT_PERMISSION_MODE_ALL") # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.managementKeys.create({ name: "<value>", permissionMode: "MANAGEMENT_PERMISSION_MODE_ALL", }); console.log(result);}run();
Returns the management capability catalog: the set of workspace-admin permission domains that can be granted to a management key. Each entry includes the domain id, display name, group, and the read / write verb support. Drives the permissions UI in the dashboard.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.management_keys.list_capabilities() # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.managementKeys.listCapabilities(); console.log(result);}run();
Retrieves the metadata for an existing management key by its unique identifier. The raw secret is never returned: only token_prefix, permission_mode, and lifecycle fields.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.management_keys.get(management_key_id="<id>") # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.managementKeys.get({ managementKeyId: "<id>", }); console.log(result);}run();
Permanently deletes a management key. Cache entries are invalidated immediately so an in-flight token cannot ride out the TTL. The response body is empty on success.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.management_keys.delete(management_key_id="<id>") # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.managementKeys.delete({ managementKeyId: "<id>", }); console.log(result);}run();
Show Parameters
{ "management_key_id": str, # required}
{ managementKeyId: string; // required}
Update a Management Key
Updates mutable fields of a management key: display name, status (active / disabled / revoked), permission mode and access map, and expiry. Omitted fields keep their current values.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.management_keys.update(management_key_id="<id>", name="<value>") # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.managementKeys.update({ managementKeyId: "<id>", updateManagementKeyRequest: { name: "<value>", }, }); console.log(result);}run();