---
title: "Update user"
method: PATCH
path: "/api/users/{userId}"
tags: ["Users"]
---

# Update user

`PATCH /api/users/{userId}`

Update user data for the given ID. This method performs a partial update.

## Path parameters

- `userId` string, required

## Request body

- object
  - `username` union — Updated username for the user. It should be unique across all users.
    - string, regex
    - string, empty
  - `primaryEmail` union — Updated primary email address for the user. It should be unique across all users.
    - string, regex
    - string, empty
  - `primaryPhone` union — Updated primary phone number for the user. It should be unique across all users.
    - string, regex
    - string, empty
  - `name` union
    - string
    - string, empty
  - `avatar` union
    - string, url
    - string, empty
  - `customData` object — Custom data object to update for the given user ID. Note this will replace the entire custom data object. If you want to perform a partial update, use the `PATCH /api/users/{userId}/custom-data` endpoint instead.
  - `profile` object
    - `familyName` string
    - `givenName` string
    - `middleName` string
    - `nickname` string
    - `preferredUsername` string
    - `profile` string
    - `website` string
    - `gender` string
    - `birthdate` string
    - `zoneinfo` string
    - `locale` string
    - `address` object
      - `formatted` string
      - `streetAddress` string
      - `locality` string
      - `region` string
      - `postalCode` string
      - `country` string

## Response `200`

Updated user data for the given ID.

- object
  - `id` string, required
  - `username` string, nullable, required
  - `primaryEmail` string, nullable, required
  - `primaryPhone` string, nullable, required
  - `name` string, nullable, required
  - `avatar` string, nullable, required
  - `customData` object, required — arbitrary
  - `identities` object, required
  - `lastSignInAt` number, nullable, required
  - `createdAt` number, required
  - `updatedAt` number, required
  - `profile` object, required
    - `familyName` string
    - `givenName` string
    - `middleName` string
    - `nickname` string
    - `preferredUsername` string
    - `profile` string
    - `website` string
    - `gender` string
    - `birthdate` string
    - `zoneinfo` string
    - `locale` string
    - `address` object
      - `formatted` string
      - `streetAddress` string
      - `locality` string
      - `region` string
      - `postalCode` string
      - `country` string
  - `applicationId` string, nullable, required
  - `isSuspended` boolean, required
  - `hasPassword` boolean
  - `hasSecurityVerificationMethod` boolean
  - `ssoIdentities` object[]
    - `tenantId` string, required
    - `id` string, required
    - `userId` string, required
    - `issuer` string, required
    - `identityId` string, required
    - `detail` object, required — arbitrary
    - `createdAt` number, required
    - `updatedAt` number, required
    - `ssoConnectorId` string, required
  - `passwordDigest` string, nullable
  - `passwordAlgorithm` 'Argon2i' | 'Argon2id' | 'Argon2d' | 'SHA1' | 'SHA256' | 'MD5' | 'Bcrypt' | 'Legacy', nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Content

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
