Skip to main content

Update a user

PATCH 

/user/users/:userId

Update the supplied account and standard profile fields. Omitted fields remain unchanged. Support for Custom profile fields will be added in a later revision.

Required OAuth scopes​

Satisfy one set:

  • all of:
    • core_user:user:update:self
  • all of:
    • core_user:user:update

Moodle capabilities also apply. The self scope grants no administrative permission.

Field rules​

  • Email, suspension and administrative changes to username, idnumber, authenticationMethod or confirmed require applicable account-edit capabilities, including moodle/user:update, even when updating yourself.
  • Suspending an account invalidates its active sessions.
  • Field-level and self-edit permissions, validation, and source/target authentication-plugin locks apply. Changing authenticationMethod cannot provision an external identity or implicitly set or reset a password.
  • Use language for the stored language preference and timeZonePreference for a supported IANA timezone or null for the server default. The effective timeZone is read-only, including under forced site policy; the internal 99 sentinel is not accepted.
  • id, fullName and picture URLs are read-only; deleted is excluded from inputs. Clear optional text with an empty string; null is otherwise rejected.

Concurrency​

If-Match is optional and uses the same caller-visible representation as GET. A stale ETag returns 412; without If-Match, the update is unconditional.

Request​

Responses​

OK

Response Headers
    ETag

    The entity-tag of this representation. Preserve the double quotes when sending it in an If-Match or If-None-Match request header.

    Example: "0123456789abcdef0123456789abcdef01234567"