Skip to main content

API Reference

The Hono API is served under /api. This page lists routes verified in the Worker source; it does not infer payloads, response shapes, or undocumented error codes.

Authentication and tenant context

Authenticated routes accept Legal Hub’s signed app session either as the pcnaid_access_token cookie or as a bearer token. Send X-Organization-Id when selecting an organization; it is required when the user has more than one active organization membership. Cookie-authenticated POST, PUT, PATCH, and DELETE requests must copy the pcnaid_csrf_token cookie into the X-CSRF-Token header. Bearer-token requests do not use the cookie CSRF check.

Health check

GET /api/health is public and returns the Worker health status, current timestamp, and version.

Public routes

Authenticated resource routes

Upload endpoints

Authenticated request example

Webhook endpoints

Webhook receipts are persisted in webhookEvents with provider and external event IDs for duplicate detection.