Skip to content

API Overview

The Payre API is a REST API served by Fastify. Default base URL: http://localhost:3000.

Authentication

All endpoints (except /health) require an API key via the X-Payre-Key header:

X-Payre-Key: pyr_sk_your_api_key_here

See Authentication for details.

Endpoints

MethodPathDescription
GET/healthHealth check (public)
POST/registerRegister an agent passport
GET/agentsList all agents
GET/agents/:idGet agent details
PUT/agents/:idUpdate agent
DELETE/agents/:idDelete agent
POST/resolveResolve intent to agents
POST/intent/previewParse intent without resolving
POST/grantCreate a grant
GET/grant/:idGet grant details
POST/grant/:id/revokeRevoke a grant
GET/grantsList grants (paginated)
POST/invokeInvoke an agent
GET/invoke/:idGet invocation details
GET/receipts/:idGet receipt
GET/invocationsList invocations (paginated)
GET/statsDashboard statistics
POST/api-keysCreate API key
GET/api-keysList API keys
DELETE/api-keys/:idDeactivate API key

Pagination

List endpoints support pagination:

?page=1&pageSize=20&sortOrder=desc

Response includes:

json
{
  "data": [...],
  "total": 100,
  "page": 1,
  "pageSize": 20,
  "totalPages": 5
}

Error Format

json
{
  "status": "error",
  "message": "Human-readable error message"
}

HTTP status codes: 400 (bad request), 401 (unauthorized), 403 (forbidden), 404 (not found), 409 (conflict).