API reference
Clay’s HTTP surface is described by an OpenAPI 3.1 document and validated at the edge by Zod schemas. The OpenAPI document lives atapps/backend/openapi/openapi.yaml and is regenerated from the route handlers.
Schema sources
Hono app
apps/backend/src/index.tsExporter
apps/backend/scripts/export-openapi.tsGenerated contract
apps/backend/openapi/openapi.yamlImplemented endpoints
| Method | Path | Operation | Tag | Response | Purpose |
|---|---|---|---|---|---|
GET | / | getRoot | health | text/plain string | Minimal backend hello response. |
GET | /health | getHealth | health | HealthResponse JSON | Backend health check. |
GET | /openapi.json | — (runtime) | — | OpenAPI 3.1 document | Live document for ad-hoc debugging. |
ErrorResponse JSON for unmatched routes via the shared notFound handler.
Registered schemas
| Schema | Shape | Where it is used |
|---|---|---|
HealthResponse | { status: "ok", service: "clay-backend" } | 200 response of GET /health |
ErrorResponse | { error: string } | 404 responses on GET /, GET /health, and the shared notFound handler |
| Inline plain string | z.string().openapi({ example: "Hello, world!" }) | 200 response of GET / (text/plain) |
.openapi("<Name>") appear under components.schemas in the generated
YAML. Inline Zod chains stay inline for single-use shapes.
Local validation
Naming convention
Prefer explicit multi-word names such as
opportunityRoutes, IntentionSignalSchema, and
OpportunityRecommendationSchema. Avoid single-word or vague names.Planned schemas
When the opportunity surface lands, names should follow the AGENTS.md guidance:
opportunityRoutes, IntentionSignalSchema, OpportunityRecommendationSchema,
PersonalitySignalSchema. Until then, the public surface is the routes and schemas in the tables
above.Related
Backend overview
The Hono + OpenAPI contract, layout, and deployment boundaries.
Architecture
Where this backend sits inside the Turborepo surface layout.
Deploy
The Wrangler commands used to publish the Worker.

