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.expire_date is today or later are returned. Correct answers are never sent: scoring is server-side.App\Http\Controllers\Api\V1\Sync\SyncController::download()api.v1.sync.downloadAuthorization: Bearer {token}GET/api/v1/sync/download200 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." }
]
}
]
}
]
}
}| Field | Type | Nullable | Always present | Description |
|---|---|---|---|---|
data.synced_at | string | No | Yes | ISO 8601 timestamp of the request |
data.courses | array | No | Yes | One item per active course log. Empty when the user has none |
data.courses[].log_code | string | No | Yes | Course log code, the key used by every upload operation |
data.courses[].course.id | integer | No | Yes | Course id |
data.courses[].course.name | string | No | Yes | Course name |
data.courses[].course.code | string | Yes | Yes | Course code |
data.courses[].course.exam_minimum | integer | Yes | Yes | Number of correct answers needed to pass the exam |
data.courses[].course.exam_questions | integer | Yes | Yes | Number of questions of the exam |
data.courses[].expire_date | string | Yes | Yes | Log expiry, YYYY-MM-DD |
data.courses[].admin_lock | boolean | No | Yes | The exam is locked by an anomaly or by the instructor |
data.courses[].exam_enable | boolean | No | Yes | The exam is enabled for the student |
data.courses[].is_repetition | boolean | No | Yes | true 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[].repetition | object | Yes | Yes | null unless is_repetition is true |
data.courses[].repetition.confirmed_at | string | Yes | When repetition is set | ISO 8601, when the assigned instructor confirmed the in-water dive. null until confirmed |
data.courses[].repetition.confirmed_by | object | Yes | When repetition is set | id, full_name of the instructor who confirmed. null until confirmed |
data.courses[].instructor | object | Yes | Yes | The log's instructor: id, full_name. null when the log has no instructor |
data.courses[].exam_unlock_hash | string | Yes | Yes | sha256(unlock code) of the log's instructor, lowercase hex. null when the log has no instructor. See below |
data.courses[].modules | array | No | Yes | Active 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.questions | array | No | Yes | Exam questions of the log's course version (id, text, type, answers[]) |
data.courses[].skills | array | No | Yes | Active skills grouped by skill type: skill_type_id, name, skills[] (id, name, description) |
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.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.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.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).050ee8363ef498bb551bc963d1077d69568336c5c35aa9319af55f2d45623b93 gives exam_unlock_hash e9637bd1e57e4efe4f27470b6e5dd93e96fabd028f5ddd2142d10306cf6847d4.admin_lock / exam_enable with the next download.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 Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.sync_last:{user_id} (90-day lifetime) after the response is built; GET /api/v1/sync/status reads it.docs/api/sync/GET_download.mdcurl --location 'https://test.diveraid.com/api/v1/sync/download' \
--header 'Authorization: Bearer <token>'{
"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": [
{}
]
}
]
}
}