KontextManagementClient is the typed management layer for the Kontext identity control plane. Use it to automate applications, integrations, service accounts, sessions, and traces in CI/CD pipelines, admin tooling, or internal automation.
Install
Initialize
Constructor config
Create service account credentials in the Kontext dashboard under Settings > Service Accounts, or programmatically with
client.serviceAccounts.create().
Resource IDs used by the Management API are UUIDs. OAuth client IDs are separate (app_<uuid> for applications and sa_<uuid> for service accounts).
Applications
Manage applications registered with your organization.List applications
Get an application
Create an application
Update an application
Archive an application
Rotate client secret
OAuth configuration
Manage integrations
Attach or detach integrations from an application. An application can only use tools from its attached integrations.Method reference
Integrations
Manage integrations — the external services your applications connect to.List integrations
Create an integration
Validate an integration
status is one of "pending", "valid", or "invalid".
Method reference
Service accounts
Service accounts provide machine-to-machine credentials for the Management API. Each service account gets aclientId and clientSecret pair.
Create a service account
Rotate credentials
Revoke a service account
Method reference
Sessions
View and manage active MCP sessions for your applications.List sessions
Get a session
Revoke all sessions
Method reference
Traces
Query tool execution traces for observability and debugging.List traces
userId, sessionId, or agentId to narrow results.
Get a trace with events
Trace statistics
Method reference
Events
Query trace events directly, without going through a specific trace.Method reference
Token management
The client handles token lifecycle automatically. Two methods are available for manual control.clearToken() when rotating service account credentials — the client picks up the new secret on the next request.
Complete example
Create an application, set up an integration, and attach them together:Error handling
The management client throws the same error types as the rest of the SDK. See Errors for the full reference.- 401 — Invalid or expired service account credentials. Check your
clientIdandclientSecret. - 403 — Insufficient permissions. The service account may need additional scopes.
- 404 — Resource not found. Verify the ID.
- 429 — Rate limit exceeded. The error includes a
retryAftervalue in seconds.
Next steps
- TypeScript SDK — Overview of all SDK entry points and subpath exports.
- Errors — Full error hierarchy, error codes, and handling patterns.