# Discourse\_api: site\_setting\_update disable\_emails

**URL:** https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695
**Category:** Support
**Created:** [March 26, 2020, 4:01pm UTC](https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695 "2020-03-26T16:01:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [March 26, 2020, 4:01pm UTC](https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695/1 "2020-03-26T16:01:58Z")

</div>

The [Discourse API Docs](https://docs.discourse.org/#tag/Site-Settings-Email/paths/~1admin~1site_settings~1disable_emails/put) for `disable_emails` site setting tells to pass the following payload:

```json
{
    "disable_emails": false
}

```

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

```shell
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:

```ruby
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)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 26, 2020, 4:31pm UTC](https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695/2 "2020-03-26T16:31:43Z")

</div>

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

- no
- yes
- non-staff

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [March 26, 2020, 5:06pm UTC](https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695/3 "2020-03-26T17:06:07Z")

</div>

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

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [March 26, 2020, 7:24pm UTC](https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695/4 "2020-03-26T19:24:21Z")

</div>

[https://github.com/discourse/discourse\_api\_docs/pull/22](https://github.com/discourse/discourse_api_docs/pull/22)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 25, 2020, 7:24pm UTC](https://meta.discourse.org/t/discourse-api-site-setting-update-disable-emails/145695/5 "2020-04-25T19:24:24Z")

</div>

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