# OrganizationUser object div strong 🔨 In Development — This section is still being developed and may change. The OrganizationUser object represents the membership relationship between a user and an organization, including their role and status within that organization. ## Properties ### Identity **`id`** string required Unique organization-user relationship identifier. Format: `ogu_` followed by 12 alphanumeric characters. ### Relationships **`organization_id`** string required Reference to the [Organization](/docs/api-reference/objects/organization-object) this membership belongs to. **`user_id`** string required Reference to the [User](/docs/api-reference/objects/user-object) who is a member of the organization. **`role_id`** string required Reference to the [Role](/docs/api-reference/objects/role-object) assigned to the user in this organization. **`status_id`** string required Reference to the [UserStatus](/docs/api-reference/objects/user-status-object) of the user in this organization. ### Membership Details **`joined_at`** string required Timestamp when the user joined the organization. Format: ISO 8601 datetime string. **`is_deleted`** boolean required Soft delete flag. When `true`, the user is removed from the organization but the record is preserved for audit purposes. Default: `false`. ## Usage OrganizationUser records are created when: - A user creates a new organization (automatically assigned as owner) - A user is invited to an organization - A user is auto-assigned based on email domain matching - An admin manually adds a user to an organization The relationship supports: - **Multi-organization membership**: Users can belong to multiple organizations - **Role-based access control**: Different roles per organization - **Status tracking**: Active, inactive, invited, etc. - **Soft deletion**: Preserves audit trail when users leave ```json { "id": "ogu_a1b2c3d4e5f6", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "user_id": "uid_xyz789uvw123abc456", "role_id": "rol_admin_abc123", "status_id": "sts_active_def456", "joined_at": "2025-01-10T09:00:00Z", "is_deleted": false } ``` **Example: Invited user (pending acceptance)** ```json { "id": "ogu_b2c3d4e5f6g7", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "user_id": "uid_newuser123456789", "role_id": "rol_member_xyz789", "status_id": "sts_invitation_sent", "joined_at": "2025-01-15T10:30:00Z", "is_deleted": false } ``` **Example: Removed user (soft deleted)** ```json { "id": "ogu_c3d4e5f6g7h8", "organization_id": "ORG_A1B2C3D4E5F6G7H8", "user_id": "uid_formeruser987654", "role_id": "rol_member_xyz789", "status_id": "sts_deleted_ghi789", "joined_at": "2025-01-05T08:00:00Z", "is_deleted": true } ```