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

Create dive log

POST
https://test.diveraid.com/api/v1/diver/dive-logs
Diver / Dive Logs
Maintainer:Not configured

Overview#

Creates a new dive log for the authenticated diver. Served by DiveLogController::store(), which delegates the creation to App\Actions\DiveLogs\CreateDiveLog, the same action the offline sync dive_log_create operation uses (see docs/api/sync/POST_upload.md). The dive's number and unit fields (depth_unit, weights_unit, pressure_unit, temperature_unit) are always server-computed, never taken from the request.
Controller: App\Http\Controllers\Api\V1\Diver\DiveLogController::store()
Route name: api.v1.diver.dive-logs.store

Authentication#

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

Request#

Method: POST
Path: /api/v1/diver/dive-logs
Content-Type: application/json

Body#

{
  "dive_number": 1,
  "date": "2026-09-17 09:30:00",
  "dive_config": "open_circuit",
  "dive_type": "boat",
  "location": "Example Reef",
  "country": "IT",
  "dive_time": 40,
  "max_depth": 18,
  "average_depth": 10,
  "is_free_diving": false,
  "purpose_type": "fun_dive",
  "gas": "nitrox",
  "gas_mix": { "oxygen": 32, "nitrogen": 68, "helium": 0 },
  "mod": 40,
  "abt": 35,
  "rnt": 0,
  "tbt": 35,
  "group_in": "C"
}
FieldTypeRequiredValidationDescription
dive_numberintegerYesrequired|integerValidated but discarded. The controller computes number itself as $user->diveLogs()->count() + 1, then renumbers by date — see Notes
datestringYesrequired|string|dateFormat "YYYY-MM-DD HH:MM:SS" (any format PHP strtotime() reads is accepted). An impossible calendar date or time (2026-02-30, 2026-13-01, 25:00) is rejected with 422
dive_configstringYesrequired|string|enumOne of the values in the table below
dive_typestringYesrequired|string|enumOne of the values in the table below
locationstringYesrequired|string
countrystringYesrequired|stringISO 3166-1 alpha-2, resolved server-side to region/subregion. Returns 422 with "Invalid country code" if the code doesn't resolve — see Errors
latnumberNonullable|numeric|between:-90,90|required_with:lonDecimal degrees. Send together with lon. Returned as a number
lonnumberNonullable|numeric|between:-180,180|required_with:latDecimal degrees. Send together with lat. Returned as a number
dive_timeintegerYesrequired|integer|min:5Minutes
max_depthnumberYesrequired|numeric|min:1|max:660
average_depthnumberYesrequired|numeric|min:1|lte:max_depth
is_free_divingbooleanYesrequired|booleanGates an entire block of otherwise-required fields — see below. Must be true when dive_config is freediving and false for every other configuration; a mismatch is a 422 on is_free_diving
purpose_typestringYesrequired|string|enumfun_dive or course_log. course_log makes log_code, skill_id and instructor_id required and scoped to the diver — see below
weather / water / current / visibilitystringNosometimes|nullable|string|enumOne of the values in the table below
dive_condition_notes / wetsuit / buddy / verified_by / commentsstringNosometimes|string|nullablePassed through importString(): trimmed, and an empty result is stored as null
weightsnumberNosometimes|numeric|nullable|min:0|max:100
water_temperaturenumberNosometimes|numeric|nullable|min:-4|max:100
weather_temperaturenumberNosometimes|numeric|nullable|min:-50|max:130
sac_ratenumberNosometimes|numeric|nullable

Enum values#

Only these machine values are accepted. A display label such as "Open Circuit" is rejected with 422.
FieldAccepted values
dive_configfreediving, open_circuit, semi_close_rebreather, close_circuit_rebreather, sidemount_oc, sidemount_ccr
dive_typepool, shore, boat, altitude, overhead
purpose_typefun_dive, course_log
weathersunny, cloudy, foggy, rainy, storm
watercalm, choppy, heavy, rough, stormy
currentno_current, light, moderate, strong
visibilitypoor, sufficient, good, excellent
gasair, nitrox, trimix, triox

When is_free_diving is false#

As in the example above, these become additionally required or available:
FieldValidationDescription
gasrequired|string|enumValues in the table above
gas_mixrequired|array:oxygen,nitrogen,heliumOnly these three keys are accepted; any other key, o included, is a 422. An empty {} is rejected
gas_mix.oxygen / gas_mix.nitrogenrequired_with:gas_mix|numeric|min:0|max:100Required whenever gas_mix is sent
gas_mix.heliumsometimes|numeric|min:0|max:100Optional; stored as 0 when omitted
cylinder_countsometimes|nullable|integer
bottom_cylinder_volumesometimes|nullable|numeric
pressure_startsometimes|nullable|numeric
pressure_endsometimes|nullable|numeric|lte:pressure_start
ttssometimes|integer|nullable|min:0|lte:dive_time
modsometimes|integer|nullable|min:0Maximum operating depth. No cross-check against max_depth: a dive may be logged deeper than its MOD
endsometimes|integer|nullable|min:0|lte:max_depthEquivalent narcotic depth
safety_stop / has_decompressionsometimes|boolean|nullableStored as false when omitted
decompression_notesometimes|string|nullablePassed through importString()
group_in / group_outsometimes|nullable|string, one of A to ZA single uppercase letter. Lowercase, several characters or digits are a 422; null is accepted. Passed through importString()
abtrequired|integer|min:0|lte:dive_time
rntrequired|integer|min:0|max:300
tbtrequired|integer|min:0
None of these rules apply when is_free_diving is true.
gas_mix is sent and returned as {oxygen, nitrogen, helium}. Internally it is stored as {o, n, h}; the translation happens at the API boundary and is not visible to the client.

