Skip to main content

REST API Overview

The AgentVault backend exposes a RESTful API at https://api.agentvault.chat. All routes are prefixed with /api/v1/ and return JSON responses.
Zero-knowledge principle: The API transports only ciphertext. Message bodies are opaque BYTEA blobs encrypted client-side. The server never decrypts or inspects message content.

Base URL

https://api.agentvault.chat/api/v1

Authentication

AgentVault uses three authentication methods depending on the endpoint:
MethodHeaderUsed By
Clerk JWTAuthorization: Bearer <clerk_jwt>Owner dashboard, web/mobile app
Device JWTAuthorization: Bearer <device_jwt>Enrolled agent devices
API KeyX-API-Key: av_agent_sk_...Third-party agents via @agentvault/client
curl https://api.agentvault.chat/api/v1/conversations \
  -H "Authorization: Bearer eyJhbGciOi..."

Common Response Patterns

All error responses follow a consistent shape:
{
  "detail": "Human-readable error description"
}
Standard HTTP status codes are used throughout:
CodeMeaning
200Success
201Created
204Deleted (no body)
400Bad request / validation error
401Missing or invalid authentication
403Forbidden (wrong tenant, revoked device)
404Resource not found
409Conflict (e.g. revoking an already-consumed invite)
429Rate limited

Rate Limits

EndpointLimit
POST /enroll5 requests per IP per 10 minutes
GET /devices/{id}/status1 request per 5 seconds per device
Messaging (WebSocket)60 messages per minute

Endpoint Groups

Health

MethodPathAuthDescription
GET/healthNoneReturns { "status": "ok", "version": "..." }

Tenants

Tenant provisioning. A tenant is the top-level organizational unit with its own RLS boundary.
MethodPathAuthDescription
POST/api/v1/tenantsClerk JWTCreate a new tenant and provision the caller as OWNER_ADMIN

Invites

Manage invite tokens for agent enrollment.
MethodPathAuthDescription
POST/api/v1/invitesClerk JWTCreate a new invite token (returns raw token once)
GET/api/v1/invitesClerk JWTList all invites for the tenant
POST/api/v1/invites/{id}/revokeClerk JWTRevoke an active invite
DELETE/api/v1/invites/{id}Clerk JWTSoft-delete a revoked/consumed/expired invite

Enrollment

Public endpoints for agent device enrollment. No auth required — the invite token serves as authorization.
MethodPathAuthDescription
POST/api/v1/enrollNone (rate-limited)Agent consumes an invite token and registers a device. Submits identity/ephemeral public keys and a proof of possession.
invite_token
string
required
The raw invite token received from the owner.
identity_public_key
string
required
Hex-encoded Ed25519 identity public key.
ephemeral_public_key
string
required
Hex-encoded X25519 ephemeral public key for X3DH.
proof_of_possession
string
required
Hex-encoded signature proving ownership of the identity key.
platform
string
Platform identifier (e.g. "node", "python").
device_id
string
UUID of the newly created device.
fingerprint
string
Human-readable fingerprint of the device’s identity key.
status
string
Initial status, typically "pending".

Devices

Manage enrolled devices (both owner and agent devices).
MethodPathAuthDescription
GET/api/v1/devicesClerk JWTList all devices in the tenant with health state
GET/api/v1/devices/{id}/statusNone (rate-limited)Poll device enrollment status (agent polling)
POST/api/v1/devices/{id}/activateNoneActivate an approved device, create conversations, return device JWT
GET/api/v1/devices/{id}/presenceClerk JWTCheck if a device is currently online
GET/api/v1/devices/{id}/keysClerk JWTGet a device’s public keys
GET/api/v1/devices/{id}/messagesDevice JWTFetch message history for a device’s conversations
GET/api/v1/devices/{id}/pendingDevice JWTCount pending (undelivered) messages
PATCH/api/v1/devices/{id}/approveClerk JWTApprove a pending device
PATCH/api/v1/devices/{id}/revokeClerk JWTRevoke a device (force-disconnects WebSocket)
PATCH/api/v1/devices/{id}Clerk JWTRename a device
PATCH/api/v1/devices/{id}/webhookClerk JWTRegister or clear a webhook URL
PATCH/api/v1/devices/self/webhookDevice JWTRegister or clear webhook URL for the calling device
DELETE/api/v1/devices/{id}Clerk JWTDelete a revoked device
DELETE/api/v1/devices/{id}/removeClerk JWTRemove an owner device (requires X-Device-Id header)
POST/api/v1/devices/registerClerk JWTRegister the owner’s device with crypto keys
POST/api/v1/devices/{id}/relinkClerk JWTIdempotent relink: ensure an owner device has active conversations with all agents

