Organizations
Organizations are top-level entities for grouping teams and projects. Each organization has its own members, roles, and settings.
Model
Organization
├── name, slug, description, logoUrl
├── members (with roles: OWNER, ADMIN, MANAGER, MEMBER)
├── teams (teams linked to the organization)
└── projects (projects linked to the organization)API Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/organizations | List user's organizations |
POST | /api/organizations | Create organization |
GET | /api/organizations/by-slug/:slug | Get organization details |
PATCH | /api/organizations/by-slug/:slug | Update organization |
DELETE | /api/organizations/by-slug/:slug | Delete organization |
GET | /api/organizations/by-slug/:slug/members | List members |
POST | /api/organizations/by-slug/:slug/members | Invite member |
PATCH | /api/organizations/by-slug/:slug/members/:userId | Change member role |
DELETE | /api/organizations/by-slug/:slug/members/:userId | Remove member |
GET | /api/organizations/by-slug/:slug/quota | Get organization quota |
PATCH | /api/organizations/by-slug/:slug/plan | Change organization plan |
POST | /api/organizations/by-slug/:slug/avatar | Upload organization avatar |
Frontend Routes
| Route | View | Description |
|---|---|---|
/organizations | OrganizationsListView | List all user organizations |
/organizations/:orgId | OrganizationDetailView | Organization overview |
/organizations/:orgId/settings | OrganizationSettingsView | Organization settings |
Frontend Store
typescript
const store = useOrganizationsStore()
const { organizations, currentOrganization } = storeToRefs(store)
await store.fetchOrganizations()
await store.fetchOrganization(orgId)
await store.createOrganization({ name, slug, description })
await store.updateOrganization(orgId, { name, description })
// Members
await store.addMember(orgId, email, role)
await store.removeMember(orgId, userId)Key Implementation Details
- Organizations support custom roles with granular permissions
- Slug is used for URL-friendly identifiers
- Cascade deletion removes all linked teams, projects, and tasks
- Organization-level permissions control access to settings, member management, and billing