Skip to main content

Update User Profile Information

Update user profile information including system fields (email, mobile, name, etc.) and custom fields. This guide covers field permissions, update methods, and API usage.

Purpose and Benefits

What is User Profile Update?

User profile updates allow users and administrators to modify user account information, including:

  • User Identification Attributes: email, username, etc.
  • User Communication Attributes: mobile number, email address
  • User Descriptive Attributes: first name, last name, etc.
  • Custom Fields: Business-specific fields configured in field settings

Key Benefits

BenefitDescription
Self-Service UpdatesUsers can update their own profile information
Admin ManagementAdministrators can update any user's profile
Field-Level ControlGranular permissions control what can be updated
Instant UpdatesChanges take effect immediately (when verification not required)
Custom Fields SupportUpdate business-specific custom fields

Update Methods

cidaas supports different methods for updating user profiles:

MethodEndpointScopeUse Case
User Self-ServicePUT /users-srv/user/profile/{sub}profileUser updates own profile
Admin UpdatePUT /user-srv/users/{sub}cidaas:users_writeAdmin updates any user profile
Email/Mobile with OTPPUT /useractions-srv/communication/medium/{sub}profileSecure email/mobile change with verification
Admin Email/MobilePOST /useractions-srv/communication/medium/{sub}cidaas:users_writeAdmin-initiated email/mobile change via link

Prerequisites

Before updating user profiles:

  • ✅ User authentication token (for self-service updates)
  • ✅ Admin token with cidaas:users_write scope (for admin updates)
  • ✅ Required roles: ADMIN, SECONDARY_ADMIN, SUPER_ADMIN, or USER_CREATE (for admin updates)
  • ✅ Field permissions configured in Field Settings

User Profile Update Flow

The following sequence diagram illustrates the user profile update process:

Flow Steps Explained

  1. Authenticate Request

    • User/Admin provides authentication token
    • System validates token and extracts user permissions
    • User Self-Service: Token sub must match path sub
    • Backendside Update / Admin update: Token must have cidaas:users_write scope or admin roles
  2. Validate Field Permissions

    • System checks field permissions from Field Settings
    • Validates if field is enabled, read-only, internal, or requires verification
    • API Reference: See Field Settings API for field configuration
  3. Check Communication Medium Settings

    • For email/mobile updates, system checks verificationForMedium configuration
    • If verificationForMedium is set, standard update API is blocked
    • Must use OTP verification flow instead
  4. Update User Profile

    • System validates field values (format, uniqueness, etc.)
    • Updates user account and social identity records
    • Applies changes to custom fields if provided
  5. Create Webhook Events (if applicable)

    • For email changes: Creates EMAIL_CHANGED fact event
    • For other significant changes: Creates appropriate fact events
    • API Reference: See Update User API for admin updates

Important Details

Required Permissions

User Self-Service Update

Endpoint: PUT /users-srv/user/profile/{sub}
API Reference: PUT /users-srv/user/profile/:sub

Key Requirements:

  • Scope: profile scope required in the access token
  • Access Control: User can only update their own profile - the token's sub must match the path parameter {sub}
  • Field Restrictions: Subject to field permissions (read-only and internal fields cannot be updated by users)

What Can Be Updated:

  • System fields: given_name, family_name, email, mobile_number, birthdate, locale, address, etc.
  • Custom fields: Provided in the customFields object (must be pre-configured in Field Settings)
  • Identity-specific fields: Use identityId to specify which identity to update

Important Notes:

  • Email/mobile changes may require OTP verification if verificationForMedium is configured in Field Settings
  • Read-only fields are visible but cannot be modified by users (admins can update them)
  • Internal fields are not accessible via this endpoint

For detailed request/response schemas, error codes, and examples, see the API Reference.

Admin Update

Endpoint: PUT /user-srv/users/{sub}

  • Scope: cidaas:users_write
  • Roles: ADMIN, SECONDARY_ADMIN, SUPER_ADMIN, or USER_CREATE
  • Groups: Member of CIDAAS_ADMINS group
  • Access Control: Admin can update any user's profile

