Unsubscribing a user from all emails via an API call?

For anyone interested in a follow up:
My need was met by following the reverse engineering guide. It was a fairly straight forward process to collect the contents of the PUT payload.

in Ruby, the payload I ended up with is:
payload = {mailing_list_mode: false, mailing_list_mode_frequency: 1, email_digests: false, email_in_reply_to: false, email_messages_level: 2, email_level: 2, email_previous_replies: 2 }

the ‘mailing_list_mode_frequency’ can probably be excluded since mailing_list_mode is false.
The payload is then PUT to https://DISCOURSEHOST/u/USERNAME.json?api_key=DISCOURSE_SYSTEM_API_KEY&api_username=system

7 Likes