Response Format
Content Type
All API responses are returned as JSON with Content-Type: application/json.
Success Responses
Successful responses return the requested data directly:
{
"id": 1,
"name": "Summer in Paris",
"status": "planning"
}
For list endpoints, an array is returned:
[
{ "id": 1, "name": "Trip A" },
{ "id": 2, "name": "Trip B" }
]
Error Responses
Error responses follow a consistent format:
{
"error": "Error message describing what went wrong"
}
Some endpoints may include additional details:
{
"error": "Validation failed",
"details": {
"name": "Name is required",
"startDate": "Invalid date format"
}
}
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 201 | Created - Resource created successfully |
| 204 | No Content - Success with no response body |
| 400 | Bad Request - Invalid parameters or request body |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Insufficient permissions for this action |
| 404 | Not Found - Resource doesn't exist |
| 409 | Conflict - Resource conflict (e.g., revision mismatch) |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Something went wrong on our end |
Pagination
List endpoints that return many items support pagination:
GET /api/trips?page=1&limit=20
Paginated responses include metadata:
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"totalPages": 3
}
}
Timestamps
All timestamps are returned in ISO 8601 format with UTC timezone:
2024-01-15T10:30:00Z