Members, invites & access
Manage Space roles (host, builder, guest), invite links, default access policies, custom guest pages, Chat sharing overrides, offline App access, and resource references.
This page explains how to control who can view, edit, run commands, or administer a Cohub Space using member roles, invite links, default Space access policies and custom guest pages, per-Chat access overrides, offline App access controls, and resource reference queries.
Roles and permissions
Every Space uses three roles ranked from lowest to highest: guest < builder < host.
Access is resolved in this order:
- Explicit Space membership always takes precedence over Space-level and Chat-level access policies.
- Per-Chat access policy (when set on a Chat) overrides the Space-level policy for non-members viewing that Chat.
- Space-level access policy applies to non-members when no Chat override exists. Signed-in non-members receive the
signed_in_userrole, or fall back toanonymous_userwhensigned_in_useris unset (null). Anonymous visitors receiveanonymous_user.
The exact permission matrix defined in @cohub/core/permissions:
| Capability area | Permission scopes | host |
builder |
guest |
|---|---|---|---|---|
| Space view & settings | space.view |
Yes | Yes | Yes |
space.edit (profile, env, config, guest page) |
Yes | No | No | |
| Labels | space.label.view |
Yes | Yes | Yes |
space.label.assign |
Yes | Yes | No | |
space.label.manage (create/edit/delete labels) |
Yes | No | No | |
| Chats & turns | session.view |
Yes | Yes | Yes |
session.edit, session.prompt.readonly, session.prompt.fullaccess, session.access.manage |
Yes | Yes | No | |
| Media generation | generation.create |
Yes | Yes | No |
| Workspace files | file.view.filtered (hides .git/ and paths matched by root .gitignore) |
Yes (via file.view) |
Yes (via file.view) |
Yes |
file.view (full unfiltered read), file.edit |
Yes | Yes | No | |
| Saves (Checkpoints) | checkpoint.view |
Yes | Yes | Yes |
checkpoint.edit |
Yes | Yes | No | |
| Members & Space access | member.view |
Yes | Yes | No |
member.manage (members, invites, Space access, revoke others' offline App grants) |
Yes | No | No | |
| Resource references | references.view |
Yes | Yes | No |
| External channels | channel.view |
Yes | Yes | No |
channel.manage (bind, configure, unbind) |
Yes | No | No | |
| Cron jobs & task runs | cronjob.view, cronjob.manage, taskrun.view |
Yes | Yes | No |
| Sandbox & commands | sandbox.view, command.execute |
Yes | Yes | No |
sandbox.manage |
Yes | No | No | |
| Mods | mod.view |
Yes | Yes | No |
mod.manage |
Yes | No | No | |
| Apps & commerce | app.manage |
Yes | Yes | No |
space.commerce.view, space.commerce.manage |
Yes | No | No |
Manage members
Only a Space host (holding member.manage) can add, update, or remove members. Builders and hosts (member.view) can list members.
In the web UI
Open Space Settings → Access → Members:
- Click any member's UUID under their display name to copy it.
- Use the role selector on a member row to switch between Guest, Builder, and Host, or click Remove member to remove them.
- To add a user directly without an invite link, paste their User UUID in the bottom row, choose a role, and click Add.
With the CLI
cohub spaces members exposes ls (alias list), update, and remove. Because PUT /api/spaces/:id/members upserts by user UUID, update handles both adding a member by UUID and changing an existing member's role (there is no separate add subcommand):
# List current members and roles
cohub -s <space-id> spaces members ls
cohub -s <space-id> spaces members ls --json
# Add a user by UUID or change an existing member's role (host | builder | guest)
cohub -s <space-id> spaces members update <user-uuid> builder
# Remove a member from the Space
cohub -s <space-id> spaces members remove <user-uuid>
Automatic channel cleanup on demotion or removal: If a member is removed or demoted to a lower role, any external channels owned by that user that are bound to the Space are automatically unbound from the Space and gateway.
Invite links
Hosts (member.manage) can create reusable or capped invite links instead of collecting user UUIDs.
In the web UI
Open Space Settings → Access and click Invite to open Create invite link:
- Role:
Builder(default),Guest, orHost. - Valid for:
1 day,7 days(default),14 days,30 days, orNo expiry(disabled when Role isHost, because host links must expire within 30 days). - Max uses:
0for unlimited (default), or an integer from1to10,000.
Creating a link copies the URL to your clipboard and adds it to the Invite links list, where you can copy, revoke, or toggle Show inactive / Hide inactive to inspect revoked, exhausted, and expired links.
With the CLI
# Create a 7-day unlimited builder invite link (defaults)
cohub -s <space-id> spaces invites create
# Create a 14-day guest invite capped at 25 uses
cohub -s <space-id> spaces invites create --role guest --days 14 --max-uses 25 --json
# Create a non-expiring builder invite link (not allowed for host)
cohub -s <space-id> spaces invites create --role builder --never-expires
# List active links, or include revoked/exhausted/expired links with --all
cohub -s <space-id> spaces invites ls
cohub -s <space-id> spaces invites ls --all --json
# Revoke an invite link by code (--yes required in non-interactive shells)
cohub -s <space-id> spaces invites revoke <invite-code> --yes
Redemption behavior
- Users must be signed in to accept an invite link.
- Accepting an invite never downgrades an existing member: if the user already holds the invited role or a higher role, redemption keeps their existing role and does not increment
useCount. - If the invite grants a higher role than the user's current role (for example, a
guestredeeming abuilderlink), their role is upgraded and one use is consumed.
Default Space access policies and custom guest page
Default access policies control what non-members see when they open a Space URL.
Space access policy (signed_in_user and anonymous_user)
In Space Settings → Access:
- Signed-in users (Anyone signed in to Cohub): No access (
null), Guest (guest), or Builder (builder). - Anonymous visitors (Visitors without an account): No access (
null) or Guest (guest).
With the CLI (cohub spaces access):
# Inspect the current Space access policy
cohub -s <space-id> spaces access get
cohub -s <space-id> spaces access get --json
# Update one or both audiences; omitted flags stay unchanged
cohub -s <space-id> spaces access set --signed-in builder
cohub -s <space-id> spaces access set --anonymous guest --json
cohub -s <space-id> spaces access set --signed-in null --anonymous null
cohub spaces access set (backed by PATCH /api/spaces/:id/access) uses partial update semantics: any flag you omit keeps its current value, and omitting both flags fails with Nothing to update.
Custom guest landing page (--guest-app)
When visitors without access open the Space URL—or when non-members open an invite link—Cohub shows the default guest page unless you select a custom App.
- Eligibility: The target must be a published App in the same Space whose visibility is
public. - Permission: Changing the guest page requires
space.edit(host). - Web UI: In Space Settings → Access → Guest page, pick Default or an eligible published public App.
- CLI: Configure it via
cohub spaces config <space> --guest-app <app>(accepting an App ID, App slug, ornoneto reset to default):
# Show current Space config, including guest.appId
cohub spaces config <space-id>
# Set a published public App in this Space as the guest landing page
cohub spaces config <space-id> --guest-app welcome
# Reset back to the default guest page
cohub spaces config <space-id> --guest-app none
Chat-level access overrides
Builders and hosts (session.access.manage) can share a single Chat publicly without changing the Space-wide default policy.
In the web UI
Open the Chat and click Share (displays as Shared when public) in the top header to open Share session:
- Toggle Access on to grant anonymous
guestread access to that Chat (PATCH /api/sessions/:id/accesswithanonymous_user: "guest"). - Toggle Access off to remove the Chat override (
DELETE /api/sessions/:id/access), reverting the Chat to the Space's default policy. - Copy the direct Chat URL or expand its QR code from the same dialog.
With the CLI
# Inspect a Chat's access override
cohub spaces sessions access get <session-id> --json
# Allow anonymous read-only (guest) access on a single Chat
cohub spaces sessions access set <session-id> --anonymous guest
# Clear the Chat override so it inherits the Space's default access policy
cohub spaces sessions access remove <session-id>
Space members always keep their Space role on the Chat regardless of any per-Chat override.
Offline App access
Published Apps can request offline scopes so their Actions may access a Space even when no user is actively present.
In the web UI
Open Space Settings → Access → Offline App access. Each row shows the App title, who granted access (Granted by …), and the granted permission scopes.
- Space members see all active offline App grants on the Space.
- Non-members only see offline grants they authorized themselves.
- Either the granting user or a Space
host(member.manage) can click Revoke offline access.
With the CLI
# List active offline App grants on the Space
cohub -s <space-id> spaces app-access ls
cohub -s <space-id> spaces app-access ls --json
# Revoke an App's offline access by grant ID
cohub -s <space-id> spaces app-access revoke <grant-id>
Revoking an entry removes offline access only (clears the grant's offline scopes). The member's own interactive grant for that App remains unchanged.
Query resource references
cohub references queries the collaboration and file-access reference index for turns, Chats, Spaces, and Saves (Checkpoints). It requires references.view (host or builder); guests are denied.
List edges touching a resource (cohub references query)
# Query outgoing and incoming references for a Space or Chat
cohub references query space:<space-uuid> --direction in --kinds mention,tool_call
cohub references query session:<session-uuid> --json
# Inspect files read or written by a specific turn
cohub references query turn:<turn-uuid> --kinds agent_tool_file_read,agent_tool_file_write
# Inspect outgoing references from a Save (checkpoint)
cohub references query checkpoint:<checkpoint-uuid> --direction out --days 30 --limit 100
Options for query <source>:
<source>:turn:<uuid>,session:<uuid>,space:<uuid>, orcheckpoint:<uuid>.--direction <dir>:out,in, orboth(defaultboth). Incoming references from other Spaces are filtered so you only see sources where you havespace.view.--kinds <kinds>: comma-separated filter from the supported reference kinds:- Structural:
session_fork,space_fork,checkpoint_fork,mod - Content:
mention,tool_call - Causality:
turn_trigger - File access:
agent_tool_file_read,agent_tool_file_write,agent_tool_file_edit,agent_tool_file_ls,agent_tool_file_find,agent_tool_file_grep
- Structural:
--days <n>: filter to references seen in the last1–365days.--limit <n>: maximum rows,1–500(default200).
Group counts across a Space (cohub references aggregate)
# Count references by kind across a Space
cohub references aggregate <space-id> --json
# Rank the most-read workspace files (file targets render as {spaceId}:{path})
cohub references aggregate <space-id> --group-by target --kinds agent_tool_file_read --limit 20
# Daily trend over the last 30 days
cohub references aggregate <space-id> --group-by day --days 30
<space> accepts a Space ID, home, a slug you own, or username/slug. --group-by accepts kind (default), targetType, target, sourceType, or day.
Boundaries & common errors
- Cannot demote or remove the last host (HTTP 400): Every Space must keep at least one
host. Trying to demote or remove the sole host returnscannot demote the last hostorcannot remove the last host. - Host-only mutations (HTTP 403): Updating/removing members, managing invite links, and changing Space-level access policies require
member.manage(and member mutations additionally requirehostrole). Setting--guest-apprequiresspace.edit. - Automatic channel unbinding on role downgrade: Demoting or removing a member immediately unbinds any external channels they own from that Space.
- Invite link limits and errors:
--daysmust be an integer from1to30;--max-usesmust be0to10,000.- Combining
--daysand--never-expiresfails withConflicting options. - Passing
--never-expireswith--role hostfails (Host invite links expire within 30 days). cohub spaces invites revoke <code>requires-y/--yeswhen stdin/stdout is not a TTY.- Opening or accepting a missing, expired, revoked, or exhausted invite returns HTTP
410.
- Role validation on access policies (HTTP 400):
anonymous_useronly acceptsguestornullon both Space and Chat policies (access role must be guest or null). Althoughcohub spaces sessions access set --helpmentionshost|builder|guest|null, the API rejectshostandbuilderfor anonymous visitors.signed_in_useronly acceptsbuilder,guest, ornull(you cannot granthostvia default policy).- Running
cohub spaces access setwith neither--signed-innor--anonymousfails withNothing to update.
- Invalid or unavailable guest App (HTTP 400):
cohub spaces config <space> --guest-app <app>fails withguest_app_invalidunless the App belongs to the same Space, ispublished, and haspublicvisibility. If a configured guest App is later unpublished or changed tospacevisibility, visitors fall back to the default guest page and settings show Unavailable App. - Offline App access restrictions (HTTP 403 / 404): App Action execution tokens cannot call
spaces app-access lsorrevoke. Non-hosts can only revoke offline grants they personally created; other grants return403. - Reference index permissions and bounds:
cohub referencesrequiresreferences.view(hostorbuilder; guests get403).--daysis clamped to1–365and--limitto1–500. Invalid<source>syntax (<type>:<id>) or unknown kind names fail before querying.
Next steps
- Spaces — Create Spaces, manage settings, environment variables, and Sandbox configuration
- Chats — Organize conversations, labels, forks, and shared sessions inside a Space
- Apps — Publish a public App you can assign as a Space's custom guest page
- App development — Understand App scopes, viewer grants, and offline Action permissions
- CLI — Install, authenticate, target Spaces (
-s), and scriptcohubcommands with--json