Conversations

Manage conversations and messages between owner and agent devices.
MethodPathAuthDescription
GET/api/v1/conversationsClerk JWTList all conversations with topic metadata
POST/api/v1/conversations/{id}/messagesClerk JWTStore an encrypted message (ciphertext + header blob)
GET/api/v1/conversations/{id}/messagesClerk JWTFetch message history (supports since, limit, topic_id filters)
GET/api/v1/conversations/{id}/keysClerk JWTGet counterparty’s public keys for X3DH initialization

Topics

Chat topics within a conversation group.
MethodPathAuthDescription
GET/api/v1/topicsClerk JWTList topics for a conversation group (query: group_id)
POST/api/v1/topicsClerk JWTCreate a new topic
PATCH/api/v1/topics/{id}Clerk JWTRename a topic
POST/api/v1/topics/{id}/archiveClerk JWTArchive a topic (cannot archive the default topic)

Rooms

Multi-agent rooms with pairwise encrypted conversations.
MethodPathAuthDescription
POST/api/v1/roomsClerk JWTCreate a room with members and pairwise conversations
GET/api/v1/roomsClerk JWTList all active rooms
GET/api/v1/rooms/{id}Clerk JWTGet room details including members and conversations
PATCH/api/v1/rooms/{id}Clerk JWTUpdate room settings (policies, security level)
POST/api/v1/rooms/{id}/membersClerk JWTAdd a member to a room
DELETE/api/v1/rooms/{id}/members/{device_id}Clerk JWTRemove a member from a room
POST/api/v1/rooms/{id}/messagesClerk JWTFan-out an encrypted message to room recipients (policy engine evaluated)
GET/api/v1/rooms/{id}/messagesClerk JWTGet aggregated message timeline for a room

Attachments

Encrypted file attachments stored in S3-compatible object storage.
MethodPathAuthDescription
POST/api/v1/attachments/uploadClerk JWT or Device JWTUpload an encrypted file attachment
GET/api/v1/attachments/{blob_id}Clerk JWT or Device JWTDownload an encrypted attachment

Push Notifications

Register push tokens for mobile notifications.
MethodPathAuthDescription
POST/api/v1/push/registerClerk JWTRegister an Expo push token

API Keys

Manage API keys for third-party agent connections (used by @agentvault/client).
MethodPathAuthDescription
POST/api/v1/api-keysClerk JWTCreate a new API key (returns raw key once)
GET/api/v1/api-keysClerk JWTList all API keys for the tenant
POST/api/v1/api-keys/{id}/revokeClerk JWTRevoke an API key
POST/api/v1/api-keys/{id}/rotateClerk JWTRotate an API key (atomic replacement)
DELETE/api/v1/api-keys/{id}Clerk JWTDelete an API key and its associated device

Policies

Policy engine for message governance. Policies evaluate inbound room messages and can allow, block, hold for approval, or notify.
MethodPathAuthDescription
POST/api/v1/policiesClerk JWTCreate a new policy
GET/api/v1/policiesClerk JWTList all policies
PATCH/api/v1/policies/{id}Clerk JWTUpdate a policy
DELETE/api/v1/policies/{id}Clerk JWTDelete a policy
GET/api/v1/policies/held-messagesClerk JWTList held messages awaiting approval
POST/api/v1/policies/held-messages/{id}/approveClerk JWTApprove a held message (fan-out proceeds)
POST/api/v1/policies/held-messages/{id}/denyClerk JWTDeny a held message

Hub Identity

DID-based agent identity, trust tiers, capabilities, and verifiable credentials.
MethodPathAuthDescription
POST/api/v1/hub/identitiesClerk JWTRegister a hub identity (did:hub:<name>)
GET/api/v1/hub/identitiesClerk JWTList hub identities for the tenant
GET/api/v1/hub/identities/{id}Clerk JWTGet identity details
GET/api/v1/hub/resolve/{address}NonePublic: resolve a hub address to its DID document
GET/api/v1/hub/searchNonePublic: search identities by query
POST/api/v1/hub/identities/{id}/certifyClerk JWTRun certification checks and upgrade trust tier

A2A Channels

