Introduction
The Home Manager API is a RESTful API that allows you to manage household tasks, bills, shopping lists, maintenance items, and more. All endpoints require authentication through Clerk.Base URL
All API requests should be made to:Authentication
All API endpoints require authentication using Clerk. The API uses Clerk’s server-side authentication to validate requests.How Authentication Works
- The API uses
@clerk/nextjs/serverfor authentication - Each request is validated using
auth()orgetAuth(req)from Clerk - The authenticated user’s
userIdandemailare extracted from the session - Users are automatically associated with a household upon authentication
Required Headers
When making requests from your frontend application, ensure Clerk’s session token is included in the request headers. Clerk’s client libraries handle this automatically.Household Context
All resource endpoints (chores, bills, shopping, maintenance) automatically scope data to the authenticated user’s household:- When you make a request, the API calls
getOrCreateHousehold(userId, email) - If the user doesn’t have a household, one is created automatically
- All data operations are filtered by
householdIdto ensure data isolation
Common Response Formats
Success Response
Most successful requests return JSON data:Error Responses
Returned when authentication fails or user session is invalid.
Returned when required fields are missing or invalid.
Returned when an unexpected server error occurs.
Error Handling
All endpoints follow a consistent error handling pattern:- 401 Unauthorized: User is not authenticated or session is invalid
- 400 Bad Request: Missing required fields or invalid data
- 404 Not Found: Resource not found or doesn’t belong to user’s household
- 500 Internal Server Error: Unexpected server error
Example Error Handling
Rate Limiting
Currently, there are no rate limits enforced on the API. However, it’s recommended to implement client-side throttling for frequent operations.Data Types
Common Fields
Most resources include these common fields:Pagination
Most list endpoints do not implement pagination and return all items for the household. The audit log endpoint supports optional pagination.Reordering Items
Many endpoints (chores, bills, shopping, maintenance) support reordering items by position:position field for each item based on array index.
Notifications
When certain actions occur (deleting items, completing tasks), the API automatically creates notifications:- Completing a chore creates a “Chore Completed” notification
- Paying a bill creates a “Bill Paid” notification
- Completing a shopping item creates an “Item Removed” notification
- Finishing maintenance creates a “Maintenance Completed” notification
Next Steps
Explore the specific API endpoints:- Chores API - Manage household chores
- Bills API - Track and pay bills
- Shopping API - Manage shopping lists
- Maintenance API - Track home maintenance
- Household API - Manage household members
- Notifications API - View and manage notifications
- Audit Log API - Track user activities