Update the Current User

Updates profile data of the current logged in user. Requires a logged in user.

{warning} A user must have his/her account verified


Method Uri Auth Permissions
PUT /v1/auth/me Bearer JWT-Token none

Headers

The API requires a header Accept and Authorization to be submitted with the request:

{
    "Accept": "application/json",
    "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M..." 
}

Data constraints

{
    "firstName": ["required", "string"],
    "lastName": ["required", "string"],
    "position": ["required", "string"],
    "address": ["required", "string"],
    "country": ["required", "string"],
    "institute": ["required", "string"],
    "postal": ["required", "string"],
    "phone": ["required", "string"]
}

Success Responses

Condition : All required data provided is valid and added to the request body.

Code : 201 Created

Content example : Response will reflect back the created message':

{
  "id": "bbbf950f-ee47-4ada-a308-2addae8d747f",
  "firstName": "John 2",
  "lastName": "Doe 2",
  "email": "jeroenboumans@hellosunshine.nl",
  "position": "",
  "institute": "Hello Sunshine",
  "address": "Hello Sunshine",
  "postal": "1234AB",
  "phone": "01234567890",
  "roles": [
    {
      "name": "researcher",
      "guard_name": "api",
      "pivot": {
        "model_id": "bbbf950f-ee47-4ada-a308-2addae8d747f",
        "role_id": 4,
        "model_type": "App\Models\User"
      }
    }
  ]
}

Error Responses

Condition : If a user has not logged in or header data is incomplete.

Code : 401 Unauthorized

Content example :

{
  "message": "You must log in to do that.",
  "errors": [
    "Unauthenticated."
  ]
}

Code : 403 Forbidden

Content example :

{
    "message": "Your email address is not verified."
}