RAID API
  1. Profile
  • 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
        GET
      • Update profile
        PATCH
      • Register push token
        PUT
      • Update password
        PATCH
      • Remove push token
        DELETE
      • Rotate exam unlock code
        POST
      • Delete account
        DELETE
      • Update dive center association
        PATCH
    • 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
        • Create dive log
        • Update dive log
        • List loggable courses
        • List dive logs (paginated)
        • Get dive log
      • 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. Profile

Update profile

PATCH
https://test.diveraid.com/api/v1/profile
Profile
Maintainer:Not configured

Overview#

Updates the authenticated user's own profile. Partial: send only the fields being changed.
The writable surface matches the website profile cards: name, email, contacts, address and next of kin. Qualification, dive centre, distributor, status and VAT are not writable here. The dive centre has its own endpoint; the rest are managed by RAID.
Controller: App\Http\Controllers\Api\V1\Profile\ProfileController::update()
Route name: api.v1.profile.update

Authentication#

Type: Bearer Token
Header: Authorization: Bearer {token}

Request#

Method: PATCH
Path: /api/v1/profile
Content-Type: application/json

Body#

{
  "first_name": "Marco",
  "last_name": "Rossi",
  "email": "marco.rossi@example.com",
  "current_password": "Current-Pass-123",
  "gender": 1,
  "timezone": "Europe/Rome",
  "default_language": "it",
  "mobile": "+393331234567",
  "phone": "+390392345678",
  "country": "IT",
  "state_select": "MB@Monza e Brianza",
  "city": "Lissone",
  "address": "Via Roma 1",
  "postal_code": "20851",
  "nok_first_name": "Anna",
  "nok_last_name": "Rossi",
  "nok_email": "anna.rossi@example.com",
  "nok_phone": "+393339876543",
  "nok_country": "IT"
}
FieldTypeRequiredValidationDescription
emailstringNosometimes|email:rfc,dns, unique across users, dive center companies and distributor companiesAlso updates the username, which is kept identical to the email
current_passwordstringOnly when email changesrequired when the posted email, trimmed and lowercased, differs from the current one; then current_password:apiThe user's current password. Never stored. Not needed when email is the current address or absent
first_namestringNosometimes|string|min:1|max:100
last_namestringNosometimes|string|min:1|max:100
genderintegerNosometimes, must be a valid UserGender valueSend the enum value, not the label the resource returns
timezonestringNosometimes, must be a valid PHP timezone identifier
default_languagestringNosometimes|string|in:en,ar,de,es,fr,it,ko,nl,pt,tr,zh,pl,ruOne of en, ar, de, es, fr, it, ko, nl, pt, tr, zh, pl, ru. Trimmed and lowercased; the legacy codes cn, kr, us are accepted and stored as zh, ko, en
mobilestring|nullNosometimes|nullable|string|phoneInternational format (+39...), as on the website
phonestring|nullNosometimes|nullable|string|phoneInternational format
countrystringNosometimes|string, an ISO 3166-1 alpha-2 codeTrimmed and uppercased. A new country changes the address, see Notes
state_selectstring|nullConditionalrequired when country changes to a country with subdivisions, or when sent for a country that has them; then one of the country's {code}@{name} valuesFormat {code}@{name}, as in registration and GET /api/v1/public/countries/{code}/divisions. Split server-side into state_code and state
citystring|nullNosometimes|nullable|string|max:200
addressstring|nullNosometimes|nullable|string|max:300
postal_codestring|nullNosometimes|nullable|string|max:30|postal_code_with:countryChecked against the posted country, or the current one when country is not sent
nok_first_namestring|nullNosometimes|nullable|string|min:1|max:100Next of kin. Capitalised server-side
nok_last_namestring|nullNosometimes|nullable|string|min:1|max:100Capitalised server-side
nok_emailstring|nullNosometimes|nullable|email:rfc,dns|max:150
nok_phonestring|nullNosometimes|nullable|string|phone:fixed_line,mobileInternational format
nok_countrystring|nullNosometimes|nullable|string, an ISO 3166-1 alpha-2 codeTrimmed and uppercased
Validated by App\Http\Requests\Api\V1\Profile\UpdateProfileRequest.
Every field is sometimes: an absent field is left untouched. Sending null is not the same as omitting it.

Example request#


Response 200 OK#

{
  "success": true,
  "status": "success",
  "message": "Profile updated successfully",
  "data": { }
}
data is the full user resource, reloaded after the update. See _user-resource.md.

Errors#

401 Unauthorized#

Standard shape. message is one of Unauthenticated, Invalid token, Token expired.

422 Unprocessable Entity — validation#

