Discourse_api: site_setting_update disable_emails

The Discourse API Docs for disable_emails site setting tells to pass the following payload:

{
    "disable_emails": false
}

But trying the following curl command I receive an error. Can someone tell me what I’m doing wrong?

curl -X PUT -H "Content-Type: application/json" \
     -H "Api-Key: $DISCOURSE_API_KEY" -H "Api-Username: $USER" \
     --data '{ "disable_emails": false }' \
     $DISCOURSE_URI/admin/site_settings/disable_emails
{"errors":["value"]}

This {"errors":["value"]} is very disturbing. I tried "false" and 0 instead, with the same result.

I went to using curl because using the discourse_api would not work with:

client.site_setting_update(name: 'disable_emails', value: false)

Again, if someone does what’s wrong with my call, please enlighten me!

(Nothing appears in the error log)

1 Like

Oh I think that setting was moved to a enum. Options are:

  • no
  • yes
  • non-staff
5 Likes

Thanks @Falco it works! The doc is broken then. I cloned the repo, will fix it later.

4 Likes

https://github.com/discourse/discourse_api_docs/pull/22

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.