Update the Current User's profile

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/profile 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": "John 2",
    "lastName": "Doe 2"
}

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": "ccaf3c6f-1512-4dd6-b7b5-...",
    "firstName": "Firstname",
    "lastName": "Lastname",
    "email": "some@email.com",
    "email_verified_at": "2020-07-07T22:26:53.000000Z",
    "created_at": "2020-07-07T22:26:28.000000Z",
    "updated_at": "2020-07-07T22:26:53.000000Z",
    "roles": [{
        "name": "admin",
        "guard_name": "api",
        "pivot": {
            "model_id": "48f84ffd-a436-4c44-9a7b-a8fd8f577374",
            "role_id": 1,
            "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."
}