When purpose_type is course_log#

FieldValidationDescription
log_coderequired|string, one of the diver's loggable course logsA course log of the diver that is not expired, whose exam is passed and that still has skills left to log
skill_idrequired|integer, one of that course log's loggable skills
instructor_idrequired|integer, the course log's instructorA course log without an instructor can never be used for a course_log dive
Anything else, including the log_code of another diver, is a 422 on the offending field. These three rules were not captured live in this pass; they are covered by the test suite.
Validated by App\Http\Requests\Api\V1\Diver\CreateDiveLogRequest, extends ApiFormRequest — full envelope 422.

Example request#


Response 201 Created#

Captured live. Note mod (40) deeper than max_depth (18): accepted.
{
  "success": true,
  "status": "success",
  "message": "Dive log created 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": { "oxygen": 32, "nitrogen": 68, "helium": 0 },
    "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": null,
    "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": null,
    "bottom_cylinder_volume": null,
    "dive_condition_notes": null
  }
}
Full field table: _resources.md → "Dive log".

Errors#

401 Unauthorized#

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

422 Unprocessable Entity — validation#

Captured live, submitted with gas_mix omitted while is_free_diving was false.
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "gas_mix": ["The gas mix field is required."]
  }
}

422 Unprocessable Entity — unknown enum value#

Captured live, submitted with "gas": "helium" (not a gas type). Every enum field fails the same way, with The selected <field> is invalid.; before this check an unknown value ended in a 500.
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "gas": ["The selected gas is invalid."]
  }
}

422 Unprocessable Entity — group outside A-Z#

Captured live, submitted with "group_in": "a".
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "group_in": ["The selected group in is invalid."]
  }
}

422 Unprocessable Entity — invalid country code#

Emitted by the controller via error(..., 422), not the FormRequest — same full envelope shape, different origin. Not re-captured live in this pass (would require an intentionally malformed country value); documented from store()'s explicit catch block.
{
  "success": false,
  "status": "error",
  "message": "Invalid country code"
}

Notes#

Side effects: creates a DiveLog row, then calls DiveLog::reorder($user).
dive_number is required by validation but its value is never used: the server computes the actual number from the diver's existing dive count and then renumbers every dive log by date, so the number in the response can change on the next create or delete. Clients should not rely on controlling this field.
region and subregion are derived server-side from country via the country() helper and are not accepted directly.
Text fields go through importString() (app/Helpers/HelperFunctions.php): the value is trimmed, and a value that is empty after trimming is stored as null.
The same rule set validates the dive_log_create operation of POST /api/v1/sync/upload.
is_free_diving must agree with dive_config. A mismatch is a 422 on is_free_diving with the message The is free diving field must be true when dive config is freediving and false otherwise. The same rule applies to the dive_log_create operation of POST /api/v1/sync/upload.
Course dive dropdowns: GET /api/v1/diver/dive-logs/loggable-courses lists the log_code, instructor_id and skill_id values this endpoint accepts for a course_log dive.

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

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Dive log created
Bodyapplication/json

🟠401
🟠422
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://test.diveraid.com/api/v1/diver/dive-logs' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "dive_number": 0,
    "date": "2019-08-24",
    "dive_config": "freediving",
    "dive_type": "pool",
    "purpose_type": "fun_dive",
    "location": "string",
    "country": "string",
    "lat": -90,
    "lon": -180,
    "max_depth": 0,
    "average_depth": 0,
    "depth_unit": "string",
    "dive_time": 0,
    "gas": "air",
    "gas_mix": {
        "oxygen": 0,
        "nitrogen": 0,
        "helium": 0
    },
    "pressure_start": 0,
    "pressure_end": 0,
    "pressure_unit": "string",
    "water_temperature": 0,
    "weather_temperature": 0,
    "temperature_unit": "string",
    "safety_stop": true,
    "has_decompression": true,
    "decompression_note": "string",
    "buddy": "string",
    "comments": "string",
    "log_code": "string",
    "skill_log_id": 0,
    "skill_id": 0,
    "instructor_id": 0,
    "weather": "sunny",
    "water": "calm",
    "current": "no_current",
    "visibility": "poor",
    "group_in": "string",
    "group_out": "string",
    "is_free_diving": true
}'
Response Response Example
201 - 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:38:04
Previous
Delete dive log
Next
Update dive log
Built with