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 Sanctum token
        POST
      • Send password reset email
        POST
      • Reset password using token
        POST
      • Logout and invalidate JWT token
        POST
      • Refresh JWT token
        POST
      • Verify email address (signed URL)
        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
        • List diver certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
      • 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
        • Create Stripe payment intent for course
        • Confirm Stripe payment and activate course
        • 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
        • Create payment intent for student course purchase
        • Confirm student course payment
    • Sync
      • Get sync status
      • Download full course data for offline use
      • Upload offline operations
    • Utility
      • List all countries
      • Get country data
      • Get country divisions (states/provinces)
      • List active dive centers
      • Get dive center details
    • Dive Center
      • Get Dive Center List
      • Get a Dive Center info
  • Schemas
    • Frontend API Schema
      • DiverSearch
    • SuccessResponse
    • ErrorResponse
    • ValidationErrorResponse
    • TokenResponse
    • UserProfile
    • CourseLog
    • CourseLogDetail
    • QuizResult
    • ExamResult
    • SkillProgress
    • DiveLog
    • Certification
    • PaginatedDiveLogs
    • StoreItem
    • PaymentIntentResponse
    • OrderConfirmResponse
    • OrderStatusResponse
    • InstructorSearch
    • DiveCenterSearch
  1. Auth

Login and get Sanctum token

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

POST /api/v1/auth/login#

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": "20|raid_ydVCW8OH9aAkZIKDuWAIOmNA6BFdfZrbAPZtpzFjebcf",
    "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#

Returned by the auth rate limiter after 10 requests in one minute from the same IP address, 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

Example
{
    "email": "{{user_email}}",
    "password": "{{user_password}}",
    "device_name": "User's iPhone"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
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"
}'

Responses

🟢200
application/json
Login successful
Bodyapplication/json

Example
{
    "status": "success",
    "message": "string",
    "data": {
        "token": "string",
        "token_type": "Bearer",
        "expires_in": 0
    }
}
🟠401
🟠422
Modified at 2026-09-15 15:39:31
Previous
Register a new user
Next
Send password reset email
Built with