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 resources

Creating 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

MethodEndpointDescription
POST/firestore-tokenAuth/organizationsCreate organization
GET/firestore-tokenAuth/organizationsList all organizations
GET/firestore-tokenAuth/organizations/:orgIdGet organization by ID
PUT/firestore-tokenAuth/organizations/:orgIdUpdate organization
PUT/firestore-tokenAuth/organizations/:orgId/profileUpdate public profile
DELETE/firestore-tokenAuth/organizations/:orgIdDelete organization
POST/firestore-tokenAuth/organizations/:orgId/membersAdd member
DELETE/firestore-tokenAuth/organizations/:orgId/members/:memberIdRemove member
PUT/firestore-tokenAuth/organizations/:orgId/members/:memberId/roleUpdate member role
GET/firestore-tokenAuth/organizations/:orgId/membersList members
POST/firestore-tokenAuth/organizations/:orgId/followToggle follow

Invitation Endpoints

MethodEndpointDescription
POST/invitations/organizationSend invitation to organization
GET/invitations/organization/:orgIdList pending invitations
POST/invitations/projectSend invitation to project
GET/invitations/:tokenGet invitation details by token (public)
POST/invitations/:token/accept/organizationAccept organization invitation
POST/invitations/:token/declineDecline an invitation
POST/invitations/:invitationId/cancelCancel a sent invitation
POST/invitations/:invitationId/resendResend invitation email

Project Endpoints

Projects are nested within organizations and have their own contributor list and RBAC:

MethodEndpointDescription
POST/firestore-tokenAuth/projectsCreate project
GET/firestore-tokenAuth/projectsList projects
GET/firestore-tokenAuth/projects/:projectIdGet project by ID
PUT/firestore-tokenAuth/projects/:projectIdUpdate project
DELETE/firestore-tokenAuth/projects/:projectIdDelete project
POST/firestore-tokenAuth/projects/:projectId/contributorsAdd contributor
POST/firestore-tokenAuth/projects/:projectId/starToggle star
POST/firestore-tokenAuth/projects/:projectId/releasesCreate a release
Organizations & Teams — CognitionDesk Docs