{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "email": ["The email has already been taken."],
    "default_language": ["The selected Default Language is invalid."]
  }
}

429 Too Many Requests#

{
  "success": false,
  "status": "error",
  "message": "Too many requests"
}
Retry-After header present. The route allows 6 requests per minute per user (throttle:profile-write, shared by PATCH /api/v1/profile and PATCH /api/v1/profile/password), counting successful and failed attempts alike, because it checks current_password on an email change.

Notes#

full_name is recomputed server-side whenever first_name or last_name changes, and capitalised. It cannot be set directly.
Changing email requires current_password; a missing or wrong one returns 422 on current_password and nothing is changed. The uniqueness of the new address is checked only once current_password is right, so a wrong or missing password never reveals whether an address is registered. The posted email is compared with the current one case-insensitively, after trimming; posting the current address changes nothing and needs no password.
Changing email also changes the username. The account is then signed in with the new address. Existing tokens are kept.
Changing email resets email_verified_at to null and sends a verification mail to the new address (subject to the verification throttle).
Contacts, address and next of kin need no password and do not touch email_verified_at.
A new country sets the state from state_select, clears city, address and postal_code unless they are sent in the same request (as the website address card does when the country changes), and sets the country's region, subregion, currency, VAT rate and first timezone. A timezone sent in the same request wins. Changing only city, address, postal_code or state_select in the current country changes nothing else; unlike the website card, the timezone is not reset.
After an email or address change the Stripe customer is updated, as on the website.
gender is asymmetric: this endpoint accepts the enum value, while the resource returns the display label in the response language (README §10). The same applies to every other enum field in the payload.

Source: docs/api/profile/PATCH_update.md

Request

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

Examples

Responses

🟢200
application/json
User profile
Bodyapplication/json

🟠401
🟠422
🟠429
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://test.diveraid.com/api/v1/profile' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "user@example.com",
    "current_password": "pa$$word",
    "first_name": "string",
    "last_name": "string",
    "gender": "male",
    "timezone": "string",
    "default_language": "en",
    "mobile": "string",
    "phone": "string",
    "country": "string",
    "state_select": "string",
    "city": "string",
    "address": "string",
    "postal_code": "string",
    "nok_first_name": "string",
    "nok_last_name": "string",
    "nok_email": "user@example.com",
    "nok_phone": "string",
    "nok_country": "string"
}'
Response Response Example
200 - Example 1
{
    "status": "success",
    "message": "string",
    "data": {
        "data": {
            "raid_id": "string",
            "exam_unlock_code": "string",
            "email": "user@example.com",
            "qrcode": "string",
            "qualification": "string",
            "cast": "string",
            "category": "string",
            "dive_center": "string",
            "dive_center_id": 0,
            "dive_center_date": "2019-08-24",
            "distributor": "string",
            "distributor_id": 0,
            "distributor_date": "2019-08-24",
            "first_name": "string",
            "last_name": "string",
            "full_name": "string",
            "nationality": "string",
            "country": "string",
            "state": "string",
            "state_code": "string",
            "city": "string",
            "address": "string",
            "timezone": "string",
            "postal_code": "string",
            "phone": "string",
            "mobile": "string",
            "gender": "string",
            "dob": "2019-08-24",
            "nok_first_name": "string",
            "nok_last_name": "string",
            "nok_phone": "string",
            "nok_email": "string",
            "nok_country": "string",
            "avatar": "string",
            "e_card": "string",
            "status": "string",
            "suspension_days": 0,
            "restore_date": "2019-08-24",
            "restore_status": "string",
            "status_reason": "string",
            "professional_status": "string",
            "professional_suspension_days": 0,
            "professional_restore_date": "2019-08-24",
            "professional_status_reason": "string",
            "renewal_date": "2019-08-24",
            "expire_date": "2019-08-24",
            "guardian_first_name": "string",
            "guardian_last_name": "string",
            "guardian_email": "string",
            "guardian_accepted": true,
            "renew_causer": "string",
            "renew_reason": "string",
            "job_country": "string",
            "default_language": "string",
            "currency": "string",
            "preferred_system": "string",
            "vat_rate": 0,
            "gdpr": "2019-08-24",
            "terms": "2019-08-24",
            "policy_accepted_at": "2019-08-24",
            "email_verified_at": "2019-08-24",
            "stripe_id": "string",
            "created_at": "2019-08-24T14:15:22.123Z",
            "updated_at": "2019-08-24T14:15:22.123Z"
        },
        "status": "success"
    }
}
Modified at 2026-11-05 14:30:01
Previous
Get authenticated user profile
Next
Register push token
Built with