Allowed email domains
Allowed email domains lets organization admins define trusted domains for their organization. When a user signs in or signs up with a matching email domain, Scalekit suggests the user to join that organization in the organization switcher so the user can join the organization with one click. This feature is authentication-method agnostic: regardless of whether a user authenticates via SSO, social login, or passwordless authentication, organization options are suggested based on their email domain.
Introduction
Section titled “Introduction”Allowed email domains can reduce the burden of manual invitation for organization admins, avoid duplicate organization creation, and streamline membership for end users by suggesting the right organization at sign-in/sign-up.
When a user signs up or signs in, Scalekit can automatically:
- Match email domains - Check if the user’s email domain matches configured allowed domains for any organization.
- Suggest organization options - Show the user available organizations they can join through an organization switcher.
- Enable user choice - Allow users to decide which of the suggested organizations they want to join.
- Create organization membership - Automatically add the user to their selected organization.
Security consideration
Section titled “Security consideration”- Disposable and public email domains are blocked and cannot be added to the allow-list (e.g.,
gmail.com
,outlook.com
). We maintain a blocklist to enforce this.
Enabling allowed email domains
Section titled “Enabling allowed email domains”Allowed email domains can be configured for an organization through the Scalekit Dashboard or programmatically using the API.
Enable via Dashboard
Section titled “Enable via Dashboard”- Log in to your Scalekit Dashboard.
- Navigate to Organizations and select an organization.
- Open the Roles tab and find Allowed Email Domains.
- Add or edit allowed email domains for automatic suggestions/provisioning.
Enable via API
Section titled “Enable via API”You can also configure allowed email domains for an organization programmatically using the Scalekit API:
npm install @scalekit-sdk/node
pip install scalekit-sdk-python
go get -u github.com/scalekit-inc/scalekit-sdk-go
/* Gradle users - add the following to your dependencies in build file */implementation "com.scalekit:scalekit-sdk-java:2.0.1"
<!-- Maven users - add the following to your `pom.xml` --><dependency> <groupId>com.scalekit</groupId> <artifactId>scalekit-sdk-java</artifactId> <version>2.0.1</version></dependency>
Register email domain
Section titled “Register email domain”Path Parameters:
organization_id
(string, required): The ID of the organization
Request Body:
domain
(string, required): The email domain to allow (e.g., “customerdomain.com”)domain_type
(string, required): Must be “ALLOWED_EMAIL_DOMAIN”
curl 'https://$SCALEKIT_ENVIRONMENT_URL/api/v1/organizations/{organization_id}/domains' \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "domain": "customerdomain.com", "domain_type": "ALLOWED_EMAIL_DOMAIN"}'
// Add a new domain to an organizationconst response = await scalekit.createDomain("org-123", "example.com", { // Domain type: controls user authentication and email validation domainType: "ALLOWED_EMAIL_DOMAIN",});
{ "domain": { "id": "dom_88351643129225005", "domain": "newdomain.com", "environment_id": "env_58345499215790610", "organization_id": "org_81667076086825451", "create_time": "2025-09-01T12:14:43.100Z", "update_time": "2025-09-01T12:14:43.110455169Z", "domain_type": "ALLOWED_EMAIL_DOMAIN" }}
List email domains
Section titled “List email domains”Request Parameters:
- Path Parameters:
organization_id
(string, required): The ID of the organization
curl 'https://$SCALEKIT_ENVIRONMENT_URL/api/v1/organizations/{organization_id}/domains'
// List all domains in an organizationconst response = await client.domain.listDomains(organizationId);
// Domain object contains:// - id: Domain identifier// - domain: Domain name// - organizationId: Owning organization// - domainType: Configuration type
{ "domains": [ { "create_time": "2025-09-01T11:59:50.005Z", "domain": "customerdomain.com", "domain_type": "ALLOWED_EMAIL_DOMAIN", "environment_id": "env_73947929838", "id": "dom_883516432292250875", "organization_id": "org_987654321", "update_time": "2025-09-01T11:59:50.005Z", } ], "page_number": 1, "page_size": 1}
Get email domain
Section titled “Get email domain”Request Parameters:
- Path Parameters:
organization_id
(string, required): The ID of the organizationid
(string, required): The ID of the domain to retrieve
curl 'https://$SCALEKIT_ENVIRONMENT_URL/api/v1/organizations/{organization_id}/domains/{id}'
// Fetch details of a specific domainconst response = await client.domain.getDomain(organizationId, domainId);
// Domain object properties:// - id: Domain identifier// - domain: Domain name// - organizationId: Owning organization// - domainType: Domain configuration type
{ "domain": { "create_time": "2025-09-01T11:59:50.005Z", "domain": "customerdomain.com", "domain_type": "ALLOWED_EMAIL_DOMAIN", "environment_id": "env_73947929838", "id": "dom_883516432292250875", "organization_id": "org_987654321", "update_time": "2025-09-01T11:59:50.005Z" }}
Delete email domain
Section titled “Delete email domain”Request Parameters:
- Path Parameters:
organization_id
(string, required): The ID of the organizationid
(string, required): The ID of the domain to delete
curl 'https://$SCALEKIT_ENVIRONMENT_URL/api/v1/organizations/{organization_id}/domains/{id}' \ --request DELETE
// Remove a domain from an organization// Caution: Deletion is permanent and may affect user accessconst response = await client.domain.deleteDomain(organizationId, domainId);