PATCH /v1/users/

Update user's email or password

application/json

Body

Request to update user's email or password

  • currentPassword string Required

    Current password

  • email string

    Email

  • newPassword string

    New password

Responses

  • 403 application/json

    Not authorized

    Hide response attributes Show response attributes object

    Error schema

    • statusCode number Required

      Status Code

    • messages array[string] Required

      List of error messages

    • exception object

      Exception

  • 404 application/json

    Not found

    Hide response attributes Show response attributes object

    Error schema

    • statusCode number Required

      Status Code

    • messages array[string] Required

      List of error messages

    • exception object

      Exception

  • 204

    Successful operation with no content

  • 200 application/json

    successful operation

    One of:
PATCH /v1/users/
curl \
 --request PATCH 'https://classmanager.test/v1/users/' \
 --header "Content-Type: application/json" \
 --data '{"currentPassword":"existing password","email":"me@ismayil.dev","newPassword":"new password"}'
Request examples
{
  "currentPassword": "existing password",
  "email": "me@ismayil.dev",
  "newPassword": "new password"
}
Response examples (403)
{
  "statusCode": 42.0,
  "messages": [
    "string"
  ],
  "exception": {}
}
Response examples (404)
{
  "statusCode": 42.0,
  "messages": [
    "string"
  ],
  "exception": {}
}
Response examples (200)
{
  "user": {
    "id": "usr_123123123123",
    "firstname": "John",
    "lastname": "Doe",
    "email": "new Email(john@example.com)",
    "emailVerifiedAt": "2023-11-08 14:05:51"
  },
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}
{
  "id": "usr_123123123123",
  "firstname": "John",
  "lastname": "Doe",
  "email": "new Email(john@example.com)",
  "emailVerifiedAt": "2023-11-08 14:05:51"
}