RAID API
  1. Dive Logs
  • 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
          DELETE
        • Create dive log
          POST
        • Update dive log
          PATCH
        • List loggable courses
          GET
        • List dive logs (paginated)
          GET
        • Get dive log
          GET
      • 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
  1. Dive Logs

Update dive log

PATCH
https://test.diveraid.com/api/v1/diver/dive-logs/{diveLog}
Diver / Dive Logs
Maintainer:Not configured

Overview#

Updates an existing dive log. Served by DiveLogController::update(). Every field is optional (sometimes) — only submitted keys are changed.
{diveLog} is route-model-bound by primary key. Ownership and lock state are both checked in UpdateDiveLogRequest::authorize(), not in the controller, through DiveLogPolicy::updateOwn() — the only endpoint in this group that refuses this way rather than inside the controller body (contrast GET_show.md and DELETE_destroy.md). A signed dive log (is_signed = true) cannot be updated by anyone, including its owner, and no role (administrator included) bypasses the ownership check.
Controller: App\Http\Controllers\Api\V1\Diver\DiveLogController::update()
Route name: api.v1.diver.dive-logs.update

Authentication#

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

Request#

Method: PATCH
Path: /api/v1/diver/dive-logs/{diveLog}
Content-Type: application/json

Path parameters#

ParameterTypeDescription
{diveLog}integerDive log primary key, route-model-bound

Body#

{
  "end": 10,
  "cylinder_count": 2,
  "bottom_cylinder_volume": 12
}
Every field is sometimes — same field set as POST_create.md (minus dive_number, is_free_diving, purpose_type and the course_log fields, none of which are updatable), each independently optional:
FieldTypeValidation
datestringsometimes|string|date — format "YYYY-MM-DD HH:MM:SS"; an impossible calendar date or time (2026-02-30, 2026-13-01, 25:00) is rejected with 422
location, countrystringsometimes|string
lat, lonnumber, nullablenullable|numeric|between:-90,90|required_with:lon for lat, nullable|numeric|between:-180,180|required_with:lat for lon. Optional; when sent, send both, or both null to clear
dive_type, gasstringsometimes|string|enum — values in POST_create.md → "Enum values"
dive_configstringsometimes|string|enum — values in POST_create.md → "Enum values". Cannot cross the freediving boundary (freediving ↔ any other value): 422 on dive_config. Delete the log and create a new one
weather, water, current, visibilitystring, nullablesometimes|nullable|string|enum — values in POST_create.md → "Enum values"
dive_condition_notes, wetsuit, buddy, verified_by, comments, decompression_notestring, nullablesometimes|string|nullable
group_in, group_outstring, nullablesometimes|nullable|string, one of A to Z
weightsnumber, nullablesometimes|numeric|nullable|min:0|max:100
water_temperaturenumber, nullablesometimes|numeric|nullable|min:-4|max:100
weather_temperaturenumber, nullablesometimes|numeric|nullable|min:-50|max:130
dive_timeintegersometimes|integer|min:5
max_depthnumbersometimes|numeric|min:1|max:660
average_depthnumbersometimes|numeric|min:1 plus the bound by max_depth — see below
sac_ratenumber, nullablesometimes|numeric|nullable
pressure_startnumber, nullablesometimes|nullable|numeric
pressure_endnumber, nullablesometimes|nullable|numeric plus the bound by pressure_start — see below
gas_mixobjectsometimes|required|array:oxygen,nitrogen,helium (an empty {} is rejected); gas_mix.oxygen and gas_mix.nitrogen are required_with:gas_mix|numeric|min:0|max:100, gas_mix.helium is sometimes|numeric|min:0|max:100
safety_stop, has_decompressionboolean, nullablesometimes|boolean|nullable
abtintegersometimes|integer|min:0 plus the bound by dive_time — see below
rntintegersometimes|integer|min:0|max:300
tbtintegersometimes|integer|min:0
ttsinteger, nullablesometimes|integer|nullable|min:0 plus the bound by dive_time — see below
modinteger, nullablesometimes|integer|nullable|min:0 — no cross-check against max_depth
endinteger, nullablesometimes|integer|nullable|min:0 plus the bound by max_depth — see below
cylinder_countinteger, nullablesometimes|nullable|integer
bottom_cylinder_volumenumber, nullablesometimes|nullable|numeric

