Customize user profiles
Tailor user profiles to your business needs by creating and managing user profile attributes in Scalekit
User profiles in Scalekit provide essential identity information through standard attributes like email, name, and phone number. However, when your application requires business-specific data such as employee IDs, department codes, or access levels, you need more flexibility. T
This guide shows how to extend user profiles with custom attributes that can be created through the dashboard, managed programmatically via API, and synchronized with enterprise identity providers.
Standard user profile attributes
Section titled “Standard user profile attributes”Let’s start by looking at the existing standard attributes in a user_profile from the Scalekit’s Get User API response.
{ "id": "usp_96194455173923084", // Unique user identifier "first_name": "John", // User's given name "last_name": "Doe", // User's family name "name": "John Doe", // Full name for UI display "locale": "en-US", // User's language and region preference "email_verified": true, // Whether the email address has been confirmed "phone_number": "+14155552671", // Contact phone number2 collapsed lines
"metadata": { }, // Additional, non-structured user data "custom_attributes": {} // Business-specific user data}These attributes are also listed in your Scalekit dashboard. Navigate to Dashboard > User Attributes to see them. Let’s see how we can create a custom attribute.
Create custom attributes
Section titled “Create custom attributes”To add a custom attribute
- Navigate to Dashboard > User Attributes and click Add Attribute.
- Configure the new attribute fields:
- Display name - Human-readable label shown in the dashboard (e.g., “Employee Number”)
- Attribute key - Internal field name for API and SDK access (e.g.,
employee_id)
- The new attribute can be used to attach the new information about the user to their user profile.
{ "id": "usp_96194455173923084", // Unique user identifier "first_name": "John", // User's given name "last_name": "Doe", // User's family name "name": "John Doe", // Full name for UI display "locale": "en-US", // User's language and region preference "email_verified": true, // Whether the email address has been confirmed "phone_number": "+14155552671", // Contact phone number "metadata": { }, // Additional, non-structured user data "custom_attributes": { "pin_number": "123456" }}Custom attributes are user profile extensions that can be precisely configured to meet your application’s unique needs. For example, as a logistics platform, you might define custom attributes to capture critical operational details like delivery ZIP codes, service zones, or fleet vehicle specifications that apply all your users.
Map profile attributes to identity providers
Section titled “Map profile attributes to identity providers”When users authenticate through Single Sign-On (SSO) or join an organization, Scalekit can retrieve and transfer user profile information from the identity provider directly to your application via the ID token during the login completion process.
Administrators can configure attribute mapping from their identity provider by selecting specific user profile attributes. This mapping supports both standard and custom attributes seamlessly.
Modify user profile attributes API
Section titled “Modify user profile attributes ”If your application provides a user interface for users to view and modify their profile details directly within the app, the Scalekit API enables seamless profile attribute updates.
curl -L -X PATCH '<SCALEKIT_ENVIRONMENT_URL>/api/v1/users/<USER_ID>' \-H 'Content-Type: application/json' \-H 'Authorization: Bearer ...2QA' \-d '{ "user_profile": { "custom_attributes": { "zip_code": "90210" } }}'// Use case: Update user profile with a custom zip code attributeawait scalekit.user.updateUser("<userId>", { userProfile: { customAttributes: { zip_code: "11120", }, firstName: "John", lastName: "Doe", locale: "en-US", name: "John Michael Doe", phoneNumber: "+14155552671" }});# Use case: Update user profile with a custom zip code attributescalekit.user.update_user( "<user_id>", user_profile={ "custom_attributes": { "zip_code": "11120" }, "first_name": "John", "last_name": "Doe", "locale": "en-US", "name": "John Michael Doe", "phone_number": "+14155552671" })// Use case: Update user profile with a custom zip code attributeupdateUser := &usersv1.UpdateUser{ UserProfile: &usersv1.UpdateUserProfile{ CustomAttributes: map[string]string{ "zip_code": "11120", }, FirstName: "John", LastName: "Doe", Locale: "en-US", Name: "John Michael Doe", PhoneNumber: "+14155552671", },}
updatedUser, err := scalekitClient.User().UpdateUser(ctx, "<userId>", updateUser)// Use case: Update user profile with a custom zip code attributeUpdateUser updateUser = UpdateUser.newBuilder() .setUserProfile( UpdateUserProfile.newBuilder() .putCustomAttributes("zip_code", "11120") .setFirstName("John") .setLastName("Doe") .setLocale("en-US") .setName("John Michael Doe") .setPhoneNumber("+14155552671") .build()) .build();
UpdateUserRequest updateReq = UpdateUserRequest.newBuilder() .setUser(updateUser) .build();
User updatedUser = scalekitClient.users().updateUser("<userId>", updateReq);Link your system identifiers & metadata
Section titled “Link your system identifiers & metadata”Beyond user profile attributes, you can link your systems with Scalekit to easily map, identify and store more context about organizations and users.
This may be helpful when:
- You are migrating from an existing system and need to keep your existing identifiers
- You are integrating with multiple platforms and need to maintain data consistency
- You need to simplify integration by avoiding complex ID mapping between your systems and Scalekit
Organization external IDs for system integration
Section titled “Organization external IDs for system integration”External IDs let you identify organizations using your own identifiers instead of Scalekit’s generated IDs. This is essential when migrating from existing systems or integrating with multiple platforms.
-
Set external IDs during organization creation
Section titled “Set external IDs during organization creation”Include your system’s identifier when creating organizations to maintain consistent references across your infrastructure.
Create organization with external ID // During user signup or organization creationconst organization = await scalekit.organization.create({display_name: 'Acme Corporation',external_id: 'CUST-12345-ACME' // Your customer ID in your database});console.log('Organization created:', organization.id);console.log('Your ID:', organization.external_id);Create organization with external ID # During user signup or organization creationorganization = scalekit.organization.create({'display_name': 'Acme Corporation','external_id': 'CUST-12345-ACME' # Your customer ID in your database})print(f'Organization created: {organization.id}')print(f'Your ID: {organization.external_id}')Create organization with external ID // During user signup or organization creationorg, err := scalekit.Organization.Create(OrganizationCreateOptions{DisplayName: "Acme Corporation",ExternalId: "CUST-12345-ACME", // Your customer ID in your database})if err != nil {log.Fatal(err)}fmt.Printf("Organization created: %s\n", org.Id)fmt.Printf("Your ID: %s\n", org.ExternalId)Create organization with external ID // During user signup or organization creationOrganization organization = scalekit.organization().create("Acme Corporation","CUST-12345-ACME" // Your customer ID in your database);System.out.println("Organization created: " + organization.getId());System.out.println("Your ID: " + organization.getExternalId()); -
Find organizations using your IDs
Section titled “Find organizations using your IDs”Use external IDs to quickly locate organizations when processing webhooks, handling customer support requests, or syncing data between systems.
Find organization by external ID // When processing a webhook or customer updateconst customerId = 'CUST-12345-ACME'; // From your webhook payloadconst organization = await scalekit.organization.getByExternalId(customerId);if (organization) {console.log('Found organization:', organization.display_name);// Process organization updates, sync data, etc.}Find organization by external ID # When processing a webhook or customer updatecustomer_id = 'CUST-12345-ACME' # From your webhook payloadorganization = scalekit.organization.get_by_external_id(customer_id)if organization:print(f'Found organization: {organization.display_name}')# Process organization updates, sync data, etc.Find organization by external ID // When processing a webhook or customer updatecustomerId := "CUST-12345-ACME" // From your webhook payloadorg, err := scalekit.Organization.GetByExternalId(customerId)if err != nil {log.Printf("Error finding organization: %v", err)return}if org != nil {fmt.Printf("Found organization: %s\n", org.DisplayName)// Process organization updates, sync data, etc.}Find organization by external ID // When processing a webhook or customer updateString customerId = "CUST-12345-ACME"; // From your webhook payloadOrganization organization = scalekit.organization().getByExternalId(customerId);if (organization != null) {System.out.println("Found organization: " + organization.getDisplayName());// Process organization updates, sync data, etc.} -
Update external IDs when needed
Section titled “Update external IDs when needed”If your customer IDs change or you need to migrate identifier formats, you can update external IDs for existing organizations.
Update external ID const updatedOrg = await scalekit.organization.update(organizationId, {external_id: 'NEW-CUST-12345-ACME'});console.log('External ID updated:', updatedOrg.external_id);Update external ID updated_org = scalekit.organization.update(organization_id, {'external_id': 'NEW-CUST-12345-ACME'})print(f'External ID updated: {updated_org.external_id}')Update external ID updatedOrg, err := scalekit.Organization.Update(organizationId, OrganizationUpdateOptions{ExternalId: "NEW-CUST-12345-ACME",})fmt.Printf("External ID updated: %s\n", updatedOrg.ExternalId)Update external ID Organization updatedOrg = scalekit.organization().update(organizationId, Map.of("external_id", "NEW-CUST-12345-ACME"));System.out.println("External ID updated: " + updatedOrg.getExternalId());
User external IDs and metadata
Section titled “User external IDs and metadata”Just as organizations need external identifiers, users often require integration with existing systems. User external IDs and metadata work similarly to organization identifiers, enabling you to link Scalekit users with your CRM, HR systems, and other business applications.
When to use user external IDs and metadata
Section titled “When to use user external IDs and metadata”External IDs link Scalekit users to your existing systems:
- Reference users in your database, CRM, or billing system
- Maintain consistent user identification across multiple platforms
- Enable easy data synchronization and lookups
Metadata stores additional user attributes:
- Organizational information (department, location, role level)
- Business context (territory, quota, access permissions)
- Integration data (external system IDs, custom properties)
Set user external IDs and metadata during user creation
Section titled “Set user external IDs and metadata during user creation”// Use case: Create user during system migration or bulk import with existing system referencesconst { user } = await scalekit.user.createUserAndMembership("<organizationId>", { email: "john.doe@company.com", externalId: "SALESFORCE-003921", metadata: { department: "Sales", employeeId: "EMP-002", territory: "West Coast", quota: 150000, crmAccountId: "ACC-789", hubspotContactId: "12345", }, userProfile: { firstName: "John", lastName: "Doe", }, sendInvitationEmail: true,});# Use case: Create user during system migration or bulk import with existing system referencesuser_response = scalekit.user.create_user_and_membership( "<organization_id>", email="john.doe@company.com", external_id="SALESFORCE-003921", metadata={ "department": "Sales", "employee_id": "EMP-002", "territory": "West Coast", "quota": 150000, "crm_account_id": "ACC-789", "hubspot_contact_id": "12345" }, user_profile={ "first_name": "John", "last_name": "Doe" }, send_invitation_email=True)// Use case: Create user during system migration or bulk import with existing system referencesnewUser := &usersv1.CreateUser{ Email: "john.doe@company.com", ExternalId: "SALESFORCE-003921", Metadata: map[string]string{ "department": "Sales", "employee_id": "EMP-002", "territory": "West Coast", "quota": "150000", "crm_account_id": "ACC-789", "hubspot_contact_id": "12345", }, UserProfile: &usersv1.CreateUserProfile{ FirstName: "John", LastName: "Doe", },}userResp, err := scalekitClient.User().CreateUserAndMembership( ctx, "<organizationId>", newUser, true, // sendInvitationEmail)// Use case: Create user during system migration or bulk import with existing system referencesCreateUser createUser = CreateUser.newBuilder() .setEmail("john.doe@company.com") .setExternalId("SALESFORCE-003921") .putMetadata("department", "Sales") .putMetadata("employee_id", "EMP-002") .putMetadata("territory", "West Coast") .putMetadata("quota", "150000") .putMetadata("crm_account_id", "ACC-789") .putMetadata("hubspot_contact_id", "12345") .setUserProfile( CreateUserProfile.newBuilder() .setFirstName("John") .setLastName("Doe") .build()) .build();
CreateUserAndMembershipRequest createUserReq = CreateUserAndMembershipRequest.newBuilder() .setUser(createUser) .setSendInvitationEmail(true) .build();
CreateUserAndMembershipResponse userResp = scalekitClient.users() .createUserAndMembership("<organizationId>", createUserReq);Update user external IDs and metadata for existing users
Section titled “Update user external IDs and metadata for existing users”// Use case: Link user with external systems (CRM, HR) and track custom attributes in a single callconst updatedUser = await scalekit.user.updateUser("<userId>", { externalId: "SALESFORCE-003921", metadata: { department: "Sales", employeeId: "EMP-002", territory: "West Coast", quota: 150000, crmAccountId: "ACC-789", hubspotContactId: "12345", },});# Use case: Link user with external systems (CRM, HR) and track custom attributes in a single callupdated_user = scalekit.user.update_user( "<user_id>", external_id="SALESFORCE-003921", metadata={ "department": "Sales", "employee_id": "EMP-002", "territory": "West Coast", "quota": 150000, "crm_account_id": "ACC-789", "hubspot_contact_id": "12345" })// Use case: Link user with external systems (CRM, HR) and track custom attributes in a single callupdateUser := &usersv1.UpdateUser{ ExternalId: "SALESFORCE-003921", Metadata: map[string]string{ "department": "Sales", "employee_id": "EMP-002", "territory": "West Coast", "quota": "150000", "crm_account_id": "ACC-789", "hubspot_contact_id": "12345", },}updatedUser, err := scalekitClient.User().UpdateUser( ctx, "<userId>", updateUser,)// Use case: Link user with external systems (CRM, HR) and track custom attributes in a single callUpdateUser updateUser = UpdateUser.newBuilder() .setExternalId("SALESFORCE-003921") .putMetadata("department", "Sales") .putMetadata("employee_id", "EMP-002") .putMetadata("territory", "West Coast") .putMetadata("quota", "150000") .putMetadata("crm_account_id", "ACC-789") .putMetadata("hubspot_contact_id", "12345") .build();
UpdateUserRequest updateReq = UpdateUserRequest.newBuilder() .setUser(updateUser) .build();
User updatedUser = scalekitClient.users().updateUser("<userId>", updateReq);Find users by external ID
Section titled “Find users by external ID”// Use case: Look up Scalekit user when you have your system's user IDconst user = await scalekit.user.getUserByExternalId("<organizationId>", "SALESFORCE-003921");console.log(`Found user: ${user.email} with ID: ${user.id}`);# Use case: Look up Scalekit user when you have your system's user IDuser = scalekit.user.get_user_by_external_id("<organization_id>", "SALESFORCE-003921")print(f"Found user: {user['email']} with ID: {user['id']}")// Use case: Look up Scalekit user when you have your system's user IDuser, err := scalekitClient.User().GetUserByExternalId( ctx, "<organizationId>", "SALESFORCE-003921",)if err != nil { log.Printf("User not found: %v", err)} else { fmt.Printf("Found user: %s with ID: %s\n", user.Email, user.Id)}// Use case: Look up Scalekit user when you have your system's user IDtry { GetUserByExternalIdResponse response = scalekitClient.users() .getUserByExternalId("<organizationId>", "SALESFORCE-003921");
User user = response.getUser(); System.out.printf("Found user: %s with ID: %s%n", user.getEmail(), user.getId());} catch (Exception e) { System.err.println("User not found: " + e.getMessage());}This integration approach maintains consistent user identity across your system architecture while letting you choose the source of truth for authentication and authorization. Both user and organization external IDs work together to provide complete system integration capabilities.