New: Agent approvals, red teaming and model scanning. See how
MITRITY
Docs / API / API Overview

API Overview

The MITRITY REST API gives you programmatic access to the full MITRITY platform. Use it to manage agents, policies, audit logs and integrations from your own code.

Base URL

You send all API requests to:

https://api.mitrity.com/api/v1/

The API is versioned in the URL path, and the current version is v1. When breaking changes are introduced, a new version will be released next to the existing one, with a documented migration path.

Authentication

Every API request needs a Bearer token. You 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, and do not expose them in client-side code. Rotate keys regularly, in Settings > API Keys.

Rate Limits

The API counts requests in one-minute windows:

RequestsLimitCounted
The general API, from the dashboard100 a minutePer person: everyone signed in to the dashboard has their own budget
All of your tenant's dashboard sessions together1,000 a minutePer tenant: a ceiling over the per-person budgets
The general API, with an API key100 a minutePer tenant: all of your tenant's API keys share one budget
Invitations, repository scans, evidence bundles and compliance recomputes15 a minutePer tenant, from the dashboard or an API key
Signing in and other unauthenticated endpoints10 a minutePer 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 that gives the seconds until the window resets.

A dashboard request can also be refused because your tenant's sessions together reached their ceiling. That response still reports the person's own limit, with nothing remaining, and its Retry-After gives the seconds until the ceiling's window resets.

Response Format

All responses are JSON, with standard HTTP status codes. A single resource is returned as the object itself. A paged list returns its items in data, together with the paging values:

{
  "data": [ ... ],
  "total": 132,
  "limit": 50,
  "offset": 0
}

Some list endpoints return a plain JSON array instead. The interactive API reference shows the response of each endpoint.

Error responses carry a human-readable message and the HTTP status code:

{
  "error": "agent not found",
  "code": 404
}

Pagination

Paged list endpoints take limit and offset query parameters:

GET /api/v1/agents?limit=25&offset=50

On most of them, limit defaults to 50 and cannot exceed 200. The response's total is the number of items that match, so you have reached the end of the list when offset plus the items returned reaches total.

Key Endpoints

Agents

MethodEndpointDescription
GET/api/v1/agentsList all agents
POST/api/v1/agentsRegister 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

MethodEndpointDescription
GET/api/v1/policiesList all policies
POST/api/v1/policiesCreate 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

MethodEndpointDescription
GET/api/v1/auditQuery 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

MethodEndpointDescription
GET/api/v1/credentialsList credentials (the secret value is never returned)
POST/api/v1/credentialsCreate 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}/grantsList grants on a credential
POST/api/v1/credentials/{id}/grantsGrant an agent access (idempotent: 201 create / 200 update)
DELETE/api/v1/credentials/{id}/grantsRevoke grants: one agent with ?agent_id=, or all without it
POST/api/v1/credentials/{id}/leasesCreate a time-bound lease

See Credential Broker for the full credential → grant → lease model.

Delegation Chains

MethodEndpointDescription
GET/api/v1/delegation-chainsList 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/summaryAggregate counts by status / blocked reason, top initiators / delegates
GET/api/v1/delegation-chains/settingsGet tenant delegation governance settings (Pro+)
PUT/api/v1/delegation-chains/settingsUpdate tenant delegation governance settings (Pro+)

Threat Intelligence

MethodEndpointDescription
GET/api/v1/threat-intelligence/indicatorsList 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}/overrideSet severity / action override (Pro+)
DELETE/api/v1/threat-intelligence/indicators/{id}/overrideClear override and any suppression (Pro+)
POST/api/v1/threat-intelligence/indicators/{id}/suppressSuppress in log-only or silent mode (Pro+)
DELETE/api/v1/threat-intelligence/indicators/{id}/suppressLift suppression (Pro+)
GET/api/v1/threat-intelligence/matchesList threat matches for the tenant
GET/api/v1/threat-intelligence/matches/summaryAggregate match counts by severity / action / type
GET/api/v1/threat-intelligence/trendingIndicators ranked by match volume in a rolling window
GET/api/v1/threat-intelligence/settingsGet tenant feed-subscription + default action
PUT/api/v1/threat-intelligence/settingsUpdate tenant feed-subscription + default action

LLM Usage

MethodEndpointDescription
GET/api/v1/llm-usageList per-call LLM Gateway usage records (filters: agent_id, provider, model, decision, time range)
GET/api/v1/llm-usage/summaryAggregate calls, tokens, and estimated cost grouped by model, agent, or day
GET/api/v1/llm-usage/bomLLM 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 and per-call token caps are authored as policy rules; see the Policies endpoints.

MethodEndpointDescription
GET/api/v1/policies/{id}/budgetGet the policy's LLM budget config (token/USD limit, period, warn %, exceeded action, requests/min); 404 when none
PUT/api/v1/policies/{id}/budgetCreate or update the budget (at least one of token / USD / requests-per-min required)
DELETE/api/v1/policies/{id}/budgetRemove the policy's budget
GET/api/v1/policies/{id}/budget/stateLive burn-down: current-window usage vs limit + status (ok / warn / exceeded)

SIEM destinations

MethodEndpointDescription
GET/api/v1/siem-destinationsList SIEM destinations
GET/api/v1/siem-destinations/{id}Get a SIEM destination
POST/api/v1/siem-destinationsCreate 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):

MethodEndpointDescription
GET/healthzLiveness: 200 while the API process is serving
GET/readyzReadiness: 200 when dependencies (Postgres, Redis) are reachable; 503 when one is down

SDKs and Tools

MITRITY publishes governance adapters for common languages:

  • Python: pip install mitrity
  • Go: go get github.com/mitrity-io/mitrity-go
  • TypeScript: npm install @mitrity/sdk

They are not REST API clients. Each one connects the tool calls an agent's own code or framework makes to the co-located MITRITY edge through the admission API, so those calls are governed before they run. See Framework Adapters.

Interactive API Reference

The interactive API reference covers the full API, with request and response schemas, example payloads and a built-in panel for testing requests.