---
title: Organization
description: Organization protocol schemas
---

{/* ⚠️  AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

Organization Schema (Multi-Tenant Architecture)

Defines the standard organization/workspace model for ObjectStack.

Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.

This aligns with better-auth's organization plugin capabilities.

<Callout type="info">
**Source:** `packages/spec/src/identity/organization.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { Invitation, InvitationStatus, Member, Organization } from '@objectstack/spec/identity';
import type { Invitation, InvitationStatus, Member, Organization } from '@objectstack/spec/identity';

// Validate data
const result = Invitation.parse(data);
```

---

## Invitation

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique invitation identifier |
| **organizationId** | `string` | ✅ | Organization ID |
| **email** | `string` | ✅ | Invitee email address |
| **role** | `string` | ✅ | Role to assign upon acceptance |
| **status** | `Enum<'pending' \| 'accepted' \| 'rejected' \| 'expired'>` | ✅ | Invitation status |
| **expiresAt** | `string` | ✅ | Invitation expiry timestamp |
| **inviterId** | `string` | ✅ | User ID of the inviter |
| **createdAt** | `string` | ✅ | Invitation creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |


---

## InvitationStatus

### Allowed Values

* `pending`
* `accepted`
* `rejected`
* `expired`


---

## Member

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique member identifier |
| **organizationId** | `string` | ✅ | Organization ID |
| **userId** | `string` | ✅ | User ID |
| **role** | `string` | ✅ | Member role (e.g., owner, admin, member, guest) |
| **createdAt** | `string` | ✅ | Member creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |


---

## Organization

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique organization identifier |
| **name** | `string` | ✅ | Organization display name |
| **slug** | `string` | ✅ | Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores) |
| **logo** | `string` | optional | Organization logo URL |
| **metadata** | `Record<string, any>` | optional | Custom metadata |
| **createdAt** | `string` | ✅ | Organization creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |


---

