Directory sync
Sync users and groups via SCIM directories
Use scalekit_client.directory for SCIM directory sync—listing providers, users, and groups provisioned from an IdP.
Use this after SSO is in place when the customer provisions users via SCIM.
list_directories
Section titled “list_directories”#asynclist_directories
Method to list directories for given organization id
org id to fetch directory list
list of directories
response = scalekit_client.directory.list_directories('org_123456')
for directory in response[0].directories: print(f"Directory: {directory.id}")get_directory
Section titled “get_directory”#asyncget_directory
Method to get directory based on given organization and directory id
Organization id
directory id
Get Directory Response
response = scalekit_client.directory.get_directory( 'org_123456', 'directory_123456')directory = response[0].directorycreate_directory
Section titled “create_directory”#asynccreate_directory
Method to create directory based on given organization id
Organization id to create directory for
CreateDirectory object with expected values for dir creation
Create Directory Response
from scalekit.v1.directories.directories_pb2 import CreateDirectory
directory = CreateDirectory()directory.provider = "azure"
response = scalekit_client.directory.create_directory( 'org_123456', directory)list_directory_users
Section titled “list_directory_users”#asynclist_directory_users
Runs list_directory_users and returns the result.
Organization ID.
Directory ID.
Results per page.
Pagination token.
Include detail.
Updated after.
tuple[ListDirUsersResponse, Any]
response = scalekit_client.directory.list_directory_users( 'org_123456', 'directory_123456', page_size=50)
for user in response[0].users: print(f"User: {user.email}")list_directory_groups
Section titled “list_directory_groups”#asynclist_directory_groups
Runs list_directory_groups and returns the result.
Organization ID.
Directory ID.
Results per page.
Pagination token.
Include detail.
Updated after.
tuple[ListDirGroupsResponse, Any]
response = scalekit_client.directory.list_directory_groups( 'org_123456', 'directory_123456', page_size=50)
for group in response[0].groups: print(f"Group: {group.display_name}")enable_directory
Section titled “enable_directory”#asyncenable_directory
Method to enable directory based on given organization and directory id
Organization id
directory id
Toggle Directory Response
scalekit_client.directory.enable_directory('org_123456', 'directory_123456')disable_directory
Section titled “disable_directory”#asyncdisable_directory
Method to disable directory based on given organization and directory id
Organization id
directory id
Toggle Directory Response
scalekit_client.directory.disable_directory('org_123456', 'directory_123456')delete_directory
Section titled “delete_directory”#asyncdelete_directory
Method to delete directory based on given organization and directory id
Organization id to delete directory for
Directory id for directory to be deleted
Empty on success.
scalekit_client.directory.delete_directory('org_123456', 'directory_123456')get_primary_directory_by_organization_id
Section titled “get_primary_directory_by_organization_id”#asyncget_primary_directory_by_organization_id
Method to get primary directory based on given organization id
Organization id
Primary directory