Bridge Training

Overview

Bridge Training REST API reference.

Base URL

/api

The API runs as a standalone Hono server (apps/api), typically on port 3001.

Interactive docs

The API serves an interactive Swagger UI at /swagger and the raw OpenAPI spec at /doc.

Endpoint documentation below is auto-generated from the OpenAPI schema via fumadocs-openapi.

Authentication

Two authentication mechanisms are supported depending on the caller:

MethodHeaderUse case
API KeyX-API-Key: <key>Server-to-server (PHP backend)
JWT BearerAuthorization: Bearer <token>Client-side (Clerk-issued tokens)

See Authentication for details.

Error format

All errors follow a consistent JSON shape:

{
  "code": "DEAL_NOT_FOUND",
  "message": "Deal abc-123 not found"
}

Some errors include an optional meta field with additional context. See Errors for the full reference.

Endpoints

Every route mounted by the API router is listed in the sidebar, one page per operation.