Overview
Homarr provides a comprehensive API built on tRPC, enabling type-safe communication between the client and server. The API supports both HTTP requests and WebSocket connections for real-time updates.API Architecture
tRPC Overview
Homarr uses tRPC to provide:- End-to-end type safety - Full TypeScript types from server to client
- Automatic validation - Input validation using Zod schemas
- Efficient data transfer - Using SuperJSON for serialization
- Real-time capabilities - WebSocket subscriptions for live updates
Main API Routers
The Homarr API is organized into the following main routers:| Router | Purpose |
|---|---|
board | Board management, layouts, and permissions |
app | Application management and retrieval |
widget | Widget-specific data and operations |
user | User account and profile management |
integration | Integration management and testing |
group | User group management |
apiKeys | API key generation and management |
invite | User invitation system |
serverSettings | Server configuration |
docker | Docker container management |
kubernetes | Kubernetes cluster integration |
media | Media file management |
icon | Icon search and retrieval |
Accessing the API
The Homarr API can be accessed in three ways:1. tRPC Client (Recommended)
For TypeScript/JavaScript applications, use the tRPC client:2. HTTP REST API
Some endpoints are exposed via OpenAPI-compatible REST endpoints:3. WebSocket Connection
For real-time updates, connect to the WebSocket server:API Versioning
Currently, Homarr does not use explicit API versioning. The API evolves with the application version. Check the changelog for API changes between releases.Rate Limiting
Homarr does not currently implement rate limiting at the API level. However, certain operations may have built-in throttling or caching:- Widget data requests are cached to prevent excessive API calls to external services
- Integration test connections are debounced
- Real-time subscriptions use intelligent polling intervals
Error Handling
The API uses tRPC error codes:| Error Code | Description |
|---|---|
UNAUTHORIZED | User is not authenticated |
FORBIDDEN | User lacks required permissions |
NOT_FOUND | Resource does not exist |
BAD_REQUEST | Invalid input parameters |
CONFLICT | Resource already exists |
INTERNAL_SERVER_ERROR | Server-side error |
Error Response Format
Next Steps
Authentication
Learn how to authenticate API requests
Boards API
Manage boards and layouts
Widgets API
Access widget data and subscriptions
WebSocket API
Real-time updates via WebSocket