Field Permissions

Field permissions in Field Settings control update behavior:

PermissionDescriptionUser Can UpdateAdmin Can UpdateAPI Behavior
EnableField is editable and visibleYesYesField can be updated via profile update API
RequiredField is mandatoryYesYesField must be provided; update fails if missing
Read OnlyField value can only be viewed, not changedNoYesUser update API rejects changes; Admin can update
InternalField is internal and not visible to usersNoYesField not returned in userinfo; Admin can update via API
verificationForMediumRequires verification before changing communication mediumNo (via update API)Yes (via update API)Update API blocked; Must use OTP verification flow

Instant Email/Mobile Change (Without Verification)

When verificationForMedium is NOT set for email or mobile number fields, these fields can be updated instantly via the standard profile update API:

User Self-Service:

PUT /users-srv/user/profile/{sub}
Authorization: Bearer {user_token}
{
"email": "[email protected]",
"given_name": "John",
"family_name": "Doe"
}

Admin Update:

PUT /user-srv/users/{sub}
Authorization: Bearer {admin_token}
{
"userData": {
"email": "[email protected]",
"given_name": "John",
"family_name": "Doe"
}
}

Important Considerations:

  • No confirmation is sent to the old email/mobile
  • No verification code is required
  • Changes take effect immediately
  • Use only when you have proper access controls and trust the update source

Email/Mobile Change with Verification

When verificationForMedium=[email, mobile_number] is configured, the standard profile update API cannot change email or mobile number. You must use the OTP verification flow:

User Profile Update (Logged-in Users):

PUT /useractions-srv/communication/medium/{sub}?action=initiate
{
"medium": "email",
"value": "[email protected]"
}

During Verification Flow (trackId): If a user needs to change their email/mobile during registration or login verification, use the trackId-based flow:

POST /useractions-srv/communication/medium/track/{trackId}?action=initiate
{
"medium": "email",
"value": "[email protected]"
}

Webhooks and Facts

When user profile is updated, fact events may be automatically created and sent as webhooks:

Event TypeObject TypeObject IDDescriptionWhen TriggeredWebhook Attributes
EMAIL_CHANGEDuserssub (user ID)Email address was changedEmail updated via profile update API["email", "email_verified"] or ["identity_id", "sub"]

Note: Webhook events are only created for significant changes (e.g., email changes). Not all profile updates trigger webhooks.

Field Validation

The system validates field values during updates:

  • Format Validation: Email format, mobile number format (E164), date formats, etc.
  • Uniqueness Validation: Unique fields (email, username, etc.) must not conflict with existing users
  • Required Fields: Required fields must be provided
  • Field Type Validation: Values must match the configured field data type

Custom Fields

Custom fields can be updated by providing them in the customFields object:

{
"customFields": {
"employee_id": "EMP12345",
"department": "Engineering",
"hire_date": "2024-01-15"
}
}

Note: Custom fields must be pre-configured in Field Settings.

Technical Integration

EndpointMethodDescriptionLink
Update User Profile (Self-Service)PUTUser updates own profilePUT /users-srv/user/profile/:sub
Update User (Admin)PUTAdmin updates any user profilePUT /user-srv/users/:sub
Get User InfoGETRetrieve user profile informationGET /users-srv/userinfo
Get User by SubGETAdmin retrieves user by subGET /user-srv/users/:sub
Get Public FieldsGETGet list of configurable fieldsGET /fieldsetup-srv/public/fields
TopicDescriptionLink
Email/Mobile Change with OTPSecure communication medium updates with verificationEmail/Mobile Change
Admin Email/Mobile ChangeAdmin-initiated email/mobile change via linkAdmin Email/Mobile Change
Communication Change During VerificationChange email/mobile during registration/login using trackIdCommunication Change During Verification
Field SettingsConfigure field permissions and settingsField Settings
Account StructureUnderstand user data modelAccount Structure
User StatusManage user account statusUser Status

Need Support?

Please contact us directly on our support page.