Platform
Organizations & Teams
CognitionDesk supports multi-tenant organizations with full RBAC. Create an organization, invite team members, manage projects, and control access at the role level.
RBAC Roles
TypeScript
// Role hierarchy
type Role = 'owner' | 'admin' | 'member' | 'viewer';
// Permissions:
// owner → everything including billing and org deletion
// admin → manage members, projects, all content
// member → create and edit resources within projects
// viewer → read-only access to org resourcesCreating an organization
JSON
POST /firestore-tokenAuth/organizations
Authorization: Bearer <token>
{
"name": "Acme Corp",
"description": "Our main organization",
"visibility": "private"
}Inviting team members
Send an email invitation with a specific role. The invitee receives an email with an acceptance link:
JSON
POST /invitations/organization
Authorization: Bearer <token>
{
"organizationId": "org_abc123",
"email": "teammate@acme.com",
"role": "member"
}Organization Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /firestore-tokenAuth/organizations | Create organization |
| GET | /firestore-tokenAuth/organizations | List all organizations |
| GET | /firestore-tokenAuth/organizations/:orgId | Get organization by ID |
| PUT | /firestore-tokenAuth/organizations/:orgId | Update organization |
| PUT | /firestore-tokenAuth/organizations/:orgId/profile | Update public profile |
| DELETE | /firestore-tokenAuth/organizations/:orgId | Delete organization |
| POST | /firestore-tokenAuth/organizations/:orgId/members | Add member |
| DELETE | /firestore-tokenAuth/organizations/:orgId/members/:memberId | Remove member |
| PUT | /firestore-tokenAuth/organizations/:orgId/members/:memberId/role | Update member role |
| GET | /firestore-tokenAuth/organizations/:orgId/members | List members |
| POST | /firestore-tokenAuth/organizations/:orgId/follow | Toggle follow |
Invitation Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /invitations/organization | Send invitation to organization |
| GET | /invitations/organization/:orgId | List pending invitations |
| POST | /invitations/project | Send invitation to project |
| GET | /invitations/:token | Get invitation details by token (public) |
| POST | /invitations/:token/accept/organization | Accept organization invitation |
| POST | /invitations/:token/decline | Decline an invitation |
| POST | /invitations/:invitationId/cancel | Cancel a sent invitation |
| POST | /invitations/:invitationId/resend | Resend invitation email |
Project Endpoints
Projects are nested within organizations and have their own contributor list and RBAC:
| Method | Endpoint | Description |
|---|---|---|
| POST | /firestore-tokenAuth/projects | Create project |
| GET | /firestore-tokenAuth/projects | List projects |
| GET | /firestore-tokenAuth/projects/:projectId | Get project by ID |
| PUT | /firestore-tokenAuth/projects/:projectId | Update project |
| DELETE | /firestore-tokenAuth/projects/:projectId | Delete project |
| POST | /firestore-tokenAuth/projects/:projectId/contributors | Add contributor |
| POST | /firestore-tokenAuth/projects/:projectId/star | Toggle star |
| POST | /firestore-tokenAuth/projects/:projectId/releases | Create a release |