Skip to Content

Users

Current-user profile updates and employer access to student profiles.

Get current user

Returns the authenticated user profile.

GET/api/users/me

Auth: Clerk session only.

Response body

{
  "id": "00000000-0000-0000-0000-000000000000",
  "email": "student@example.com",
  "name": "Mina Novak",
  "first_name": "Mina",
  "last_name": "Novak",
  "avatar_image": "https://example.com/avatar.jpg",
  "user_type": "student",
  "student_data": {
    "birth_year": 2002,
    "education_level_id": "77777777-7777-7777-7777-777777777777",
    "educational_institution": "Faculty of Computer and Information Science",
    "educational_program": "Computer Science"
  }
}

Status codes

  • 200 OK
  • 401 Unauthorized
  • 404 Not Found
  • 500 Internal Server Error

Error format

{
  "error": "Unauthorized",
  "code": "unauthorized"
}

Routes use the shared JSON error envelope; exact `code` values depend on the endpoint.

Update current user

Partially updates the authenticated user. All fields are optional, and `student_data` is only valid when the resulting user type is `student`.

PATCH/api/users/me

Auth: Clerk session only.

Request body

{
  "name": "Mina Novak",
  "user_type": "student",
  "student_data": {
    "birth_year": 2002,
    "education_level_id": "77777777-7777-7777-7777-777777777777",
    "educational_institution": "Faculty of Computer and Information Science",
    "educational_program": "Computer Science"
  }
}

If `name` is provided without `first_name` or `last_name`, the route splits the full name into first and last name fields.

Response body

{
  "id": "00000000-0000-0000-0000-000000000000",
  "email": "student@example.com",
  "name": "Mina Novak",
  "first_name": "Mina",
  "last_name": "Novak",
  "avatar_image": "https://example.com/avatar.jpg",
  "user_type": "student",
  "student_data": {
    "birth_year": 2002,
    "education_level_id": "77777777-7777-7777-7777-777777777777",
    "educational_institution": "Faculty of Computer and Information Science",
    "educational_program": "Computer Science"
  }
}

Status codes

  • 200 OK
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error

Error format

{
  "error": "Unauthorized",
  "code": "unauthorized"
}

Routes use the shared JSON error envelope; exact `code` values depend on the endpoint.

Get student for employer

Returns a student profile for an authenticated employer. The target user must be a student.

GET/api/users/{userId}

Auth: Clerk session only.

Response body

{
  "id": "00000000-0000-0000-0000-000000000000",
  "email": "student@example.com",
  "name": "Mina Novak",
  "first_name": "Mina",
  "last_name": "Novak",
  "avatar_image": "https://example.com/avatar.jpg",
  "user_type": "student",
  "student_data": {
    "birth_year": 2002,
    "education_level_id": "77777777-7777-7777-7777-777777777777",
    "educational_institution": "Faculty of Computer and Information Science",
    "educational_program": "Computer Science"
  }
}

Status codes

  • 200 OK
  • 401 Unauthorized
  • 403 Forbidden
  • 500 Internal Server Error

Error format

{
  "error": "Unauthorized",
  "code": "unauthorized"
}

Routes use the shared JSON error envelope; exact `code` values depend on the endpoint.