API Overview
The MITRITY REST API provides programmatic access to the full MITRITY platform. Manage agents, policies, audit logs, and integrations through a consistent, well-documented API.
Base URL
All API requests are made to:
https://api.mitrity.com/api/v1/
The API is versioned via the URL path. The current version is v1. When breaking changes are introduced, a new version will be released alongside the existing version with a documented migration path.
Authentication
All API requests require authentication via a Bearer token. Generate API keys in the MITRITY dashboard at Settings > API Keys.
curl https://api.mitrity.com/api/v1/agents \
-H "Authorization: Bearer mk_your-api-key-here"
An API key starts with mk_ and belongs to one organization. It acts with the current role and access scope of the user who created it, and its scopes can narrow it further; see API Keys.
Edge nodes and agents authenticate their own calls, such as POST /api/v1/delegation-chains/evaluate, with the agent's key in the X-Agent-Key header instead of an API key.
Treat API keys as secrets. Do not commit them to source control or expose them in client-side code. Rotate keys regularly in Settings > API Keys.
Rate Limits
The API counts requests in one-minute windows:
| Requests | Limit | Counted |
|---|---|---|
| The general API, from the dashboard | 100 a minute | Per person: everyone signed in to the dashboard has their own budget |
| All of your tenant's dashboard sessions together | 1,000 a minute | Per tenant: a ceiling over the per-person budgets |
| The general API, with an API key | 100 a minute | Per tenant: all of your tenant's API keys share one budget |
| Invitations, repository scans, evidence bundles and compliance recomputes | 15 a minute | Per tenant, from the dashboard or an API key |
| Signing in and other unauthenticated endpoints | 10 a minute | Per client IP address |
Because dashboard sessions are counted per person, people working in the dashboard do not spend the budget your integrations rely on, and your API keys do not count toward the dashboard's ceiling.
The limit and what is left of it are included in every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 94
When the limit is exceeded, the API returns 429 Too Many Requests with a Retry-After header giving the seconds until the window resets. A dashboard request refused because your tenant's sessions together reached their ceiling still reports the person's own limit, with nothing remaining, and Retry-After gives the seconds until the ceiling's window resets.
Response Format
All responses are JSON. Successful responses use standard HTTP status codes:
{
"data": { ... },
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-03-01T12:00:00Z"
}
}
Error responses include a machine-readable error code and a human-readable message:
{
"error": {
"code": "invalid_request",
"message": "The tool_pattern field is required.",
"request_id": "req_abc123"
}
}
Pagination
List endpoints return paginated results. Use cursor and limit query parameters:
GET /api/v1/agents?limit=25&cursor=eyJpZCI6MTAwfQ
The response includes a next_cursor field. When next_cursor is null, you have reached the end of the list.
Key Endpoints
Agents
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/agents | List all agents |
POST | /api/v1/agents | Register a new agent |
GET | /api/v1/agents/{id} | Get agent details |
PUT | /api/v1/agents/{id} | Update agent configuration (send only the fields to change) |
DELETE | /api/v1/agents/{id} | Deregister an agent |
Policies
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/policies | List all policies |
POST | /api/v1/policies | Create a new policy |
GET | /api/v1/policies/{id} | Get policy details |
PUT | /api/v1/policies/{id} | Update a policy (send only the fields to change) |
DELETE | /api/v1/policies/{id} | Delete a policy |
Audit Log
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/audit | Query audit events. Filter by agent, event type, decision, enforcement surface (agent_hook included), blocking component, traffic type, source, sandbox mode and time range. total counts the events that match every filter |
GET | /api/v1/audit/{id} | Get full event details including drift score and behavioral context |
Credentials
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/credentials | List credentials (the secret value is never returned) |
POST | /api/v1/credentials | Create a credential |
GET | /api/v1/credentials/{id} | Get credential metadata |
PATCH | /api/v1/credentials/{id} | Update a credential (PUT also accepted) |
DELETE | /api/v1/credentials/{id} | Delete a credential (cascades to its grants + leases) |
GET | /api/v1/credentials/{id}/grants | List grants on a credential |
POST | /api/v1/credentials/{id}/grants | Grant an agent access (idempotent: 201 create / 200 update) |
DELETE | /api/v1/credentials/{id}/grants | Revoke grants — one agent via ?agent_id=, or all without it |
POST | /api/v1/credentials/{id}/leases | Create a time-bound lease |
See Credential Broker for the full credential → grant → lease model.
Delegation Chains
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/delegation-chains | List chains for the tenant (filters: agent_id, status, blocked_reason, min_depth, date range) |
GET | /api/v1/delegation-chains/{chain_id} | Get a single chain with all hops |
GET | /api/v1/delegation-chains/summary | Aggregate counts by status / blocked reason, top initiators / delegates |
GET | /api/v1/delegation-chains/settings | Get tenant delegation governance settings (Pro+) |
PUT | /api/v1/delegation-chains/settings | Update tenant delegation governance settings (Pro+) |
Threat Intelligence
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/threat-intelligence/indicators | List indicators visible to the tenant (includes per-tenant overrides) |
GET | /api/v1/threat-intelligence/indicators/{id} | Get a single indicator |
PUT | /api/v1/threat-intelligence/indicators/{id}/override | Set severity / action override (Pro+) |
DELETE | /api/v1/threat-intelligence/indicators/{id}/override | Clear override and any suppression (Pro+) |
POST | /api/v1/threat-intelligence/indicators/{id}/suppress | Suppress in log-only or silent mode (Pro+) |
DELETE | /api/v1/threat-intelligence/indicators/{id}/suppress | Lift suppression (Pro+) |
GET | /api/v1/threat-intelligence/matches | List threat matches for the tenant |
GET | /api/v1/threat-intelligence/matches/summary | Aggregate match counts by severity / action / type |
GET | /api/v1/threat-intelligence/trending | Indicators ranked by match volume in a rolling window |
GET | /api/v1/threat-intelligence/settings | Get tenant feed-subscription + default action |
PUT | /api/v1/threat-intelligence/settings | Update tenant feed-subscription + default action |
LLM Usage
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/llm-usage | List per-call LLM Gateway usage records (filters: agent_id, provider, model, decision, time range) |
GET | /api/v1/llm-usage/summary | Aggregate calls, tokens, and estimated cost grouped by model, agent, or day |
GET | /api/v1/llm-usage/bom | LLM Bill of Materials -- per-agent provider/model inventory with lifetime totals |
LLM Guardrail Budgets
Per-policy LLM cost/rate guardrails enforced by the LLM Gateway (model allowlists + per-call token caps are authored as policy rules; see the Policies endpoints).
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/policies/{id}/budget | Get the policy's LLM budget config (token/USD limit, period, warn %, exceeded action, requests/min); 404 when none |
PUT | /api/v1/policies/{id}/budget | Create or update the budget (at least one of token / USD / requests-per-min required) |
DELETE | /api/v1/policies/{id}/budget | Remove the policy's budget |
GET | /api/v1/policies/{id}/budget/state | Live burn-down: current-window usage vs limit + status (ok / warn / exceeded) |
SIEM destinations
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/siem-destinations | List SIEM destinations |
GET | /api/v1/siem-destinations/{id} | Get a SIEM destination |
POST | /api/v1/siem-destinations | Create a destination (splunk_hec, syslog_cef, webhook or custom) — see SIEM Integration |
PUT | /api/v1/siem-destinations/{id} | Update a destination |
DELETE | /api/v1/siem-destinations/{id} | Remove a destination |
Health & Readiness
Unauthenticated endpoints for load balancers and uptime checks (no /api/v1 prefix):
| Method | Endpoint | Description |
|---|---|---|
GET | /healthz | Liveness — 200 while the API process is serving |
GET | /readyz | Readiness — 200 when dependencies (Postgres, Redis) are reachable; 503 when one is down |
SDKs and Tools
Official SDKs are available for common languages:
- Python:
pip install mitrity - Go:
go get github.com/mitrity/mitrity-go - TypeScript:
npm install @mitrity/sdk
Each SDK wraps the REST API with typed methods, automatic pagination, retry logic, and token management.
Interactive API Reference
Explore the full API with request/response schemas, example payloads, and a built-in request testing panel in the interactive API reference.