Bounds against another field#

abt and tts must not exceed dive_time, end and average_depth must not exceed max_depth, and pressure_end must not exceed pressure_start. A partial update does not have to send both fields:
when the request also sends the other field, the new value is the bound (lte:);
otherwise the bound is the value already stored on the dive log, in the diver's units;
when the other field is not sent and nothing is stored (for example pressure_start is null on most dive logs), no bound applies.
gas_mix is replaced as a whole when it is sent, and is always sent and returned as {oxygen, nitrogen, helium} (see POST_create.md).
Validated by App\Http\Requests\Api\V1\Diver\UpdateDiveLogRequest, extends ApiFormRequest — full envelope 422. When country is submitted, region/subregion are recomputed server-side; an invalid code is silently dropped from the update rather than rejected (unset($validated['country']) inside a catch) — the rest of the update still proceeds.

Example request#


Response 200 OK#

Captured live.
{
  "success": true,
  "status": "success",
  "message": "Dive log updated successfully",
  "data": {
    "id": 671996,
    "uuid": "5d02c670-1eaa-4b38-9b84-65fa611be6e1",
    "number": 403,
    "date": "2026-09-17 09:30:00",
    "dive_type": "boat",
    "purpose_type": "fun_dive",
    "location": "Example Reef",
    "country": "IT",
    "lat": null,
    "lon": null,
    "dive_config": "open_circuit",
    "gas": "nitrox",
    "gas_mix": { "helium": 0, "nitrogen": 68, "oxygen": 32 },
    "max_depth": 18,
    "average_depth": 10,
    "depth_unit": "meters",
    "dive_time": 40,
    "abt": 35,
    "rnt": 0,
    "tbt": 35,
    "tts": 0,
    "pressure_start": null,
    "pressure_end": null,
    "pressure_unit": "bar",
    "water_temperature": null,
    "weather_temperature": null,
    "temperature_unit": "celsius",
    "weather": null,
    "water": null,
    "current": null,
    "visibility": null,
    "weights": null,
    "weights_unit": "kilogram",
    "buddy": null,
    "verified_by": null,
    "wetsuit": null,
    "sac_rate": null,
    "safety_stop": false,
    "has_decompression": false,
    "decompression_note": null,
    "mod": 40,
    "end": 10,
    "group_in": "C",
    "group_out": null,
    "comments": null,
    "log_code": null,
    "course_id": null,
    "skill_log_id": null,
    "skill_id": null,
    "instructor_id": null,
    "is_signed": false,
    "signed_at": null,
    "cylinder_count": 2,
    "bottom_cylinder_volume": 12,
    "dive_condition_notes": null
  }
}
Full response is the complete DiveLogResource shape — see _resources.md → "Dive log". The order of the keys inside gas_mix is not significant.

Errors#

401 Unauthorized#

{
  "success": false,
  "status": "error",
  "message": "Unauthenticated"
}

403 Forbidden — not the owner, or the dive log is signed#

Captured live, against a dive log belonging to another user. This is a FormRequest::authorize() failure, not the app's own error shape — no success/status keys, unlike every inline forbidden() call elsewhere in this area (compare GET_show.md's 403).
{
  "message": "This action is unauthorized."
}
The identical shape and status code are returned whether the dive log belongs to another diver or is the diver's own but already signed (is_signed = true) — a client cannot distinguish the two cases from the response alone. This is by design: authorize() answers with a single boolean from DiveLogPolicy::updateOwn(), and the body is Laravel's default for it.

404 Not Found#

