# OrganizationDomain object div strong 🔨 In Development — This section is still being developed and may change. The OrganizationDomain object represents email domains associated with an organization. Domains enable automatic user assignment when users register with matching email addresses. ## Properties ### Identity **`id`** integer required Unique domain identifier (auto-incrementing integer). **`name`** string required Domain name (e.g., `aitronos.com`, `example.org`). Should not include protocol or subdomain. ### Relationships **`organization_id`** string required Reference to the [Organization](/docs/api-reference/objects/organization-object) this domain belongs to. ### Status **`is_deleted`** boolean required Soft delete flag. When `true`, the domain is inactive but preserved for audit purposes. Default: `false`. ### Timestamps **`created_at`** string required Timestamp when the domain was added. Format: ISO 8601 datetime string. **`updated_at`** string required Timestamp when the domain was last updated. Format: ISO 8601 datetime string. ## Domain-Based Auto-Assignment When a user registers with an email address matching an organization's domain: 1. System checks for matching OrganizationDomain records 2. If match found, user is automatically added to the organization 3. User is assigned the default "member" role 4. User status is set to "Active" ### Example Flow User registers with `john@aitronos.com`: - System finds OrganizationDomain with `name: "aitronos.com"` - User automatically joins the associated organization - No invitation required ## Multiple Domains Organizations can have multiple domains: - `company.com` - `company.org` - `subsidiary.com` Users from any of these domains will be auto-assigned to the organization. ## Security Considerations - Domain verification should be implemented to prevent unauthorized access - Consider requiring email verification before auto-assignment - Admins should be able to disable auto-assignment per domain - Monitor for suspicious domain registrations **Active Domain** ```json { "id": 1, "name": "aitronos.com", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "is_deleted": false, "created_at": "2025-01-10T09:00:00Z", "updated_at": "2025-01-10T09:00:00Z" } ``` **Multiple Domains for One Organization** ```json [ { "id": 1, "name": "aitronos.com", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "is_deleted": false, "created_at": "2025-01-10T09:00:00Z", "updated_at": "2025-01-10T09:00:00Z" }, { "id": 2, "name": "aitronos.ai", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "is_deleted": false, "created_at": "2025-01-10T09:05:00Z", "updated_at": "2025-01-10T09:05:00Z" }, { "id": 3, "name": "freddy.ai", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "is_deleted": false, "created_at": "2025-01-10T09:10:00Z", "updated_at": "2025-01-10T09:10:00Z" } ] ``` **Deleted Domain (Soft Delete)** ```json { "id": 4, "name": "old-company.com", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "is_deleted": true, "created_at": "2025-01-05T08:00:00Z", "updated_at": "2025-01-14T16:45:00Z" } ```