Skip to main content

UpdateUserProfile

Updates an existing user profile.

Allows modification of profile information including display name, profile picture, locale preferences, and currency settings. Only the fields provided in the request will be updated.

Returns the updated UserProfile resource.

Method Options​

Authorisation specification of the UpdateUserProfile method.

TypeMETHOD_TYPE_WRITE
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_IAM_ADMIN
  • ROLE_IAM_USER_PROFILE_ADMIN

Parameters​

Request and response parameter message overview:

Input: UpdateUserProfileRequest Message​

FieldTypeRequiredDescription
UserProfile

meshtrade.iam.user_profile.v1.UserProfile

True

The user profile with updated values. The name field must be set to identify which profile to update. Only provided fields will be modified.

Returns: UserProfile Message​

Code Examples​

Select supported SDK in the language of your choice for a full example of how to invoke the this method:

package main

import (
"context"
"log"

user_profilev1 "github.com/meshtrade/api/go/iam/user_profile/v1"
)

func main() {
ctx := context.Background()

// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := user_profilev1.NewUserProfileService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()

// Update user profile with modified information
request := &user_profilev1.UpdateUserProfileRequest{
UserProfile: &user_profilev1.UserProfile{
Name: "iam/user_profiles/${_id}", // Existing profile identifier
Owner: service.Group(), // Owner must match current ownership
FirstName: "Sarah",
LastName: "Thompson-Johnson",
ProfilePictureUrl: "https://cdn.example.com/profiles/sarah-new.jpg", // New photo
},
}

// Call the UpdateUserProfile method
userProfile, err := service.UpdateUserProfile(ctx, request)
if err != nil {
log.Fatalf("UpdateUserProfile failed: %v", err)
}

// Use the updated user profile
log.Printf("User profile updated successfully:")
log.Printf(" Name: %s", userProfile.Name)
log.Printf(" First Name: %s", userProfile.FirstName)
log.Printf(" Last Name: %s", userProfile.LastName)
log.Printf("User profile information updated with latest details")
}

Advanced Configuration​

For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.

Other Methods​