RAID API
  1. Auth
  • 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
        POST
      • Login and get a Sanctum token
        POST
      • Send password reset email
        POST
      • Reset password using token
        POST
      • Logout and revoke the current token
        POST
      • Resend email verification
        POST
    • Profile
      • Get authenticated user profile
      • Update profile
      • Delete account
      • Update password
      • Update dive center association
    • Diver
      • Courses
        • List active courses
        • List expired courses
        • Get course detail
        • Submit module quiz
        • Get quiz result
        • Submit course exam
        • Get exam result
        • Get skills progress
        • Sign skills (diver)
      • Free Learnings
        • List enrolled free learnings
        • List available free learning courses
        • Enroll in a free learning course
        • Get free learning detail
        • Submit free learning module quiz
        • Get free learning quiz result
      • Certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
        • List diver certifications
      • Dive Logs
        • List dive logs (paginated)
        • Create dive log
        • Get dive log
        • Update dive log
      • Awards
        • List award cards
      • Documents
        • 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
        • Get student quiz result
        • Get student exam result
        • Get student skills progress
        • Sign student skills
      • Certifications
        • List all professional certifications
        • List diver-level certifications
        • List specialty certifications
        • List professional certifications
        • List trainer certifications
        • List examiner certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
      • Classroom
        • List classrooms
        • Get classroom progress (all students)
        • Get classroom student progress
        • Get classroom student quiz result
        • Get classroom student exam result
        • Get classroom student skills
        • Sign classroom student skills
      • Renewals
        • List renewal courses
        • Get renewal progress
        • Submit renewal module quiz
        • Get renewal quiz result
        • Submit renewal exam
        • Get renewal exam result
        • Get renewal skills progress
        • Sign renewal skills
      • Recognitions
        • List recognition courses
      • Dive Logs
        • List student dive logs for a course
        • Get student dive log
        • Sign student dive log
      • Store
    • Sync
      • Get sync status
      • Download full course data for offline use
      • Upload offline operations
    • Dive Center
    • Public
      • List all countries
      • 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
  • Schemas
    • Frontend API Schema
      • DiverSearch
    • SuccessResponse
    • ValidationErrorResponse
    • TokenResponse
    • ErrorResponse
    • UserProfile
    • CourseLog
    • CourseLogDetail
    • QuizResult
    • ExamResult
    • SkillProgress
    • DiveLog
    • Certification
    • PaginatedDiveLogs
    • StoreItem
    • PaymentIntentResponse
    • OrderConfirmResponse
    • OrderStatusResponse
    • InstructorSearch
    • DiveCenterSearch
  1. Auth

Login and get a Sanctum token

POST
https://test.diveraid.com/api/v1/auth/login
V1 Auth
Maintainer:rivalex

Overview#

Authenticates a user with email and password and returns a Sanctum personal access token. The token is sent on every subsequent call in the Authorization: Bearer {token} header.
The endpoint is stateless by design: it does not call Auth::attempt() and never starts a session. Credentials are checked directly against the user provider of the api guard.
Controller: App\Http\Controllers\Api\V1\Auth\AuthController::login()
Route name: api.v1.auth.login

Authentication#

Type: None. Public endpoint.
Additional middleware: throttle:auth — 10 requests per minute per IP address.

Request#

Method: POST
Path: /api/v1/auth/login
Content-Type: application/json

Body#

{
  "email": "diver@example.com",
  "password": "SecurePass123!",
  "device_name": "Alex's iPhone"
}
FieldTypeRequiredValidationDescription
emailstringYesrequired|email:rfcRegistered email address
passwordstringYesrequired|stringAccount password
device_namestringNosometimes|string|max:255Label for this token, shown to the user on their devices screen
Validated by App\Http\Requests\Api\V1\Auth\LoginRequest.
When device_name is omitted or blank, the server derives a label from the User-Agent header as {platform} - {browser}, falling back to Unknown for either part, and to Mobile device when neither can be determined. Supplying a meaningful device_name is strongly recommended: it is what the account holder sees when deciding which device to revoke.

Example request#


Response 200 OK#

{
  "success": true,
  "status": "success",
  "message": "OK",
  "data": {
    "token": "1|raid_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "token_type": "Bearer",
    "expires_in": 7775999
  }
}

Response fields#

FieldTypeNullableAlways presentDescription
data.tokenstringNoYesOpaque personal access token. Send it verbatim as Authorization: Bearer {token}
data.token_typestringNoYesAlways Bearer
data.expires_inintegerNoYesSeconds until expiry. 90 days, so approximately 7776000. Treat it as approximate: it is computed at response time and truncates to the second

Errors#

401 Unauthorized — wrong credentials#

{
  "success": false,
  "status": "error",
  "message": "Invalid credentials"
}
The same message is returned for an unknown email and for a wrong password, deliberately: the endpoint does not reveal whether an address is registered.

422 Unprocessable Entity — validation#

{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "email": ["The email field must be a valid email address."],
    "password": ["The password field is required."]
  }
}

429 Too Many Requests#

{
  "success": false,
  "status": "error",
  "message": "Too many requests"
}
Retry-After header present. The throttle:auth limiter allows 10 requests per minute per IP address, shared across register, login, password/forgot and password/reset, counting successful and failed attempts alike.

Notes#

Tokens are Sanctum personal access tokens, not JWTs. They are opaque strings of the form {id}|raid_{random}, carry no readable payload, and are stored server-side, which is what makes individual revocation possible.
Tokens live 90 days and do not rotate. There is no refresh endpoint: when a token expires the user logs in again.
Every login issues a new independent token. Logging in from a second device does not invalidate the first.
Tokens are issued with the * ability.
A password reset revokes every token on the account. A password change from the profile endpoint revokes every token except the one making the request.
The account holder can see and revoke individual tokens from their privacy screen in the web application.

Request

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Login successful
Bodyapplication/json

🟠401
🟠422
🟠429
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://test.diveraid.com/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data '{
    "email": "{{user_email}}",
    "password": "{{user_password}}",
    "device_name": "User'\''s iPhone"
}'
Response Response Example
200 - Example 1
{
    "status": "success",
    "message": "string",
    "data": {
        "token": "string",
        "token_type": "Bearer",
        "expires_in": 0
    }
}
Modified at 2026-09-25 16:46:37
Previous
Register a new user
Next
Send password reset email
Built with