Errors
The shape
Every error from /api/external is application/problem+json (RFC 7807) with a stable code. Branch on code, not on title or detail.
{
"type": "about:blank",
"title": "Validation failed",
"status": 422,
"code": "validation_failed",
"detail": "…",
"errors": [{ "field": "customer.name", "message": "This value should not be blank." }]
}
errors appears on validation_failed only, one entry per field.
Codes
| Status | code |
Meaning |
|---|---|---|
| 400 | bad_request |
The body is not valid JSON |
| 401 | unauthorized |
No token, or one that is unknown, expired or revoked: the club disconnected, or the partner is suspended. Refresh once; if that fails, the club has to connect again |
| 403 | forbidden |
The token lacks write, or the club is not the token's (an unknown club id too) |
| 403 | club_suspended |
Milo suspended the club |
| 404 | club_not_found |
The club is not live or was deleted |
| 404 | court_not_found |
Not an active court of this club |
| 404 | sport_not_found |
The sport filter names no sport of this club |
| 404 | booking_not_found |
Unknown, or not your booking at the token's club |
| 409 | slot_unavailable |
Someone booked the slot first |
| 409 | idempotency_conflict |
The Idempotency-Key was used with another body |
| 409 | not_cancellable |
The booking has ended |
| 409 | not_updatable |
The booking is cancelled or has ended |
| 415 | unsupported_media_type |
Send Content-Type: application/json |
| 422 | validation_failed |
A field is missing or wrong: see errors |
| 422 | idempotency_key_required |
POST /bookings without Idempotency-Key |
| 422 | invalid_duration |
The sport does not offer this length |
| 422 | date_out_of_horizon |
The date is beyond the club's booking horizon |
| 422 | range_too_large |
More than 31 days in availability/days |
| 422 | slot_not_bookable |
The slot cannot be booked; detail names why: past_start, date_out_of_horizon, invalid_date, off_grid, outside_hours |
| 429 | rate_limited |
Too many requests: see rate limits |
Each operation's possible codes are listed in the API reference.
OAuth errors
The authorize and token URLs answer as OAuth 2 does (RFC 6749): JSON with error and error_description from /oauth/token, or error and your state on your redirect_uri.
error |
When |
|---|---|
invalid_request |
No PKCE, a method other than S256, a missing parameter, or a token request whose redirect_uri is not the authorize request's |
invalid_scope |
A scope other than read or write |
access_denied |
The owner denied, or the client and the club do not match (sandbox and live) |
invalid_client |
Unknown client, wrong secret, or the partner is suspended |
invalid_grant |
The code expired (60 seconds), was used, or the verifier does not match; a refresh token that expired, was used, or whose club disconnected |