Skip to content

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.

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 number
2 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.

To add a custom attribute

  1. Navigate to Dashboard > User Attributes and click Add Attribute.
  2. 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)
  3. 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.

Your AppScalekitCustomerWorkspaceOrganizationIdentity ProviderUserzip_codeUserzip_codeUserzip_code zip_code90210 zip_code90210

Administrators can configure attribute mapping from their identity provider by selecting specific user profile attributes. This mapping supports both standard and custom attributes seamlessly.

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.

Terminal window
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"
}
}
}'

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.

  1. 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 creation
    const 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);
  2. 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 update
    const customerId = 'CUST-12345-ACME'; // From your webhook payload
    const organization = await scalekit.organization.getByExternalId(customerId);
    if (organization) {
    console.log('Found organization:', organization.display_name);
    // Process organization updates, sync data, etc.
    }
  3. 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);

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”
Create user with external ID and metadata
// Use case: Create user during system migration or bulk import with existing system references
const { 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,
});

Update user external IDs and metadata for existing users

Section titled “Update user external IDs and metadata for existing users”
Update user external ID and metadata
// Use case: Link user with external systems (CRM, HR) and track custom attributes in a single call
const 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",
},
});
Find user by external ID
// Use case: Look up Scalekit user when you have your system's user ID
const user = await scalekit.user.getUserByExternalId("<organizationId>", "SALESFORCE-003921");
console.log(`Found user: ${user.email} with ID: ${user.id}`);

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.