RAID API
  1. Sync
  • 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
        GET
      • Upload offline operations
        POST
      • Get sync status
        GET
    • 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
  1. Sync

Download full course data for offline use

GET
https://test.diveraid.com/api/v1/sync/download
Sync
Maintainer:Not configured

Overview#

The download step of the offline mode: the course content of the user's active courses (modules with quiz questions, exam questions, skills), to be used offline and answered back through POST /api/v1/sync/upload. It also carries the exam lock state and the hash of the instructor's unlock code, which the app uses to verify an instructor's unlock QR code offline.
Only course logs whose expire_date is today or later are returned. Correct answers are never sent: scoring is server-side.
Controller: App\Http\Controllers\Api\V1\Sync\SyncController::download()
Route name: api.v1.sync.download

Authentication#

Type: Bearer Token (Sanctum)
Header: Authorization: Bearer {token}

Request#

Method: GET
Path: /api/v1/sync/download
Body: none

Example request#


Response 200 OK#

{
  "success": true,
  "status": "success",
  "message": "OK",
  "data": {
    "synced_at": "2026-10-09T08:00:00+00:00",
    "courses": [
      {
        "log_code": "9d3f6a1b2c4e4f7a8b0c1d2e3f4a5b6c",
        "course": {
          "id": 101,
          "name": "Open Water Diver",
          "code": null,
          "exam_minimum": 20,
          "exam_questions": 25
        },
        "expire_date": "2027-10-09",
        "admin_lock": false,
        "exam_enable": true,
        "is_repetition": false,
        "repetition": null,
        "instructor": {
          "id": 4021,
          "full_name": "Marco Rossi"
        },
        "exam_unlock_hash": "3b1f0c2e5a7d9b4c6e8f0a1b2c3d4e5f60718293a4b5c6d7e8f9012345678abc",
        "modules": [],
        "exam": {
          "questions": [
            {
              "id": 7001,
              "text": "What is the maximum recommended ascent rate?",
              "type": 2,
              "answers": [
                { "id": 9001, "text": "9 m/min" },
                { "id": 9002, "text": "30 m/min" }
              ]
            }
          ]
        },
        "skills": [
          {
            "skill_type_id": 3,
            "name": "Confined water",
            "skills": [
              { "id": 5001, "name": "Mask clearing", "description": "Clear the mask while kneeling." }
            ]
          }
        ]
      }
    ]
  }
}

Response fields#

FieldTypeNullableAlways presentDescription
data.synced_atstringNoYesISO 8601 timestamp of the request
data.coursesarrayNoYesOne item per active course log. Empty when the user has none
data.courses[].log_codestringNoYesCourse log code, the key used by every upload operation
data.courses[].course.idintegerNoYesCourse id
data.courses[].course.namestringNoYesCourse name
data.courses[].course.codestringYesYesCourse code
data.courses[].course.exam_minimumintegerYesYesNumber of correct answers needed to pass the exam
data.courses[].course.exam_questionsintegerYesYesNumber of questions of the exam
data.courses[].expire_datestringYesYesLog expiry, YYYY-MM-DD
data.courses[].admin_lockbooleanNoYesThe exam is locked by an anomaly or by the instructor
data.courses[].exam_enablebooleanNoYesThe exam is enabled for the student
data.courses[].is_repetitionbooleanNoYestrue when the course log repeats a non-certifying course the student already holds (ADR-0029). A repetition needs no quiz, exam or skills, and the write routes refuse them
data.courses[].repetitionobjectYesYesnull unless is_repetition is true
data.courses[].repetition.confirmed_atstringYesWhen repetition is setISO 8601, when the assigned instructor confirmed the in-water dive. null until confirmed
data.courses[].repetition.confirmed_byobjectYesWhen repetition is setid, full_name of the instructor who confirmed. null until confirmed
data.courses[].instructorobjectYesYesThe log's instructor: id, full_name. null when the log has no instructor
data.courses[].exam_unlock_hashstringYesYessha256(unlock code) of the log's instructor, lowercase hex. null when the log has no instructor. See below
data.courses[].modulesarrayNoYesActive modules of the log's course version, each with a random draw of up to quiz_questions questions from its quiz pool (id, text, type, answers[]), without the correct flag
data.courses[].exam.questionsarrayNoYesExam questions of the log's course version (id, text, type, answers[])
data.courses[].skillsarrayNoYesActive skills grouped by skill type: skill_type_id, name, skills[] (id, name, description)

