Update user
Update user data for the given ID. This method performs a partial update.
Path parameters
-
The unique identifier of the user.
Body Required
primaryEmail string(regex) | null | string(empty)
Updated primary email address for the user. It should be unique across all users.
One of: Format should match the following pattern:
/^\S+@\S+\.\S+$/
.primaryPhone string(regex) | null | string(empty)
Updated primary phone number for the user. It should be unique across all users.
One of: Format should match the following pattern:
/^\d+$/
.name string | null | string(empty)
avatar string(url) | null | 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
PATCH /api/users/{userId}
curl \
-X PATCH https://[tenant_id].logto.app/api/users/{userId} \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"username":"string","primaryEmail":"string","primaryPhone":"string","name":"string","avatar":"string","customData":{},"profile":{"familyName":"string","givenName":"string","middleName":"string","nickname":"string","preferredUsername":"string","profile":"string","website":"string","gender":"string","birthdate":"string","zoneinfo":"string","locale":"string","address":{"formatted":"string","streetAddress":"string","locality":"string","region":"string","postalCode":"string","country":"string"}}}'
Request examples
{
"username": "string",
"primaryEmail": "string",
"primaryPhone": "string",
"name": "string",
"avatar": "string",
"customData": {},
"profile": {
"familyName": "string",
"givenName": "string",
"middleName": "string",
"nickname": "string",
"preferredUsername": "string",
"profile": "string",
"website": "string",
"gender": "string",
"birthdate": "string",
"zoneinfo": "string",
"locale": "string",
"address": {
"formatted": "string",
"streetAddress": "string",
"locality": "string",
"region": "string",
"postalCode": "string",
"country": "string"
}
}
}
Response examples (200)
{
"id": "string",
"username": "string",
"primaryEmail": "string",
"primaryPhone": "string",
"name": "string",
"avatar": "string",
"customData": {},
"identities": {
"userId": "string",
"details": {}
},
"lastSignInAt": 42.0,
"createdAt": 42.0,
"updatedAt": 42.0,
"profile": {
"familyName": "string",
"givenName": "string",
"middleName": "string",
"nickname": "string",
"preferredUsername": "string",
"profile": "string",
"website": "string",
"gender": "string",
"birthdate": "string",
"zoneinfo": "string",
"locale": "string",
"address": {
"formatted": "string",
"streetAddress": "string",
"locality": "string",
"region": "string",
"postalCode": "string",
"country": "string"
}
},
"applicationId": "string",
"isSuspended": true,
"hasPassword": true,
"ssoIdentities": [
{
"tenantId": "string",
"id": "string",
"userId": "string",
"issuer": "string",
"identityId": "string",
"detail": {},
"createdAt": 42.0,
"ssoConnectorId": "string"
}
]
}