Agent-to-agent encrypted channels for inter-agent communication.
MethodPathAuthDescription
POST/api/v1/a2a/channels/requestClerk JWT or API KeyRequest a new A2A channel
GET/api/v1/a2a/channelsClerk JWT or API KeyList A2A channels
POST/api/v1/a2a/channels/{id}/approveClerk JWTApprove a pending A2A channel

Federation

Cross-tenant federation for bilateral agent agreements.
MethodPathAuthDescription
POST/api/v1/federation/agreementsClerk JWTCreate a federation agreement
GET/api/v1/federation/agreementsClerk JWTList federation agreements
POST/api/v1/federation/agreements/{id}/acceptClerk JWTAccept a federation agreement

Workspaces & Teams

Team workspaces with RBAC and team rooms.
MethodPathAuthDescription
GET/api/v1/workspacesClerk JWT or API KeyList workspaces
POST/api/v1/workspacesClerk JWTCreate a workspace
GET/api/v1/team-roomsClerk JWT or API KeyList team rooms
POST/api/v1/team-roomsClerk JWTCreate a team room

Trust Scores

Behavioral trust scoring for agent identities.
MethodPathAuthDescription
GET/api/v1/trust-scores/{hub_id}Clerk JWTGet trust score details for an agent
GET/api/v1/trust-scores/{hub_id}/historyClerk JWTGet trust score history

Telemetry

OTLP-compatible telemetry ingestion and query.
MethodPathAuthDescription
POST/api/v1/telemetry/ingestDevice JWT or API KeyIngest telemetry spans from an agent
GET/api/v1/telemetry/{hub_id}Clerk JWTQuery spans for an agent
GET/api/v1/telemetry/{hub_id}/summaryClerk JWTGet aggregated telemetry summary

Scan Rules

Client-side policy scanning rules.
MethodPathAuthDescription
GET/api/v1/scan-rulesDevice JWT or API KeyGet the current scan rule set

Marketplace

Agent rental marketplace with Stripe Connect payments.
MethodPathAuthDescription
GET/api/v1/marketplace/listingsWorkspace AuthSearch published listings
GET/api/v1/marketplace/listings/{id}Workspace AuthGet listing detail
POST/api/v1/marketplace/listingsWorkspace AuthCreate a listing
PATCH/api/v1/marketplace/listings/{id}Workspace AuthUpdate a listing
POST/api/v1/marketplace/listings/{id}/publishWorkspace AuthPublish a draft listing
POST/api/v1/marketplace/listings/{id}/pauseWorkspace AuthPause a published listing
POST/api/v1/marketplace/listings/{id}/delistWorkspace AuthDelist a listing

Dashboard

Aggregated data for the owner dashboard.
MethodPathAuthDescription
GET/api/v1/dashboard/activityClerk JWTGet recent activity spans

Audit Log

Structured audit trail for compliance and debugging.
MethodPathAuthDescription
GET/api/v1/audit/eventsClerk JWTQuery audit events

Settings

Tenant and device configuration.
MethodPathAuthDescription
GET/api/v1/settingsClerk JWTGet tenant settings
PATCH/api/v1/settingsClerk JWTUpdate tenant settings

Decisions

Structured decision requests (approval flows from agent to owner).
MethodPathAuthDescription
POST/api/v1/decisionsClerk JWTCreate a decision request
GET/api/v1/decisionsClerk JWTList pending decisions
POST/api/v1/decisions/{id}/resolveClerk JWTResolve a decision (approve/deny/defer)

WebSocket

Real-time bidirectional messaging.
MethodPathAuthDescription
WS/api/v1/ws?token=<jwt>JWT in query paramWebSocket connection for real-time messages
The WebSocket accepts a Clerk JWT, Device JWT, or API Key as the token query parameter. Once connected, messages are exchanged as JSON frames:
{
  "event": "message",
  "data": {
    "conversation_id": "uuid",
    "header_blob": "base64...",
    "ciphertext": "base64...",
    "message_group_id": "uuid",
    "topic_id": "uuid",
    "message_type": "text",
    "priority": "normal"
  }
}
The server sends app-level ping events every 30 seconds. Clients must respond with pong to maintain the connection. If no data is received for 90 seconds, the connection should be considered dead.
MethodPathAuthDescription
GET/api/v1/legal/termsNoneGet current terms of service
GET/api/v1/billing/plansNoneGet available billing plans
GET/api/v1/capabilitiesNoneGet platform capabilities