> For the complete documentation index, see [llms.txt](https://openapi.logto.io/llms.txt)

# Update profile

> PATCH /api/my-account
> 
> Update profile for the user, only the fields that are passed in will be updated. Updating or deleting username requires a logto-verification-id header for checking sensitive permissions. Removing any sign-in identifier, including username, is rejected if it would remove the user's last identifier.



## Servers
- Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.)


## Authentication methods
- O auth2


## Parameters



### Body: application/json (object)

- **name** (string | null)
  The new name for the user.

- **avatar** (string(url) | null)
  The new avatar for the user, must be a URL.

- **username** (string(regex) | null)
  The new username for the user, must be a valid username and unique.

- **customData** (object)
  The new custom data for the user. This will completely replace the existing customData. Requires CustomData scope.



## Responses
### 200
The profile was updated successfully.

#### Body: application/json (object)
- **id** (string)

- **username** (string | null)

- **primaryEmail** (string | null)

- **primaryPhone** (string | null)

- **name** (string | null)

- **avatar** (string | null)

- **customData** (object)
  arbitrary

- **identities** (object)

- **lastSignInAt** (number | null)

- **createdAt** (number)

- **updatedAt** (number)

- **profile** (object)

- **applicationId** (string | null)

- **cimdClientId** (string | null)
  The identifier of the CIMD (client ID metadata document) client from the user's first consent. `null` unless the user's first consent was granted to a CIMD client. Mutually exclusive with `applicationId`. Only returned with the `profile` scope.

- **isSuspended** (boolean)

- **hasPassword** (boolean)

- **hasSecurityVerificationMethod** (boolean)

- **hasPrimaryEmail** (boolean)
  Whether the user has a primary email. Requires the `email` scope. Returned even when the Account Center email field is not readable; the email address itself remains filtered.

- **hasPrimaryPhone** (boolean)
  Whether the user has a primary phone. Requires the `phone` scope. Returned even when the Account Center phone field is not readable; the phone number itself remains filtered.

- **ssoIdentities** (array[object])


### 400
The request body is invalid.

### 401
Permission denied, recent user authentication is required to change the username.

### 403
Forbidden

### 422
The username is already in use.


[Powered by Bump.sh](https://bump.sh)
