Cosmo Docs
Organization

Members & Roles

Managing team members, invites, and roles within your Cosmo organization.

Manage who has access to your organization and what they can do. Cosmo supports role-based access control (RBAC) at the organization level, powered by Clerk's B2B Organizations.

Creating an Organization

After signing up, you'll be prompted to create your first organization. This is required before you can start using Cosmo. Enter a name for your team workspace and you're in — zero to value in under 5 minutes.

If you're invited by a teammate, you'll automatically join their organization after accepting the invite.

Switching Organizations

If you belong to multiple organizations, use the Organization Switcher at the bottom of the sidebar to switch between them. Your chat sessions and workspaces are scoped to each organization, so switching orgs will load that org's data.

Roles

Cosmo uses Clerk's built-in organization roles. On the free plan, two roles are available:

RoleClerk RoleDescription
Ownerorg:adminFull access. Can manage billing, invite/remove members, manage integrations, and configure org settings. The org creator automatically gets this role.
Memberorg:memberCan create workspaces, use chat, and access shared artifacts. Default role for invited members.

The database schema also supports Admin and Viewer roles for future use when Clerk custom roles are enabled.

Inviting Teammates

Owners and Admins can invite new members:

  1. Click Settings in the sidebar
  2. Navigate to the Members tab
  3. Enter the teammate's email address and select a role
  4. Click Invite

The invited person will receive an email with a link to join your organization. Pending invitations can be viewed and revoked from the same settings panel.

Managing Members

From the organization settings modal:

  • Change a member's role — Click on their current role to update it (Owner only)
  • Remove a member — Owners and Admins can remove members from the organization

API Access (CLI)

The server exposes org management endpoints for CLI and programmatic access:

MethodEndpointAuth RequiredDescription
GET/org/membersAny memberList all org members
POST/org/inviteOwner / AdminInvite by email
GET/org/invitesOwner / AdminList pending invites
DELETE/org/invite/:idOwner / AdminRevoke a pending invite
PATCH/org/members/:userId/roleOwnerUpdate a member's role
DELETE/org/members/:userIdOwner / AdminRemove a member

All endpoints require a valid Bearer token (Cosmo JWT or Clerk session token) and are scoped to the authenticated user's active organization.