Introduction
The BillBuddy API is a RESTful API that allows you to manage groups, expenses, and settlements for splitting bills among friends. All API endpoints return JSON responses and use standard HTTP response codes.Base URL
The API is served at:/api. For example, to register a user:
Request Format
Content Type
All POST and PUT requests must include aContent-Type: application/json header and send data as JSON in the request body.
Request Size Limit
The API accepts request payloads up to 10MB in size.Response Format
All API responses are returned in JSON format. Successful responses typically include the requested data directly or wrapped in a response object.Success Response
Authentication Success:Error Handling
The API uses standard HTTP status codes to indicate the success or failure of requests.HTTP Status Codes
Request succeeded. The response body contains the requested data.
Resource successfully created. The response body contains the new resource.
Invalid request data or validation error.
Missing or invalid authentication token.
Authenticated but not authorized to access the resource.
The requested resource does not exist.
An unexpected error occurred on the server.
Error Response Format
Error responses include amessage field describing the error:
Common Error Messages
Validation Errors:CORS Configuration
The API supports Cross-Origin Resource Sharing (CORS) with the following configuration:- Allowed Origins:
http://localhost:5173,http://127.0.0.1:5173 - Allowed Methods: GET, POST, PUT, DELETE, OPTIONS
- Allowed Headers: Content-Type, Authorization, Accept
- Credentials: Supported
Rate Limiting
Currently, the API does not implement rate limiting. This may be added in future versions.Example Request
Here’s a complete example of creating a new expense:Next Steps
Authentication
Learn how to authenticate and obtain access tokens
Groups
Manage groups and their members
Expenses
Create and track expenses