Organizations

An Organization is the top-level billing and access boundary. Users can belong to multiple organizations, and each organization contains one or more projects.

Methods

MethodDescription
organizations.list()List all organizations the authenticated user belongs to
organizations.get(organizationId)Fetch a single organization
organizations.listProjects(organizationId)List projects in an organization

organizations.list()

typescript
const { data: orgs } = await client.organizations.list()
 
for (const org of orgs) {
  console.log(org.id, org.name, org.slug, org.status)
}

organizations.get(organizationId)

typescript
const { data: org } = await client.organizations.get('org_abc123')
console.log(org.name, org.status) // 'Acme Corp', 'active'

organizations.listProjects(organizationId)

typescript
const { data: projects } = await client.organizations.listProjects('org_abc123')
for (const project of projects) {
  console.log(project.id, project.name, project.slug)
}

Type reference

typescript
interface Organization {
  id: string
  name: string
  slug: string
  status: 'active' | 'suspended' | 'deleted'
  metadata: Record<string, unknown> | null
  createdAt: string
  updatedAt: string
}
  • Projects — projects nest inside organizations
  • Meme.organizations lists org memberships with roles