Skip to content
Scalekit Docs
Talk to an EngineerDashboard

Users

Provision and manage users and memberships

Use the user client to provision people, manage organization memberships, and assign roles.

Common flows: invite or create a user, attach them to an organization, update profile fields, and look up users by Scalekit ID or your external ID.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynccreateUserAndMembership

Creates a new user and adds them as a member of an organization in a single operation.

paramorganizationIdstring

The organization ID to add the user to

paramoptionsCreateUserRequest

Optional request settings.

returnsCreateUserAndMembershipResponse

The created resource.

const response = await scalekit.user.createUserAndMembership(
'org_123456',
{
email: 'john.doe@company.com',
userProfile: {
firstName: 'John',
lastName: 'Doe'
},
sendInvitationEmail: true,
metadata: {
department: 'Engineering'
}
}
);
console.log('User created:', response.user.id);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncgetUser

Retrieves comprehensive details about a specific user including their profile and memberships.

paramuserIdstring

Scalekit user ID (usr_...).

returnsGetUserResponse

The user.

const response = await scalekit.user.getUser('usr_123456');
const user = response.user;
console.log('User:', user.email);
console.log('Name:', user.userProfile?.firstName, user.userProfile?.lastName);
console.log('Organizations:', user.memberships?.length);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynclistUsers

Retrieves a paginated list of all users across your Scalekit environment.

paramoptionsobject

Optional fields: pageSize, pageToken.

pageSize, pageToken
returnsListUsersResponse

Paginated users.

// pageSize: Results per page (default 10, max 100)
// pageToken: Token for the next page
const response = await scalekit.user.listUsers({
pageSize: 20
});
console.log('Users:', response.users.length);
console.log('Total users:', response.totalSize);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncupdateUser

Updates a user’s profile information and custom metadata.

paramuserIdstring

The Scalekit user identifier (format: “usr_…”)

paramoptionsUpdateUserRequestType

Fields to update.

returnsUpdateUserResponse

The updated user.

// metadata: Custom key-value metadata
const response = await scalekit.user.updateUser('usr_123456', {
userProfile: {
firstName: 'John',
lastName: 'Smith'
},
metadata: {
department: 'Engineering',
title: 'Senior Developer'
}
});
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncdeleteUser

Permanently deletes a user from your Scalekit environment.

paramuserIdstring

Scalekit user ID (usr_...).

returnsobject

Empty response on successful deletion

MessageShape(typeof EmptySchema)
await scalekit.user.deleteUser('usr_123456');
console.log('User deleted successfully');
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynccreateMembership

Adds an existing user as a member of a new organization with specified roles.

paramorganizationIdstring

Organization ID.

paramuserIdstring

The user ID to add as a member (format: “usr_…”)

paramoptionsobject

Optional fields: roles, metadata, sendInvitationEmail.

roles, metadata, sendInvitationEmail
returnsCreateMembershipResponse

The created resource.

// roles: Assigned roles
// sendInvitationEmail: send invitation email
const response = await scalekit.user.createMembership(
'org_123456',
'usr_789012',
{
roles: ['admin'],
sendInvitationEmail: true
}
);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncdeleteMembership

Removes a user’s membership from a specific organization.

paramorganizationIdstring

Organization ID.

paramuserIdstring

The user ID to remove (format: “usr_…”)

returnsobject

Empty response on successful removal

MessageShape(typeof EmptySchema)
await scalekit.user.deleteMembership('org_123456', 'usr_789012');
console.log('User removed from organization');
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncupdateMembership

Updates a user’s roles and metadata within a specific organization.

paramorganizationIdstring

Organization ID.

paramuserIdstring

Scalekit user ID (usr_...).

paramoptionsobject

Optional fields: roles, metadata.

roles, metadata
returnsUpdateMembershipResponse

The updated resource.

// roles: Assigned roles
const response = await scalekit.user.updateMembership(
'org_123456',
'usr_789012',
{ roles: ['admin'] }
);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynclistOrganizationUsers

Retrieves a paginated list of all users who are members of a specific organization.

