Skip to main content

Update User

Used to update existing user account information, including profile details, MFA settings, roles, and permissions.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/idp/v1/Iam/Update

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/idp/v1/Iam/Update' \
-H 'Content-Type: application/json' \
-H 'x-blocks-key: YOUR_PROJECT_KEY' \
-d '{
"itemId": "user_123",
"salutation": "Dr.",
"firstName": "John",
"lastName": "Smith",
"phoneNumber": "+1234567890",
"tags": ["vip", "developer"],
"profileImageUrl": "https://example.com/new-image.jpg",
"profileImageId": "img_456",
"userMfaType": 1,
"mfaEnabled": true,
"roles": ["admin", "manager"],
"permissions": ["read", "write", "delete"],
"projectKey": "YOUR_PROJECT_KEY",
"memberships": [
{
"organizationId": "org_123",
"roles": ["admin"],
"permissions": ["read", "write"]
}
]
}'

Request Headers

FieldTypeDescription
Content-Typeapplication/jsonData type, must be application/json.
x-blocks-keystringProject key for authentication.

Request Body

FieldTypeRequiredDescription
itemIdstringYesThe unique identifier of the user to update.
salutationstringNoSalutation (e.g., Mr., Ms., Dr.).
firstNamestringNoUser's first name.
lastNamestringNoUser's last name.
phoneNumberstringNoUser's phone number.
tagsarrayNoTags for categorizing the user.
profileImageUrlstringNoURL of user's profile image.
profileImageIdstringNoID of the profile image.
userMfaTypeintegerNoMFA type for the user (0-based).
mfaEnabledbooleanNoWhether MFA is enabled for the user.
rolesarrayNoRoles assigned to the user.
permissionsarrayNoPermissions granted to the user.
projectKeystringNoThe project key associated with the user.
membershipsarrayNoOrganization memberships with roles and permissions.

Membership Object

FieldTypeDescription
organizationIdstringID of the organization.
rolesarrayRoles assigned to the user in the org.
permissionsarrayPermissions granted to the user.

Response

Success Response

Returns HTTP status 200 OK on successful user update.

{
"isSuccess": true,
"data": {
"itemId": "user_123",
"salutation": "Dr.",
"firstName": "John",
"lastName": "Smith",
"phoneNumber": "+1234567890",
"mfaEnabled": true,
"userMfaType": 1,
"roles": ["admin", "manager"],
"memberships": [
{
"organizationId": "org_123",
"roles": ["admin"],
"permissions": ["read", "write"]
}
]
},
"errors": {}
}

Response Fields

FieldTypeDescription
isSuccessbooleanIndicates if update was successful.
dataobjectUpdated user details.
errorsobjectAny errors encountered during update.