Overview
The Hub API uses RFC 7807 Problem Details for error responses. All errors return a consistent JSON structure with detailed information about what went wrong.Error Response Format
Every error response follows this structure:URI reference identifying the problem type (e.g.,
/errors/not-found)Short, human-readable summary of the problem type
HTTP status code (400, 401, 403, 404, 409, 422, 500)
Human-readable explanation specific to this occurrence
URI reference identifying the specific occurrence (the request path)
ISO 8601 timestamp when the error occurred
Additional context about validation errors (field-specific messages)
Distributed trace ID (only included when
app.expose-trace-id=true)HTTP Status Codes
The API uses standard HTTP status codes:400 Bad Request
The request is malformed or contains invalid data. Common causes:- Invalid JSON syntax
- Missing required fields
- Type mismatches
- Constraint violations
401 Unauthorized
Authentication is required or the provided token is invalid.- Include valid
Authorization: Bearer <token>header - Refresh expired access token
- Verify token audience and issuer
403 Forbidden
Authentication succeeded but the user lacks permission.- Accessing another user’s resources
- Attempting owner actions without venue ownership
- Accessing admin endpoints without admin role
404 Not Found
The requested resource does not exist.409 Conflict
The request conflicts with the current state of the server.422 Unprocessable Entity
The request is well-formed but cannot be processed due to business logic rules.500 Internal Server Error
An unexpected error occurred on the server.When
app.expose-trace-id=true, internal errors include a traceId for debugging. Provide this ID when contacting support.Error Types Reference
Complete list of error types returned by the API:| Error Type | Status | Description |
|---|---|---|
/errors/unauthorized | 401 | Authentication required or token invalid |
/errors/forbidden | 403 | Insufficient permissions |
/errors/validation-error | 400 | Request validation failed |
/errors/malformed-json | 400 | Invalid JSON in request body |
/errors/bad-request | 400 | Invalid request |
/errors/missing-parameter | 400 | Required parameter missing |
/errors/not-found | 404 | Resource not found |
/errors/conflict | 409 | Resource conflict or constraint violation |
/errors/unprocessable | 422 | Business logic rule violation |
/errors/internal-server-error | 500 | Unexpected server error |
Domain-Specific Errors
The API includes domain-specific error handling for different modules:Booking Errors
BookingNotFoundException- 404SlotNotAvailableException- 409BookingCancellationNotAllowedException- 422
Match Errors
MatchNotFoundException- 404InvitationNotFoundException- 404MatchFullException- 422TeamFullException- 422PlayerAlreadyJoinedException- 422PlayerTimeConflictException- 422MatchNotOpenException- 422MatchLeaveNotAllowedException- 422PlayerMatchBannedException- 422TooManyActiveMatchesException- 422MatchCreationCooldownException- 422InvitationAlreadyRespondedException- 422InvitationNotYoursException- 403NotMatchOrganizerException- 403
Venue Errors
VenueNotFoundException- 404VenueImageNotFoundException- 404
Resource Errors
ResourceNotFoundException- 404ResourceImageNotFoundException- 404
User Errors
UserProfileNotFoundException- 404
Best Practices
Handle Errors Gracefully
Always check the HTTP status code and parse the error response:Use Validation Errors
For 400 validation errors, theerrors object maps field names to error messages:
Log Trace IDs
For 500 errors, save thetraceId for support requests:
Testing Error Scenarios
Test common error scenarios:Next Steps
Authentication
Learn about Auth0 OAuth2 authentication
API Endpoints
Explore available API endpoints