Repetition#

For a log with is_repetition set, the app offers no quiz, exam or skill signing: quiz_submit, exam_submit and skills_sign on it come back from POST /api/v1/sync/upload with status: error. The instructor confirms the in-water dive on the web portal; the app receives repetition.confirmed_at and repetition.confirmed_by with the next download, as the portal shows them.

Offline exam unlock#

The unlock of a locked exam happens in the apps, with no API call. The server holds a secret per user and never sends it.
1.
The instructor's app reads exam_unlock_code from GET /api/v1/profile (professionals only) and shows it as a QR code. The code is HMAC-SHA256(key = secret of the instructor, message = "exam-unlock"), lowercase hex, 64 characters.
2.
The student's app receives exam_unlock_hash in this download and, with the scanned value, computes sha256(scanned value). On a match it unlocks the exam locally and keeps the scanned code and the time of the check.
3.
When the exam is synced, exam_submit on a log the server still holds locked must carry that code (unlock_code) and the time (unlocked_at): the server recomputes the code and accepts the exam only on a match (see POST /api/v1/sync/upload).
Test vector: code 050ee8363ef498bb551bc963d1077d69568336c5c35aa9319af55f2d45623b93 gives exam_unlock_hash e9637bd1e57e4efe4f27470b6e5dd93e96fabd028f5ddd2142d10306cf6847d4.
A rotation of the secret by the instructor invalidates every QR shown or printed so far, and the new hash reaches the students at their next download. When an instructor unlocks from the portal instead, the app receives admin_lock / exam_enable with the next download.

Errors#

401 Unauthorized#

{
  "success": false,
  "status": "error",
  "message": "Unauthenticated"
}
message is Token expired or Invalid token when a bearer token was sent but is expired or unknown.

429 Too Many Requests#

The route sits behind the API rate limiter; the live responses carried x-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.

Notes#

Writes the cache key sync_last:{user_id} (90-day lifetime) after the response is built; GET /api/v1/sync/status reads it.
Question and skill texts are the translated values for the request locale.
The exam questions are the log's exam pool for its course version. Each module's quiz questions are drawn from the module's quiz pool, the same pool the quiz submit endpoints check the submitted questions against.

Source: docs/api/sync/GET_download.md

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or

Responses

🟢200
application/json
Success
Bodyapplication/json

🟠401
🟠429
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://test.diveraid.com/api/v1/sync/download' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Example 1
{
    "status": "success",
    "message": "string",
    "data": {
        "synced_at": "2019-08-24T14:15:22.123Z",
        "courses": [
            {
                "log_code": "string",
                "course": {
                    "id": 0,
                    "name": "string",
                    "code": "string",
                    "exam_minimum": 0,
                    "exam_questions": 0
                },
                "expire_date": "2019-08-24",
                "admin_lock": true,
                "exam_enable": true,
                "is_repetition": true,
                "repetition": {
                    "confirmed_at": "2019-08-24T14:15:22.123Z",
                    "confirmed_by": {
                        "id": 0,
                        "full_name": "string"
                    }
                },
                "instructor": {
                    "id": 0,
                    "full_name": "string"
                },
                "exam_unlock_hash": "string",
                "modules": [
                    {}
                ],
                "exam": {},
                "skills": [
                    {}
                ]
            }
        ]
    }
}
Modified at 2026-10-23 14:39:03
Previous
List student dive logs for a course
Next
Upload offline operations
Built with