An organization domain represents an organization’s domain. Domains can be verified to assert that an organization owns the configured domain which is accomplished through DNS TXT record verification.
Organization domains can be verified manually (through the API or the Dashboard), or through a self-serve flow through the Admin Portal.
The organization that defines this domain policy exerts authentication policy control over that domain across your application.
For this reason, it is important to verify ownership of manually added domains.
Additionally, WorkOS does not allow addition of common consumer domains, like gmail.com.
To automatically respond to changes in the organization domains, use organization domain events.
const organization_domain = { object: 'organization_domain', id: 'org_domain_01HE8GSH9BC1T08J2A9K6TDERK', organizationId: 'org_01HE8GSH8FQPASKSY27THRKRBP', domain: 'foo-corp.com', state: 'verified', verificationStrategy: 'dns', verificationToken: 'm5Oztg3jdK4NJLgs8uIlIprMw', };
interface OrganizationDomainGet the details of an existing organization.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizationDomains.get( 'org_domain_01HEJXJSTVEDT7T58BM70FMFET', );
Creates a new Organization Domain.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizationDomains.create({ organizationId: 'org_01EHT88Z8J8795GZNQ4ZP1J81T', domain: 'foo-corp.com', });
Initiates verification process for an Organization Domain.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizationDomains.verify( 'org_domain_01HEJXJSTVEDT7T58BM70FMFET', );