paramorganizationIdstring

Organization ID.

paramoptionsobject

Optional fields: pageSize, pageToken.

pageSize, pageToken
returnsListOrganizationUsersResponse

Paginated users.

// pageSize: Results per page (default 10, max 100)
// pageToken: Token for the next page
const response = await scalekit.user.listOrganizationUsers('org_123456', {
pageSize: 25
});
console.log('Organization users:', response.users.length);
console.log('Total members:', response.totalSize);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncresendInvite

Resends an invitation email to a user for a specific organization.

paramorganizationIdstring

The organization ID for which to resend the invite.

paramuserIdstring

Scalekit user ID (usr_...).

returnsResendInviteResponse

Resend invite.

const response = await scalekit.user.resendInvite('org_123456', 'usr_789012');
console.log('Invitation resent:', response.invite);
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynclistUserRoles

Lists all roles assigned to a user within a specific organization.

paramorganizationIdstring

Organization ID.

paramuserIdstring

The user ID whose roles to list (format: “usr_…”)

returnsListUserRolesResponse

Paginated roles.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynclistUserPermissions

Lists all effective permissions for a user within a specific organization.

paramorganizationIdstring

Organization ID.

paramuserIdstring

Scalekit user ID (usr_...).

returnsListUserPermissionsResponse

Paginated permissions.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncsearchUsers

Searches for users matching a query string across the environment.

paramquerystring

Search query string

parampageSizenumber

Optional. Number of results per page

parampageTokenstring

Optional. Pagination token for the next page

returnsSearchUsersResponse

Paginated results.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncsearchOrganizationUsers

Searches for users matching a query string within a specific organization.

paramorganizationIdstring

The organization ID to search within

paramquerystring

Search query string

parampageSizenumber

Optional. Number of results per page

parampageTokenstring

Optional. Pagination token for the next page

returnsSearchOrganizationUsersResponse

Paginated results.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncassignUserRoles

Assigns roles to a user within a specific organization.

paramorganizationIdstring

The organization ID

paramuserIdstring

The user ID to assign roles to

paramrolesstring[]

Array of role names to assign

returnsAssignUserRolesResponse

Assign user roles.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncremoveUserRole

Removes a specific role from a user within an organization.

paramorganizationIdstring

The organization ID

paramuserIdstring

The user ID to remove the role from

paramroleNamestring

The name of the role to remove

returnsobject

Empty response on success

MessageShape(typeof EmptySchema)
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncgetUserByExternalId

Retrieves a user by their external ID.

paramexternalIdstring

The external identifier for the user

returnsGetUserResponse

The user.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncupdateUserByExternalId

Updates a user identified by their external ID.

paramexternalIdstring

The external identifier for the user

paramoptionsobject

Fields to update.

Omit(UpdateUserRequestType, 'externalId')
returnsUpdateUserResponse

The updated user.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncdeleteUserByExternalId

Permanently deletes a user identified by their external ID.

paramexternalIdstring

The external identifier for the user

returnsobject

Empty response on success

MessageShape(typeof EmptySchema)
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asynccreateMembershipByExternalId

Adds a user identified by external ID as a member of an organization.

paramorganizationIdstring

The organization ID to add the user to

paramexternalIdstring

The external identifier for the user

paramoptionsobject

Optional fields: roles, metadata, sendInvitationEmail.

roles, metadata, sendInvitationEmail
returnsCreateMembershipResponse

The created resource.

clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncdeleteMembershipByExternalId

Removes the membership of a user identified by external ID from an organization.

paramorganizationIdstring

The organization ID to remove the user from

paramexternalIdstring

The external identifier for the user

returnsobject

Empty response on success

MessageShape(typeof EmptySchema)
clientUsershttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/user.ts
#asyncupdateMembershipByExternalId

Updates the membership of a user identified by external ID within an organization.

paramorganizationIdstring

The organization ID where the membership exists

paramexternalIdstring

The external identifier for the user

paramoptionsobject

Optional fields: roles, metadata.

roles, metadata
returnsUpdateMembershipResponse

The updated resource.