/api/v1/*: the interface the RAID mobile client and any authenticated integration use. 93 operations across six areas.| Environment | Base URL |
|---|---|
| Production | https://user.diveraid.com |
| Staging | https://test.diveraid.com |
/api/v1.v1 is the only version. It is expected to change in place rather than be replaced: breaking changes are announced, not versioned away. Anything described here as decided-but-not-implemented will arrive inside v1.Authorization: Bearer 1|raid_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{id}|raid_{random}. It carries no readable payload: do not attempt to decode a user id or an expiry out of it. It is stored server-side, which is what makes individual revocation possible.POST /api/v1/auth/login with email and password. The response carries token, token_type and expires_in.device_name as well. It is optional, but it is the label the account holder sees on their privacy screen when deciding which device to sign out. Without it the server derives something generic from the User-Agent, which on a mobile client is rarely useful.POST /api/v1/auth/login. The response carries data.two_factor: true, a single-use data.challenge_token and data.expires_in: 300. The client sends that challenge_token with either the current authenticator code (code) or one recovery code (recovery_code) to POST /api/v1/auth/two-factor-challenge, which returns the token. The challenge lives 5 minutes and is invalidated after 5 wrong codes; the client then starts again from login. Enabling, confirming and disabling two-factor authentication stay on the website.expires_in is returned at login, around 7776000 seconds; treat it as approximate, it is computed at response time and truncates to the second.* ability. Abilities are in place so that scoped tokens can be introduced without a schema change; no endpoint restricts on them today./api/v1/professional/* require the professional role and return 403 otherwise, regardless of the token.| Event | Effect |
|---|---|
| Login | Issues a new token, leaves others alone |
| Login, two-factor enabled | Issues no token; the challenge issues it |
| Logout | Revokes only the token used for the call |
| Password change, authenticated | Revokes all others, keeps yours valid |
| Password reset, forgot-password flow | Revokes all tokens, including yours |
| Account suspended, banned or deleted | Revokes all tokens |
| Revoke from the privacy screen | Revokes that one device |
POST /api/v1/auth/register, /login, /two-factor-challenge, /password/forgot, /password/reset. All five are rate limited. The whole /api/v1/public/* area needs no token either - see §14.{
"success": true,
"status": "success",
"message": "OK",
"data": { }
}| Key | Notes |
|---|---|
success | Boolean. Always present |
status | "success" or "error". Carries the same information as success; both are kept for compatibility |
message | Human-readable. "OK" on a plain read, descriptive after a write |
data | The payload. Omitted entirely when there is nothing to return, for example after a logout or a delete. Do not expect data: null |
201 Created uses the same shape.| Code | Meaning |
|---|---|
| 401 | No token, malformed token, or expired token |
| 403 | Authenticated, but the role or ownership check refused |
| 404 | Resource not found |
| 422 | Validation failure, or a business rule refusing an otherwise valid request |
| 429 | Rate limit exceeded |
| 500 | Server error. Several endpoints currently return this unconditionally; see section 12 |
{
"success": false,
"status": "error",
"message": "Token expired",
"errors": { }
}errors is present only on validation failures.message alone:message | Meaning |
|---|---|
Unauthenticated | No Authorization header |
Invalid token | Malformed, unknown or already revoked |
Token expired | Past its 90 days |
errors, an object keyed by field name with an array of messages:{
"success": false,
"status": "error",
"message": "Validation failed",
"errors": { "email": ["The email field must be a valid email address."] }
}errors. The request was well-formed; the domain refused it. For example, a professional cannot change dive centre while a renewal is open:{
"success": false,
"status": "error",
"message": "Dive center cannot be changed while a professional renewal is active"
}errors, not by the status code.{
"success": false,
"status": "error",
"message": "Too many requests"
}errors key. A Retry-After header is always present alongside the standard X-RateLimit-* headers. See §5 for which limiter applies to which endpoint.success and no status:{
"message": "The country field must be 2 characters.",
"errors": { "country": ["The country field must be 2 characters."] }
}Professional\StoreController and Sync\SyncController. Their endpoint files say so individually.errors, never by looking for success.PATCH /api/v1/diver/dive-logs/{diveLog} enforces ownership in the Form Request's authorize() rather than in the controller, so its refusal is Laravel's default:{ "message": "This action is unauthorized." }DELETE /api/v1/diver/dive-logs/{diveLog}: it answers 200 with the standard envelope and no data key, and refuses a dive log of another diver, or a signed one, with the standard 403.{diveLog}, {quiz}, {exam}, {module}, {certification}) include the looked-up id in the message.{log_code} manually do not.| Scope | Limit |
|---|---|
register, login, password/forgot, password/reset | 10 requests per minute per IP, shared across all four endpoints (a burst on one counts against the others), counting successes and failures alike |
auth/two-factor-challenge | 5 per minute per challenge and 10 per minute per IP, separate from the shared auth budget |
auth/email/resend | 6 per minute per authenticated user |
PATCH /api/v1/profile, PATCH /api/v1/profile/password | The profile-write limiter: 6 requests per minute per user, shared by the two routes, on top of the api limiter |
| All other authenticated endpoints | The default api limiter: 120 requests per minute per authenticated user |
/api/v1/public/* (no authentication) | The public limiter: 300 requests per minute per IP, shared across the whole public area |
429.GET /api/v1/diver/dive-logs, GET /api/v1/professional/dive-logs/{user}/{log_code}, and GET /api/v1/public/dive-centers.{
"success": true, "status": "success", "message": "OK",
"data": {
"data": [],
"meta": { "current_page": 1, "last_page": 1, "per_page": 20, "total": 0 }
}
}data.data and the pagination at data.meta. There is no links key. per_page is fixed at 20 on the diver/professional dive-log endpoints and not yet accepted as a parameter there. GET /api/v1/public/dive-centers accepts per_page (default 20, maximum 100), plus search, country, and radius search (lat/lng/radius_km) - see §14.GET /api/v1/diver/certifications returns every certification a diver holds, with no cap. Fetch it once and filter client-side rather than calling it per keystroke.| Placeholder | Kind |
|---|---|
{log_code} | Opaque char(32) string identifying a course log or free learning. Not a primary key. Resolved manually by the controller, which performs its own ownership check |
{certification}, {diveLog}, {quiz}, {exam}, {module}, {order}, {classroom} | Numeric primary key, resolved by route-model binding |
{user} | Numeric primary key, on professional endpoints acting on a student |
id by RegisterRequest::dive_center and dive_center_id by PATCH /api/v1/profile/dive-center, while GET /api/v1/public/dive-centers/{raid_id} resolves the same centre by raid_id instead. Same centre, different names depending on which endpoint you call.Y-m-d strings: dob, expire_date, renewal_date, gdpr, terms, email_verified_at.created_at, updated_at, for example 2026-09-10T09:21:23.000000Z.timezone field is a display preference. The API does not localise timestamps to it; conversion is the client's responsibility.135, not 13500.currency is USD on store endpoints and is not negotiable: the diver and professional stores price in US dollars only. The currency field on the user profile is derived from their country and is a display preference, not the currency they will be charged in.qualification_cast returns Recreational, status returns Account Active, preferred_system returns Metric.PATCH /api/v1/profile accepts gender as the numeric enum value while the response returns the label. What you send is not what you get back.{"value": "active", "label": "Active"}, is decided and not yet implemented. GET /api/v1/public/countries already returns that shape and is the model for it.dive_center and distributor contain the literal English string Not assigned rather than null./api/v1/* response is produced in one language, chosen per request:default_language, when it is usable.Accept-Language among the supported locales. Region tags reduce to the language (pt-BR becomes pt, zh-CN becomes zh) and q-weights are honoured.en./api/v1/public/*, and the unauthenticated /api/v1/auth/* endpoints) never resolve the user, even when a bearer token is sent: there the header alone decides. Clients should therefore always send Accept-Language set to the user's language, so public and authenticated responses agree.en, ar, de, es, fr, it, ko, nl, pt, tr, zh, pl, ru. Any other value is ignored, never answered with a 406.cn becomes zh, kr becomes ko, us becomes en. Any other unsupported stored value (id, ms, ja, af, an empty string) is treated as absent, so the header decides.Content-Language: <locale> and Vary: Accept-Language, except the 401, 403 and 429 answered by authentication, account-status and rate-limit checks. Those run before the language is resolved (ThrottleRequests is sorted ahead of authentication by the priority list).errors messages, enum labels, translatable course and certification content. Not translated: the message strings of the envelope, Not assigned, country and subdivision names.default_language./api/v1/diver, /instructor and /dive_center search routes (§15) are not covered.null where not applicable, is decided and not yet implemented.GET /api/v1/diver/free-learnings/{log_code} answers 200 but returns an empty modules array on a course that has modules. It is handled separately; the detail is in its own file.| Area | Operations | Path |
|---|---|---|
auth | 7 | /api/v1/auth/* |
profile | 5 | /api/v1/profile* |
public | 8 | /api/v1/public/* |
diver | 33 | /api/v1/diver/* |
professional | 35 | /api/v1/professional/* |
sync | 3 | /api/v1/sync/* |
library | 2 | /api/v1/library/* |
professional endpoints require the professional role in addition to a valid token. public endpoints need no token at all - see §14./api/v1/public/* needs no Authorization header at all: no bearer token, no API key. It serves the RAID mobile app for the one stretch it has neither - before registration, and before login on a device that has not signed in yet.public limiter (§5): 300 requests per minute, keyed by IP address, since there is never an authenticated user here. The budget is shared across the whole area, not per endpoint. It is higher than the authenticated api limiter because mobile carriers often route many devices through one shared IP address (CGNAT), so one IP can stand for many users.GET /api/v1/public/dive-centers/{raid_id} resolves by raid_id, the human-facing code, and every list/detail payload also carries the numeric id. RegisterRequest::dive_center and UpdateDiveCenterRequest::dive_center_id take that numeric id instead - the same id vs raid_id split already noted in §7 for the rest of V1.GET /api/v1/public/dive-centers/map and GET /api/v1/public/dive-centers/countries carry Cache-Control: public, max-age=900 (15 minutes). Both change slowly enough that a client-side or CDN cache of that length is safe; there is no server-side cache behind them.null, a comma-decimal string, a value outside the valid range, or 0,0. Those centres never appear on GET /api/v1/public/dive-centers/map or in a radius search, and appear in GET /api/v1/public/dive-centers with location: null. Do not assume every listed centre has a map position.GET /api/v1/public/dive-log-options returns the values of the eight dive-log enums with their labels in the response language (§10, Response language). It feeds the dive-log pickers: show the label, send the value back.GET /api/v1/public/countries for the country picker, GET /api/v1/public/countries/{code}/divisions for the state/province picker once a country with divisions is chosen (its value is sent back verbatim as state_select), and GET /api/v1/public/timezones for the timezone picker (its value is sent back as timezone).GET /api/v1/public/dive-centers/{raid_id} includes manager_name - the manager's full name - in a response that needs no token. Nothing else about that user is exposed: no id, email, phone, username or qualification. This is a deliberate trade-off for a public directory feature, not an oversight; treat manager_name as public information when integrating against this endpoint./api/v1 prefix:POST /api/v1/diver
POST /api/v1/instructor
POST /api/v1/dive_center
GET /api/v1/dive_center/countrytoken header rather than a bearer token, serve the public website, and follow none of the conventions on this page: a different envelope, a different error shape, no pagination. They are documented separately under docs/api/search/ and are scheduled to move to their own prefix.data.data wrapper on the profile endpoint that has never existed.url of a personal document (GET and POST /api/v1/diver/documents, GET /api/v1/diver/medical-documents) is an S3 signed URL valid for 60 minutes (X-Amz-Expires=3600). Do not cache or store it: fetch the list again to get a fresh one. After it expires the file answers 403.url of GET /api/v1/library/documents is signed the same way, while the url of GET /api/v1/library/standards is a plain link (the standards disk is public).e_card and logos are not personal documents: their URLs are plain and do not expire.docs/api/README.md