API Reference
HTTP API reference for the Wacht Frontend and Platform APIs.
Wacht exposes two distinct HTTP APIs with different purposes, audiences, and authentication models. Understanding which one to use is the first step.
Frontend APIRuntime API on your deployment host, session-authenticated — what the SDKs and browser clients call for sign-in, profiles, organizations, notifications, agents, and OAuth.Backend APIServer-to-server management control plane at api.wacht.dev, API-key authenticated — provision users, configure OAuth apps, run analytics, control webhooks. Never expose to the browser.
Choosing the right API
| Frontend API | Backend API | |
|---|---|---|
| Caller | Browser, mobile, SDK | Your server, CI/CD, admin tooling |
| Authentication | Session cookie or dev query param | Bearer API key |
| Host | Your deployment's frontend host | api.wacht.dev |
| Purpose | User-facing runtime flows | Administrative control plane |
| Exposure | Public-facing | Private — never expose to clients |
| SDK wrappers | Next.js, React Router, TanStack | Node SDK, Rust SDK |
Response format
Both APIs return JSON. Successful responses wrap the payload in a data envelope:
{
"data": { ... }
}List endpoints return paginated results with cursor metadata:
{
"data": [...],
"has_more": true,
"limit": 20,
"offset": "cursor_token"
}Errors follow a consistent shape across both APIs:
{
"error": {
"code": "resource_not_found",
"message": "The requested resource could not be found.",
"status": 404
}
}SDKs
For most use cases you should use an SDK rather than calling the APIs directly. The SDKs handle authentication, session management, and type safety automatically.
| SDK | Language | Wraps |
|---|---|---|
| Next.js | TypeScript | Frontend API |
| React Router | TypeScript | Frontend API |
| TanStack Router | TypeScript | Frontend API |
| Node | TypeScript | Backend API |
| Rust | Rust | Backend API |