For the complete documentation index, see llms.txt. This page is also available as Markdown.

Password

Update a user password

put

Updates a password. The endpoint has two modes, selected by which fields are present in the request body:

Administrator mode — user.id and user.new_password are supplied.

  • Requires administrator privileges.

  • The caller must not target their own account: administrators change their own password through user mode.

  • The response is the updated user document.

User mode — user.new_password and user.old_password are supplied.

  • Requires the current password in old_password. If it does not match, the endpoint responds 403 with an empty body.

  • The response is the updated user document.

In both modes the new password must be at least 6 characters long.

Body

Password update payload. The endpoint has two modes, chosen by which fields are present:

  • Administrator mode: include user.id and user.new_password. The caller must hold administrator privileges and must not target their own account (administrators change their own password through user mode).
  • User mode: include user.new_password and user.old_password. The caller changes their own password and must supply the current one.
Responses
200

Password updated

application/json
put/api/password
PUT /api/password HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "user": {
    "id": 42,
    "new_password": "s3cr3t-new"
  }
}
{
  "data": {
    "groups": [],
    "id": 42,
    "role": "user",
    "user_name": "john.doe"
  }
}

Update a user password

patch

Updates a password. The endpoint has two modes, selected by which fields are present in the request body:

Administrator mode — user.id and user.new_password are supplied.

  • Requires administrator privileges.

  • The caller must not target their own account: administrators change their own password through user mode.

  • The response is the updated user document.

User mode — user.new_password and user.old_password are supplied.

  • Requires the current password in old_password. If it does not match, the endpoint responds 403 with an empty body.

  • The response is the updated user document.

In both modes the new password must be at least 6 characters long.

Body

Password update payload. The endpoint has two modes, chosen by which fields are present:

  • Administrator mode: include user.id and user.new_password. The caller must hold administrator privileges and must not target their own account (administrators change their own password through user mode).
  • User mode: include user.new_password and user.old_password. The caller changes their own password and must supply the current one.
Responses
200

Password updated

application/json
patch/api/password
PATCH /api/password HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "user": {
    "id": 42,
    "new_password": "s3cr3t-new"
  }
}
{
  "data": {
    "groups": [],
    "id": 42,
    "role": "user",
    "user_name": "john.doe"
  }
}

Last updated