Kayabyte

How to make a Confluence group watch a space or page

By Kayabyte

You want everyone in a team to get updates from the team’s Confluence space: new pages, edits and comments. In Confluence Cloud there is no setting for that. Watching is something each person does for themselves. This guide shows what an admin can do anyway, from a one-time script to keeping it in sync, and where each approach stops.

How watching works in Confluence Cloud

Adding watches for other people with the REST API

Confluence’s REST API can set a watch for someone else, one person at a time (Atlassian reference):

Two requirements: send the header X-Atlassian-Token: no-check, and run it as someone with the Confluence Administrator global permission, or Space Administrator on that space. Without one of those, you can only add a watch for yourself.

A one-time script for a whole group

This adds every member of one group as a watcher of one space. You need an API token for your own account, curl and jq.

SITE="https://your-site.atlassian.net"
AUTH="you@example.com:your-api-token"
SPACE="TEAM"          # the space key
GROUP="developers"    # the group name

# 1. Look up the group's ID
GROUP_ID=$(curl -s -u "$AUTH" "$SITE/wiki/rest/api/group/picker?query=$GROUP" \
  | jq -r --arg n "$GROUP" '.results[] | select(.name == $n) | .id')

# 2. Read the members, 200 at a time, and add a watch for each
start=0
while :; do
  page=$(curl -s -u "$AUTH" "$SITE/wiki/rest/api/group/$GROUP_ID/membersByGroupId?start=$start&limit=200")
  for id in $(echo "$page" | jq -r '.results[] | select((.accountType // "atlassian") == "atlassian") | .accountId'); do
    curl -s -o /dev/null -w "%{http_code} $id\n" -u "$AUTH" -X POST \
      -H "X-Atlassian-Token: no-check" \
      "$SITE/wiki/rest/api/user/watch/space/$SPACE?accountId=$id"
  done
  # Stop when there is no next page (a short page alone doesn't prove the list is complete)
  [ "$(echo "$page" | jq -r '._links.next // empty')" = "" ] && break
  start=$((start + $(echo "$page" | jq '.results | length')))
done

A 204 means the watch was added. Members who can’t see the space are skipped by Confluence, because a watch never grants access. For a single page, use the page endpoint with the page ID from the page URL.

Where the script stops

The script is a snapshot. It’s fine for a one-time rollout, but groups change:

To keep it in sync you would run it on a schedule and keep a record of which watches you added, who opted out, and who already watched before. That record is the hard part.

Why someone “watches” but gets no email

Before changing anything, check Confluence’s email defaults. New pages and page edits in watched content go into the daily digest by default, while comments are emailed straight away. Each person can change this under their profile picture → Settings → Email. The updates also show under Notifications → Watching in Confluence.

Keeping a group in sync with an app

Group Watchers for Confluence is the app I make for this. You map one or more groups to a space or a single page, and it keeps the watches in line with the groups:

It’s on the Atlassian Marketplace.

Confluence and Atlassian are trademarks of Atlassian. Kayabyte is an independent developer and is not affiliated with or endorsed by Atlassian.