Skip to main content

REST API Reference

Base URL: https://api.adjudon.com/api/v1

All responses follow this envelope:

{
"success": true,
"data": {}
}

On error:

{
"success": false,
"error": "Human-readable message",
"code": "ERROR_CODE"
}

Traces

POST /traces

Ingest a decision trace. This is the primary SDK endpoint.

Authentication: X-API-Key: adj_agent_abc123...

Request body:

{
"inputContext": {
"prompt": "What is the capital of France?",
"systemPrompt": "You are a helpful assistant."
},
"outputDecision": {
"action": "llm_response",
"text": "Paris is the capital of France."
},
"metadata": {
"model": "gpt-4o",
"latency_ms": 342
},
"agentId": "my-agent",
"confidence": 0.92,
"rationale": "High-confidence factual response"
}
FieldTypeRequiredDescription
inputContext.promptstringYesThe input the agent received
inputContext.systemPromptstringNoSystem prompt used
outputDecision.actionstringYesAction type (e.g. llm_response, tool_call)
outputDecision.textstringYesThe agent's output text
metadataobjectNoArbitrary key-value pairs
agentIdstringNoOverride the agent ID from the API key scope
confidencenumberNoOverride confidence (0.0–1.0)
rationalestringNoHuman-readable explanation of the decision

Optional headers:

HeaderDescription
Idempotency-KeyPrevent duplicate traces (TTL: 24 hours)
X-Adjudon-VersionPin to a schema version (e.g. 2026-04-11)

Response codes:

StatusCodeMeaning
201Trace approved
202ADJ_FLAGGED_FOR_REVIEWTrace flagged, routed to review queue
403ADJ_BLOCKED_BY_POLICYTrace blocked by policy
409ADJ_DUPLICATE_REQUESTDuplicate idempotency key

201 response:

{
"success": true,
"data": {
"id": "trace_abc123",
"status": "approved",
"confidence": 0.92,
"message": "Trace approved"
}
}

GET /traces

List traces. Paginated.

Authentication: Authorization: Bearer <jwt>

Query parameters:

ParameterTypeDescription
agentIdstringFilter by agent
statusstringFilter by status (approved, flagged, blocked)
fromISO dateStart of date range
toISO dateEnd of date range
pagenumberPage number (default: 1)
limitnumberItems per page (default: 20, max: 100)

GET /traces/:id

Get a specific trace by ID.

Authentication: Authorization: Bearer <jwt>


Agents

GET /agents

List all agents in the organization.

Authentication: Authorization: Bearer <jwt> or X-API-Key


POST /agents

Create a new agent.

Authentication: Authorization: Bearer <jwt>

{
"name": "Customer Support Bot",
"description": "Handles tier-1 customer support queries"
}

GET /agents/:id

Get agent details including analytics.

Authentication: Authorization: Bearer <jwt>


PATCH /agents/:id

Update agent name or description.

Authentication: Authorization: Bearer <jwt>


DELETE /agents/:id

Delete an agent. Associated traces are retained.

Authentication: Authorization: Bearer <jwt>


POST /agents/:id/regenerate-key

Rotate the agent's API key. The old key is immediately invalidated.

Authentication: Authorization: Bearer <jwt>

Response:

{
"success": true,
"data": {
"apiKey": "adj_agent_newkey..."
}
}

Policies

GET /policies

List all active policies.

Authentication: Authorization: Bearer <jwt>


POST /policies

Create a policy.

Authentication: Authorization: Bearer <jwt>

{
"name": "Block PII in outputs",
"description": "Block any trace containing PII in the output",
"outcome": "block",
"conditions": [...]
}

PATCH /policies/:id

Update a policy.

Authentication: Authorization: Bearer <jwt>


DELETE /policies/:id

Delete a policy.

Authentication: Authorization: Bearer <jwt>


GET /policies/templates

Get pre-built policy templates.

Authentication: Authorization: Bearer <jwt>


Review Queue

GET /review-queue

List pending review items. Paginated.

Authentication: Authorization: Bearer <jwt>

Query parameters: agentId, status, assignedTo, page, limit


POST /review-queue/:id/decision

Submit a review decision for a specific item.

Authentication: Authorization: Bearer <jwt>

{
"decision": "approve",
"notes": "Reviewed and confirmed safe"
}

Valid decision values: approve, reject, escalate


POST /review-queue/bulk-decision

Submit the same decision for multiple items.

Authentication: Authorization: Bearer <jwt>

{
"ids": ["item_1", "item_2", "item_3"],
"decision": "approve"
}

Webhooks

GET /webhooks

List all webhooks.

Authentication: Authorization: Bearer <jwt>


POST /webhooks

Create a webhook.

Authentication: Authorization: Bearer <jwt> or X-API-Key

{
"url": "https://your-server.com/adjudon-webhook",
"events": ["review.completed", "trace.blocked"],
"filterAgentId": "my-agent"
}

PATCH /webhooks/:id

Update a webhook URL or events.

Authentication: Authorization: Bearer <jwt>


DELETE /webhooks/:id

Delete a webhook.

Authentication: Authorization: Bearer <jwt> or X-API-Key


Audit Log

GET /audit

Get audit log entries. Paginated.

Authentication: Authorization: Bearer <jwt>

Query parameters: from, to, eventType, userId, page, limit


GET /audit/verify

Verify the integrity of the SHA-256 hash chain.

Authentication: Authorization: Bearer <jwt>

Response:

{
"success": true,
"data": {
"valid": true,
"totalEntries": 4821,
"firstEntry": "2026-01-01T00:00:00.000Z",
"lastEntry": "2026-04-13T12:00:00.000Z"
}
}

OTEL

POST /otel/v1/traces

Ingest OTLP/HTTP spans. Non-GenAI spans are silently dropped.

Authentication: X-API-Key: adj_agent_abc123...

Content-Type: application/json (OTLP JSON format)

Response: OTLP-compatible partialSuccess format.


Health

GET /health

Health check. No authentication required. Always responds in under 100ms.

{
"status": "ok",
"timestamp": "2026-04-13T12:00:00.000Z"
}