Overview
The folksbase API is a RESTful JSON API built with Hono. Every route is documented using the OpenAPI 3.1 specification, auto-generated from the route definitions themselves. This means the spec is always in sync with the actual code — no manual YAML files to maintain. Two endpoints give you access to the API documentation:| Endpoint | What it returns |
|---|---|
GET /api/openapi.json | Machine-readable OpenAPI 3.1 spec |
GET /api/docs | Interactive Scalar API reference UI |
OpenAPI Spec
The spec is generated at runtime byhono-openapi from the describeRoute() and zValidator() decorators on each route handler. It includes:
- All public endpoints (contacts, tags, imports, exports, settings, stats)
- Request schemas (query params, path params, JSON bodies, form data)
- Response schemas for every status code
- Authentication requirements (Bearer JWT)
- Server URLs for production and local development
What’s excluded
Internal and infrastructure endpoints are intentionally left out of the spec:- Auth webhooks (
/api/webhooks) — called by Supabase, not by API consumers - Inngest routes (
/api/inngest) — background job orchestration, internal only
Scalar API Reference
The interactive docs at/api/docs are powered by Scalar, themed with the “saturn” preset. They provide:
- A searchable list of all endpoints grouped by tag (Contacts, Tags, Imports, Exports, Settings, Stats)
- Request/response schema viewers with example values
- A built-in API client for making live requests directly from the browser
- Authentication configuration — set your Bearer token once and it applies to all requests
Base URLs
The API is available at two servers, both documented in the OpenAPI spec:| Environment | Base URL |
|---|---|
| Production | https://folksbase.onrender.com |
| Local dev | http://localhost:3001 |
/api/. For example, listing contacts is GET /api/contacts.
Next Steps
- Authentication — how to obtain and pass JWT tokens
- Rate Limiting — request limits and headers
- Error Responses — the standard error shape returned by all endpoints