Skip to content

Manage user memberships

How users join, switch, and leave organizations (a.k.a workspaces)

Users can be members of multiple organizations, with distinct roles and permissions for each. Access controls are dynamically assigned based on the user’s organizational context and specific role.

Explore the following example of Scalekit’s user data model:

UseridstringPKemailstringexternal_idstringcreate_timetimestampupdate_timetimestampmetadataobjectUserProfileidstringPKuser_idstringFKfirst_namestringlast_namestringnamestringemail_verifiedbooleanlocalestringphone_numberstringcustom_attributesobjectmetadataobjectMembershipidstringPKuser_idstringFKorganization_idstringdisplay_namestringmembership_statusenumjoin_timetimestampcreated_attimestampaccepted_attimestampexpires_attimestampinviter_emailstringmetadataobjectRoleidstringPKmembership_idstringFKnamestringdisplay_namestring 1:1 1:N 1:N
Show me the User Object
{
"user": {
"create_time": "2025-10-13T17:06:39.862Z",
"email": "user@example.com",
"external_id": "ext_12345a67b89c",
"id": "usr_1234abcd5678efgh",
"memberships": [
{
"accepted_at": "2025-10-13T17:06:39.862Z",
"created_at": "2025-10-13T17:06:39.862Z",
"display_name": "AcmeCorp",
"expires_at": "2025-10-13T17:06:39.862Z",
"inviter_email": "string",
"join_time": "2025-10-13T17:06:39.862Z",
"membership_status": "ACTIVE",
"metadata": {
"department": "engineering",
"location": "nyc-office"
},
"name": "AcmeCorp",
"organization_id": "org_1234abcd5678efgh",
"roles": [
{
"display_name": "Dev Team",
"id": "role_79643236410327240",
"name": "team_dev"
}
]
}
],
"metadata": {
"department": "engineering",
"location": "nyc-office"
},
"update_time": "2025-10-13T17:06:39.862Z",
"user_profile": {
"custom_attributes": {
"department": "engineering",
"security_clearance": "level2"
},
"email_verified": true,
"first_name": "John",
"id": "usr_profile_1234abcd5678efgh",
"last_name": "Doe",
"locale": "en-US",
"metadata": {
"account_status": "active",
"signup_source": "mobile_app"
},
"name": "John Michael Doe",
"phone_number": "+14155552671"
}
}
}s

While the dashboard is useful for manual operations, most applications need to manage users programmatically to integrate with existing systems. The examples below demonstrate common user management operations.

List, create, invite, update, and delete users programmatically
// 1. Install the Scalekit SDK
// 2. Create an organization
// Use case: When a new company signs up for your B2B application
const {
organization: {
id: organizationId
}
} = await scalekit.organization.createOrganization("Megasoft");
// 3. Create a user and send invitation email
// Use case: HR system integration, bulk user imports, or admin-initiated account creation
const { user } = await scalekit.user.createUserAndMembership("<organizationId>", {
email: "user@example.com",
userProfile: {
firstName: "John",
lastName: "Doe",
},
sendInvitationEmail: true
});
// 4. List users in an organization
// Use case: Display user directory, security audits, billing calculations, or compliance reporting
const { users } = await scalekit.user.listOrganizationUsers("<organizationId>");
// 5. Update user profile
// Use case: Sync changes from external systems, or when users update their profile information
await scalekit.user.updateUser("<users[0].id>", {
userProfile: {
firstName: "John",
lastName: "Smith", // Updated last name
},
});
// 6. Delete user permanently
// Use case: User account closure, GDPR deletion requests, or cleaning up test accounts
await scalekit.user.deleteUser("<users[0].id>");

Manage user memberships in the Scalekit dashboard

Section titled “Manage user memberships in the Scalekit dashboard”

The Scalekit dashboard provides a fast, centralized way to manage users across organizations. Quickly view user lists, edit profile details, and update access controls—all from a single interface.

Go to Dashboard > Users

  • Invite users to join an organization
  • Assign roles
  • Add them to organizations
  • Suspend or deactivate users
  • Update user information and role assignments
  • View active and inactive users