Skip to main content

Get My Profile

GET /v1/users/me
Returns the authenticated user’s own profile.

Authentication

Requires a valid access token (any role).

Example request

curl https://mind-be.staging.miva.university/v1/users/me \
  -H "Authorization: Bearer <access_token>"

Response

{
  "success": true,
  "data": {
    "id": "6650a1b2c3d4e5f6a7b8c9d0",
    "email": "student@example.com",
    "first_name": "Jane",
    "last_name": "Smith",
    "middle_name": null,
    "display_name": "Jane Smith",
    "role_id": "6650a0b1c2d3e4f5a6b7c8d9",
    "role_name": "Student",
    "status": "ACTIVE",
    "title": null,
    "department": null,
    "unlimited_sessions": false,
    "last_activity_at": "2025-06-01T12:00:00Z",
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": null
  },
  "message": null
}

Update My Profile

PATCH /v1/users/me
Update the authenticated user’s own profile. Only send the fields you want to change.

Authentication

Requires a valid access token (any role).

Request body

first_name
string
First name. Max 255 characters.
last_name
string
Last name. Max 255 characters.
title
string
Job title. Max 100 characters.
department
string
Department name. Max 255 characters.

Example request

curl -X PATCH https://mind-be.staging.miva.university/v1/users/me \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Jane",
    "last_name": "Smith-Jones",
    "department": "Computer Science"
  }'

Response

Returns the full updated user profile (same shape as Get My Profile).

Change Password

POST /v1/users/me/change-password
Change the authenticated user’s password. Requires the current password for verification.

Authentication

Requires a valid access token (any role).

Request body

current_password
string
required
The user’s current password.
new_password
string
required
New password. Min 8 characters, max 100.

Example request

curl -X POST https://mind-be.staging.miva.university/v1/users/me/change-password \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "current_password": "oldpassword",
    "new_password": "newstrongpassword123"
  }'

Response

{
  "success": true,
  "data": null,
  "message": "Password changed successfully"
}

Error responses

StatusCodeCondition
401AUTHENTICATION_ERRORCurrent password is incorrect
422VALIDATION_ERRORNew password doesn’t meet requirements