Skip to content

Schimba parolă

Schimba parolă utilizatorului.

Endpoint

http
POST /api/v1/user/password

Parametri

Parametri body

ParametruTipObligatoriuDescriere
currentstringyesParola curentă a utilizatorului.
passwordstringyesNoua parolă a utilizatorului.
password_confirmationstringyesConfirmarea noii parole a utilizatorului.

Exemplu de cerere

sh
curl --location --request POST 'https://files.ro/api/v1/user/password' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
  "current": "filesro",
  "password": "filesro",
  "password_confirmation": "filesro"
}'

Răspuns

json
{
  "type": "success",
  "message": "The password was successfully changed."
}
json
{
  "type": "error",
  "message": "You are not authorized"
}
json
{
  "message": "The given data was invalid.",
  "errors": {
    "field": [
      "The field is required."
    ]
  }
}