Thread authentication

The thread authenticator enforces ownership rules for threads and comments in collaborative documents. When enabled, users can only edit and delete their own threads and comments, while thread creation automatically assigns the authenticated user's ID.

Requires JWT authentication

Thread authentication relies on JWT authentication to identify users. Make sure your JWTs include the sub claim with a unique user identifier.

Enable thread authentication

Enable the thread authenticator by setting the thread_authenticator setting to 1 via the Settings API:

curl --location --request PUT 'https://YOUR_APP_ID.collab.tiptap.cloud/api/admin/settings/thread_authenticator' \
--header 'Authorization: YOUR_SECRET_FROM_SETTINGS_AREA' \
--header 'Content-Type: text/plain' \
-d '1'

You can also set the COLLAB_THREAD_AUTHENTICATOR environment variable to 1 on self-hosted instances.

How it works

When enabled, the thread authenticator intercepts all document updates that modify threads or comments and validates them against the authenticated user's identity.

Automatic user ID assignment

When a user creates a thread or comment, the authenticator automatically assigns their user ID (from the JWT sub claim) to the thread and comment. This happens transparently and does not require any client-side changes.

Ownership enforcement

The following rules are enforced for all thread and comment operations:

OperationRule
Create threadAllowed. The authenticated user's ID is assigned automatically.
Edit threadOnly the thread owner can edit.
Delete threadOnly the thread owner can delete.
Resolve/unresolve threadOwners can always resolve. Non-owners depend on access level (see below).
Create commentAllowed. The authenticated user's ID is assigned automatically.
Edit commentOnly the comment owner can edit.
Delete commentOnly the comment owner can delete.

If a user attempts an unauthorized action, the server rejects the update and returns an unauthorized error.

Threads without a user ID

Threads and comments that were created before enabling the thread authenticator may not have a user ID assigned. These can be edited or deleted by anyone. Once a user modifies such a thread, their user ID is assigned to it.

Resolving foreign threads

By default, all users with write or comment access can resolve threads they don't own. This is useful for workflows where reviewers or editors need to mark discussions as resolved.

To restrict comment-only users from resolving other users' threads, set the commentonly_disallow_resolve_foreign_threads setting to 1:

curl --location --request PUT 'https://YOUR_APP_ID.collab.tiptap.cloud/api/admin/settings/commentonly_disallow_resolve_foreign_threads' \
--header 'Authorization: YOUR_SECRET_FROM_SETTINGS_AREA' \
--header 'Content-Type: text/plain' \
-d '1'

The resulting permission matrix for resolving foreign threads:

Access levelDefault behaviorWith commentonly_disallow_resolve_foreign_threads set to 1
Write accessCan resolveCan resolve
Comment-only accessCan resolveCannot resolve

Thread owners can always resolve their own threads regardless of this setting.

Configuration reference

SettingEnvironment variableDefaultDescription
thread_authenticatorCOLLAB_THREAD_AUTHENTICATOR0 (disabled)Set to 1 to enable thread authentication.
commentonly_disallow_resolve_foreign_threadsCOLLAB_COMMENTONLY_DISALLOW_RESOLVE_FOREIGN_THREADS0 (allowed)Set to 1 to prevent comment-only users from resolving threads they don't own.

Both settings can be configured via the Settings API or environment variables.