How to change the notification levels for all users on a topic?

Though, just to note, if they’re Watching it then they’d still get notifications when it’s Unlisted.

I think you can now use the /t/TOPIC_ID/notifications endpoint to set the notification level for a user on a specific topic, if that’s a more appealing choice than the rails console?

Extra details
  • The API user should be an admin(so they should have global scope) to be able to change another user’s notification level.
  • Endpoint URL: siteurl/t/<topic_id>/notifications
  • Request type: POST
  • Parameters:
    • username or external_id of the target user. If empty, the admin’s own notifcation level for the topic will be changed.
    • notification_level: integer value corresponding to the level
      • muted: 0,
      • regular: 1,
      • normal: 1, # alias for regular
      • tracking: 2,
      • watching: 3,

But for the rails console I think it would be this: (remember to take a backup just in case before trying to change things in rails :warning:)

TopicUser.where(topic_id: TOPIC_ID).update(notification_level: 1)

(1 is normal, 0 is mute)

That would change the topic level ones, but there may be category and tag level ones which may still affect who gets a ping for new activity.

And a little data explorer query to check the levels for users on a topic if that’s useful too:

SELECT 
    topic_id,
    user_id,
    notification_level
FROM topic_users
WHERE topic_id = TOPIC_ID