A nonexistent id, or a dive log that was deleted (DELETE_destroy.md):
{
  "message": "No query results for model [App\\Models\\Users\\DiveLog] 999999999"
}

422 Unprocessable Entity — validation#

Captured live: max_depth: 5 with average_depth: 10 in the same request.
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "average_depth": ["The average depth field must be less than or equal to 5."]
  }
}

422 Unprocessable Entity — bound by the stored value#

Captured live: abt: 41 sent alone, on a dive log whose stored dive_time is 40.
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "abt": ["The abt field must not be greater than 40."]
  }
}
An unknown enum value or a group outside A-Z is a 422 on that field in the same shape as in POST_create.md.

Notes#

Side effects: updates the DiveLog row, then calls DiveLog::reorder($user) — same reorder as creation, even though number is not itself editable here.
number, uuid, log_code, course_id, skill_log_id, skill_id, instructor_id, is_signed, signed_at are not in the validated field set and cannot be changed through this endpoint.
Text values are trimmed and empty strings become null by the application's global input middleware before validation, so a text field sent as " " arrives as null.
dive_config cannot cross the freediving boundary, in either direction, because that would need the gas, mix and times rewritten. The response is a 422 on dive_config with the message A dive log cannot be switched between freediving and another configuration. Delete it and create a new one. Changes inside the same family (for example open_circuit to sidemount_oc) are accepted.

Source: docs/api/diver/dive-logs/PATCH_update.md

Request

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

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Dive log updated
Bodyapplication/json

🟠401
🟠403
🟠404
🟠422
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://test.diveraid.com/api/v1/diver/dive-logs/' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "date": "2019-08-24",
    "location": "string",
    "max_depth": 0,
    "dive_time": 0,
    "comments": "string",
    "dive_config": "freediving",
    "dive_type": "pool",
    "weather": "sunny",
    "water": "calm",
    "current": "no_current",
    "visibility": "poor",
    "gas": "air",
    "gas_mix": {
        "oxygen": 0,
        "nitrogen": 0,
        "helium": 0
    },
    "group_in": "string",
    "group_out": "string",
    "lat": -90,
    "lon": -180
}'
Response Response Example
200 - Example 1
{
    "status": "success",
    "message": "string",
    "data": {
        "id": 0,
        "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
        "number": 0,
        "date": "2019-08-24",
        "dive_type": "string",
        "purpose_type": "string",
        "location": "string",
        "country": "string",
        "lat": 0,
        "lon": 0,
        "dive_config": "string",
        "gas": "string",
        "gas_mix": {
            "oxygen": 0,
            "nitrogen": 0,
            "helium": 0
        },
        "max_depth": 0,
        "average_depth": 0,
        "depth_unit": "string",
        "dive_time": 0,
        "abt": 0,
        "rnt": 0,
        "tbt": 0,
        "tts": 0,
        "pressure_start": 0,
        "pressure_end": 0,
        "pressure_unit": "string",
        "water_temperature": 0,
        "weather_temperature": 0,
        "temperature_unit": "string",
        "weather": "string",
        "water": "string",
        "current": "string",
        "visibility": "string",
        "weights": 0,
        "weights_unit": "string",
        "buddy": "string",
        "verified_by": "string",
        "wetsuit": "string",
        "sac_rate": 0,
        "safety_stop": true,
        "has_decompression": true,
        "decompression_note": "string",
        "mod": 0,
        "end": "2019-08-24T14:15:22.123Z",
        "group_in": "string",
        "group_out": "string",
        "comments": "string",
        "log_code": "string",
        "course_id": 0,
        "skill_log_id": 0,
        "skill_id": 0,
        "instructor_id": 0,
        "is_signed": true,
        "signed_at": "2019-08-24T14:15:22.123Z",
        "cylinder_count": 0,
        "bottom_cylinder_volume": 0,
        "dive_condition_notes": "string"
    }
}
Modified at 2026-10-08 12:32:14
Previous
Create dive log
Next
List loggable courses
Built with