RAID API
    • DiveRAID frontend public API
      • Search divers
        POST
      • Search instructors
        POST
      • Search dive centers
        POST
      • Search dive centers by country
        GET
    • DiveRAID rest API V1
      • Auth
        • Register a new user
        • Login and get a Sanctum token
        • Send password reset email
        • Reset password using token
        • Logout and revoke the current token
        • Resend email verification
        • Complete a two-factor login and get a Sanctum token
      • Profile
        • The user resource
        • Get authenticated user profile
        • Update profile
        • Register push token
        • Update password
        • Remove push token
        • Rotate exam unlock code
        • Delete account
        • Update dive center association
      • Diver
        • Shared diver resources
        • Courses
          • List active courses
          • Get exam result
          • Submit course exam
          • Sign skills (diver)
          • Get course detail
          • Submit module quiz
          • List expired courses
          • Get quiz result
          • Get skills progress
        • Free Learnings
          • List enrolled free learnings
          • Get free learning quiz result
          • List available free learning courses
          • Submit free learning module quiz
          • Get free learning detail
          • Enroll in a free learning course
        • Certifications
          • Get certification history
          • Get certification quiz result
          • Get certification exam result
          • Get certification skills
          • List diver certifications
        • Dive Logs
          • Delete dive log
          • Create dive log
          • Update dive log
          • List loggable courses
          • List dive logs (paginated)
          • Get dive log
        • Awards
          • List the recognition cards issued to the user
        • Documents
          • Upload own medical certificate or insurance
          • List own medical certificates and insurance
          • List diver documents
        • Forms
          • List diver forms
        • Medical
          • Get medical questionnaire structure
          • Submit medical questionnaire
        • Store
          • List courses available for purchase
          • Get order status
      • Professional
        • Students
          • List students
          • Get student progress
          • Sign student skills
          • Get student exam result
          • Get student quiz result
          • Get student skills progress
        • Certifications
          • Get certification history
          • Get certification quiz result
          • Get certification exam result
          • Get certification skills
          • List all professional certifications
          • List diver-level certifications
          • List examiner certifications
          • List professional certifications
          • List specialty certifications
          • List trainer certifications
        • Classroom
          • List classrooms
          • Get classroom progress (all students)
          • Get classroom student progress
          • Sign classroom student skills
          • Get classroom student exam result
          • Get classroom student quiz result
          • Get classroom student skills
        • Renewals
          • List renewal courses
          • Get renewal exam result
          • Submit renewal exam
          • Sign renewal skills
          • Renewal status
          • Get renewal progress
          • Submit renewal module quiz
          • Get renewal quiz result
          • Get renewal skills progress
        • Dive Logs
          • Get student dive log
          • Sign student dive log
          • List student dive logs for a course
      • Sync
        • Download full course data for offline use
        • Upload offline operations
        • Get sync status
      • Public
        • List all countries
        • Dive-log enum values with labels in the response language
        • Get country data
        • Get country divisions (states/provinces)
        • List time zone identifiers, optionally narrowed to one country
        • List, search, and radius-search publicly visible dive centres
        • Every publicly visible, geolocated dive centre as a map marker
        • Countries with at least one publicly visible dive centre
        • Full detail of one publicly visible dive centre
      • Library
        • List the RAID document library
        • List the current RAID standards
    • Schemas
      • Frontend API Schema
        • DiverSearch
      • SuccessResponse
      • DiverCertification
      • ValidationErrorResponse
      • TwoFactorChallengeResponse
      • TokenResponse
      • IssuedCertification
      • ErrorResponse
      • DiveLog
      • ExamResult
      • QuizResult
      • CourseLogDetail
      • CourseLog
      • UserProfile
      • SkillProgress
      • Certification
      • PaginatedDiveLogs
      • StoreItem
      • PaymentIntentResponse
      • OrderConfirmResponse
      • OrderStatusResponse
      • InstructorSearch
      • DiveCenterSearch

    DiveRAID rest API V1

    DiveRAID REST API V1#

    Everything under /api/v1/*: the interface the RAID mobile client and any authenticated integration use. 93 operations across six areas.
    This page describes what is true of every endpoint. The per-endpoint files describe what is specific to each. Where the two disagree, the per-endpoint file wins, because it was written against a captured live response.

    1. Base URL and versioning#

    EnvironmentBase URL
    Productionhttps://user.diveraid.com
    Staginghttps://test.diveraid.com
    Every path in this documentation is relative to that host and already includes /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.

    2. Authentication#

    Sanctum personal access tokens. Send the token on every authenticated call:
    Authorization: Bearer 1|raid_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    The token is an opaque string of the form {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.

    Obtaining a token#

    POST /api/v1/auth/login with email and password. The response carries token, token_type and expires_in.
    Send 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.

    Two-factor authentication#

    An account with two-factor authentication enabled does not get a token from 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.

    Lifetime#

    90 days, non-rotating. There is no refresh endpoint and no refresh token: when a token expires the user logs in again. expires_in is returned at login, around 7776000 seconds; treat it as approximate, it is computed at response time and truncates to the second.

    Abilities#

    Tokens are issued with the * ability. Abilities are in place so that scoped tokens can be introduced without a schema change; no endpoint restricts on them today.

    Authorization is separate from authentication#

    A valid token proves who you are. What you may do is decided by the user's role. Endpoints under /api/v1/professional/* require the professional role and return 403 otherwise, regardless of the token.

    Multiple devices#

    Every login issues an independent token. Signing in on a second device does not disturb the first. The account holder can list and revoke individual devices from the web application.

    Token lifecycle#

    EventEffect
    LoginIssues a new token, leaves others alone
    Login, two-factor enabledIssues no token; the challenge issues it
    LogoutRevokes only the token used for the call
    Password change, authenticatedRevokes all others, keeps yours valid
    Password reset, forgot-password flowRevokes all tokens, including yours
    Account suspended, banned or deletedRevokes all tokens
    Revoke from the privacy screenRevokes that one device
    Note the asymmetry between the last two password rows: a password change is performed by someone who proved knowledge of the current password, so their own session survives. A reset is recovery from lost or compromised credentials, where the caller has proved nothing, so nothing is spared.

    Public endpoints#

    Five auth endpoints need no token: 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.

    3. Response envelope#

    Every successful response carries the same four keys.
    {
      "success": true,
      "status": "success",
      "message": "OK",
      "data": { }
    }
    KeyNotes
    successBoolean. Always present
    status"success" or "error". Carries the same information as success; both are kept for compatibility
    messageHuman-readable. "OK" on a plain read, descriptive after a write
    dataThe 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.

    4. Errors#

    Status codes#

    CodeMeaning
    401No token, malformed token, or expired token
    403Authenticated, but the role or ownership check refused
    404Resource not found
    422Validation failure, or a business rule refusing an otherwise valid request
    429Rate limit exceeded
    500Server error. Several endpoints currently return this unconditionally; see section 12

    The standard error shape#

    {
      "success": false,
      "status": "error",
      "message": "Token expired",
      "errors": { }
    }
    errors is present only on validation failures.

    401 in detail#

    All three cases share the shape above; the case is distinguished by message alone:
    messageMeaning
    UnauthenticatedNo Authorization header
    Invalid tokenMalformed, unknown or already revoked
    Token expiredPast its 90 days
    The underlying reason is logged server-side and deliberately not returned.

    422 has two meanings#

    Validation failure carries 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."] }
    }
    Business rule refusal carries no 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"
    }
    Distinguish the two by the presence of errors, not by the status code.

    429 in detail#

    {
      "success": false,
      "status": "error",
      "message": "Too many requests"
    }
    No errors key. A Retry-After header is always present alongside the standard X-RateLimit-* headers. See §5 for which limiter applies to which endpoint.

    Known deviation: eight controllers return Laravel's default validation shape#

    Most endpoints validate through a Form Request and produce the standard envelope. Two controllers still validate inline and produce Laravel's bare default instead, with no success and no status:
    {
      "message": "The country field must be 2 characters.",
      "errors": { "country": ["The country field must be 2 characters."] }
    }
    The controllers concerned are Professional\StoreController and Sync\SyncController. Their endpoint files say so individually.
    Alignment is planned. Until it lands, parse a 422 by looking for errors, never by looking for success.

    Known deviation: ownership refused by a Form Request#

    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." }
    Every other ownership check in the API refuses inside the controller and produces the standard envelope, including 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.

    404 message shape#

    Two kinds, worth knowing when matching on the message:
    Endpoints whose path parameter is a numeric key resolved by route-model binding ({diveLog}, {quiz}, {exam}, {module}, {certification}) include the looked-up id in the message.
    Endpoints resolving an opaque {log_code} manually do not.

    5. Rate limiting#

    ScopeLimit
    register, login, password/forgot, password/reset10 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-challenge5 per minute per challenge and 10 per minute per IP, separate from the shared auth budget
    auth/email/resend6 per minute per authenticated user
    PATCH /api/v1/profile, PATCH /api/v1/profile/passwordThe profile-write limiter: 6 requests per minute per user, shared by the two routes, on top of the api limiter
    All other authenticated endpointsThe 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
    Exceeding a limit returns 429.

    6. Pagination#

    Three endpoints paginate today: 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 }
      }
    }
    The collection sits at 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.
    Every other list endpoint returns its full collection unpaginated. One is large enough to matter: 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.

    7. Identifiers#

    Three kinds, and they are not interchangeable.
    PlaceholderKind
    {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
    One inconsistency worth knowing: the dive centre identifier is called 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.

    8. Dates and time#

    Two formats coexist and must be parsed differently:
    Domain dates are Y-m-d strings: dob, expire_date, renewal_date, gdpr, terms, email_verified_at.
    Record timestamps are full ISO-8601 with microseconds and a UTC offset: created_at, updated_at, for example 2026-09-10T09:21:23.000000Z.
    The user's timezone field is a display preference. The API does not localise timestamps to it; conversion is the client's responsibility.

    9. Money#

    Money is carried in major units as a JSON number with at most two decimals. A course priced at 135 dollars is 135, not 13500.
    This is worth stating because the database stores minor units as integers and the model accessor converts. Anything reading the database directly sees different numbers from anything reading the API.
    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.

    10. Enum fields and localisation#

    Enum-backed fields return the display label in the response language (see "Response language" below), not a machine value; in English: qualification_cast returns Recreational, status returns Account Active, preferred_system returns Metric.
    Three consequences:
    1.
    Do not branch on these strings. They are display text and can change without being a breaking change in anyone's intent.
    2.
    Labels follow the response language, see "Response language" below. Do not branch on them in any language.
    3.
    Writing is asymmetric with reading. 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.
    Returning both parts, {"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.
    One more sentinel to watch for: when no dive centre or distributor is set, dive_center and distributor contain the literal English string Not assigned rather than null.

    Response language#

    Every /api/v1/* response is produced in one language, chosen per request:
    1.
    The authenticated user's default_language, when it is usable.
    2.
    Otherwise the best match of 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.
    3.
    Otherwise en.
    Details:
    Public routes (/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.
    Supported locales: en, ar, de, es, fr, it, ko, nl, pt, tr, zh, pl, ru. Any other value is ignored, never answered with a 406.
    Legacy profile codes are normalized: 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.
    Every response carries 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).
    Translated: validation errors messages, enum labels, translatable course and certification content. Not translated: the message strings of the envelope, Not assigned, country and subdivision names.
    Registration stores the resolved locale as the new user's default_language.
    Translations can be incomplete in a given language: a response may mix the requested language with English fallback.
    The /api/v1/diver, /instructor and /dive_center search routes (§15) are not covered.

    11. Conditional fields#

    Some resources add and remove keys depending on the record. The user resource is the clearest case: a recreational diver receives 50 keys; a suspended professional receives up to 15 more, including the professional block and the account status block.
    Check for a key's presence rather than assuming it. The per-endpoint field tables mark which keys are conditional and on what.
    Emitting every key always, with null where not applicable, is decided and not yet implemented.

    12. Endpoints that do not work today#

    No endpoint in the documented areas is known to be broken today. The crashes previously listed here were fixed; each endpoint file carries its own captured responses.
    One endpoint is still not usable: 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.

    13. Areas#

    AreaOperationsPath
    auth7/api/v1/auth/*
    profile5/api/v1/profile*
    public8/api/v1/public/*
    diver33/api/v1/diver/*
    professional35/api/v1/professional/*
    sync3/api/v1/sync/*
    library2/api/v1/library/*
    professional endpoints require the professional role in addition to a valid token. public endpoints need no token at all - see §14.

    14. Public area (no authentication)#

    /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.

    Rate limiting#

    Every endpoint in this area sits behind a dedicated 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.

    Two identifiers for the same centre#

    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.

    Caching the map and the country list#

    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.

    Coordinate coverage is incomplete#

    A meaningful fraction of dive centres carry unusable coordinates - 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.

    Dive-log options#

    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.

    The registration flow#

    A client builds the registration form from this area: 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).

    The centre detail publishes personal data, unauthenticated#

    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.

    15. What this API does not cover#

    Four search endpoints exist outside this documentation and are not part of V1 in any meaningful sense, despite sharing the /api/v1 prefix:
    POST /api/v1/diver
    POST /api/v1/instructor
    POST /api/v1/dive_center
    GET  /api/v1/dive_center/country
    They authenticate with a shared static key in a token 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.
    If you are building against V1, ignore them.

    16. How this documentation is written#

    Every response shown in these files was captured from a running instance, not transcribed from the source code. That distinction is not pedantry: three earlier descriptions of this API were written by reading controllers, and all three were wrong in the same ways, including a nested data.data wrapper on the profile endpoint that has never existed.
    Where something could not be captured, because the endpoint fails or the data does not exist in any account, the file says so explicitly rather than presenting a reconstruction as observed fact.
    A file is only correct as of the commit that last touched it. When a schema and a live response disagree, the live response is right, and the file is a bug worth reporting.

    17. File URLs expire#

    Every 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.
    The 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).
    Avatars, e_card and logos are not personal documents: their URLs are plain and do not expire.

    Source: docs/api/README.md
    Modified at 2026-12-04 08:05:13
    Previous
    Search dive centers by country
    Next
    Register a new user
    Built with