Hippocortex API Overview

The Hippocortex REST API provides programmatic access to the memory platform. All SDK operations map directly to API endpoints.


Base URL

https://api.hippocortex.dev/v1

For self-hosted deployments, replace with your instance URL.


Authentication

Every request must include an authentication header:

Authorization: Bearer <token>

Two token types are supported:

Token TypeFormatSource
API Keyhx_live_*, hx_test_*Dashboard or API Keys endpoint
JWTClerk JWTClerk authentication flow

See Authentication for details.


Request/Response Format

Request

  • Content-Type: application/json
  • Accept: application/json
  • All request bodies are JSON objects

Response Envelope

Every response follows the same structure:

{
  "ok": true,
  "data": { ... },
  "meta": {
    "requestId": "req-abc123",
    "tenantId": "tenant-xyz",
    "durationMs": 12
  }
}

Error response:

{
  "ok": false,
  "error": {
    "code": "validation_error",
    "message": "type is required and must be a string",
    "details": [
      { "field": "type", "message": "type is required and must be a string" }
    ]
  }
}

Rate Limiting

Requests are rate-limited per API key based on the account plan:

PlanRequests/MinuteBurst AllowanceMonthly Events
Free60101,000
Developer60010050,000
Pro3,000500500,000
EnterpriseUnlimitedUnlimitedUnlimited

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 600
X-RateLimit-Remaining: 594
X-RateLimit-Reset: 1709251200

Rate Limit Exceeded

When the limit is exceeded, the API returns HTTP 429:

{
  "ok": false,
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Retry after 12 seconds."
  }
}

Include the Retry-After header value in your backoff logic.


Error Codes

CodeHTTP StatusDescription
validation_error400Request body failed validation
unauthorized401Missing, expired, or invalid credentials
forbidden403Authenticated but insufficient permissions
not_found404Requested resource does not exist
conflict409Duplicate resource (idempotency)
rate_limited429Too many requests
internal_error500Server-side error

Pagination

List endpoints use cursor-based pagination:

Request:

GET /v1/artifacts?limit=20&cursor=eyJpZCI6ImFydC0wMjAifQ

Response:

{
  "ok": true,
  "data": {
    "artifacts": [...],
    "pagination": {
      "hasMore": true,
      "cursor": "eyJpZCI6ImFydC0wNDAifQ",
      "total": 156
    }
  }
}
  • limit: Number of items per page (default: 20, max: 100)
  • cursor: Opaque cursor from the previous response
  • hasMore: Whether more pages exist
  • total: Total item count (when available)

Tenant Isolation

All API operations are scoped to the authenticated tenant:

  • Tenant ID is extracted from the authentication token (not from request parameters)
  • No cross-tenant data access is possible
  • Enterprise organizations add an additional scoping layer via X-Organization-ID header

Enterprise Organization Header

For enterprise endpoints, include the organization context:

X-Organization-ID: org-123

This header is required for organization-scoped endpoints (teams, agents, namespaces, policies, audit).


Endpoints Summary

Core Endpoints

MethodEndpointDescriptionAuth
POST/v1/captureCapture single eventAPI Key
POST/v1/capture/batchCapture batch of eventsAPI Key
POST/v1/learnTrigger memory compilationAPI Key
POST/v1/synthesizeSynthesize contextAPI Key
GET/v1/artifactsList artifactsAPI Key
GET/v1/artifacts/:idGet artifactAPI Key
GET/v1/usage-metricsGet usage metricsAPI Key

Authentication & Account

MethodEndpointDescriptionAuth
POST/v1/auth/registerRegister new accountNone
POST/v1/auth/loginLoginNone
GET/v1/api-keysList API keysJWT
POST/v1/api-keysCreate API keyJWT
DELETE/v1/api-keys/:idRevoke API keyJWT

Vault

MethodEndpointDescriptionAuth
POST/v1/vaultsCreate vaultJWT
GET/v1/vaultsList vaultsJWT
POST/v1/vaults/:id/itemsCreate vault itemJWT
GET/v1/vaults/:id/itemsList vault itemsJWT
POST/v1/vaults/:id/items/:itemId/revealReveal secretJWT
GET/v1/vaults/:id/auditVault audit logJWT

Enterprise

MethodEndpointDescription
POST/v1/organizationsCreate organization
GET/v1/organizationsList organizations
POST/v1/organizations/:orgId/teamsCreate team
POST/v1/organizations/:orgId/members/inviteInvite member
POST/v1/organizations/:orgId/agentsCreate agent identity
POST/v1/organizations/:orgId/namespacesCreate namespace
POST/v1/organizations/:orgId/policiesCreate policy
GET/v1/organizations/:orgId/auditQuery audit logs
GET/v1/organizations/:orgId/lineage/:memoryIdGet memory lineage
POST/v1/organizations/:orgId/lifecycle-policiesCreate lifecycle policy

See individual endpoint documentation for complete request/response schemas.


Health Check

GET /health

Returns system health status (no authentication required):

{
  "status": "healthy",
  "version": "1.0.0",
  "postgres": "connected",
  "redis": "connected",
  "uptime": 86400
}

Prometheus Metrics

GET /metrics

Returns Prometheus-format metrics for monitoring (no authentication required in internal network).