ObjectStackObjectStack

Organization — Identity Protocol reference

Defines the standard organization/workspace model for ObjectStack. Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.

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.

Source: packages/spec/src/identity/organization.zod.ts

TypeScript Usage

import { InvitationSchema, InvitationStatus, MemberSchema, OrganizationSchema } from '@objectstack/spec/identity';
import type { Invitation, InvitationStatus, Member, Organization } from '@objectstack/spec/identity';

// Validate data
const result = InvitationSchema.parse(data);

Invitation

Properties

PropertyTypeRequiredDescription
idstring✅Unique invitation identifier
organizationIdstring✅Organization ID
emailstring✅Invitee email address
rolestring✅Role to assign upon acceptance (owner, admin, delegated_admin, member — ADR-0108 closed vocabulary)
statusEnum<'pending' | 'accepted' | 'rejected' | 'expired' | 'canceled'>optional (default: "pending")Invitation status
expiresAtstring✅Invitation expiry timestamp
inviterIdstring✅User ID of the inviter
createdAtstring✅Invitation creation timestamp
updatedAtstringoptionalLast update timestamp (no such column on sys_invitation; absent on the wire)

InvitationStatus

Allowed Values

  • pending
  • accepted
  • rejected
  • expired
  • canceled

Member

Properties

PropertyTypeRequiredDescription
idstring✅Unique member identifier
organizationIdstring✅Organization ID
userIdstring✅User ID
rolestring✅Member role (owner, admin, delegated_admin, member — ADR-0108 closed vocabulary)
createdAtstring✅Member creation timestamp
updatedAtstringoptionalLast update timestamp (no such column on sys_member; absent on the wire)

Organization

Properties

PropertyTypeRequiredDescription
idstring✅Unique organization identifier
namestring✅Organization display name
slugstring✅Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores)
logostring | nulloptionalOrganization logo URL
metadataRecord<string, any>optionalCustom metadata
createdAtstring✅Organization creation timestamp
updatedAtstringoptionalLast update timestamp (absent on the better-auth organization wire)

On this page