# \[API\] In the Documentation: Wrong Key in the API Suspend

**URL:** https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082
**Category:** Bug
**Created:** [2017年十一月30日 11:18 UTC](https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082 "2017-11-30T11:18:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hossam\_Youssef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hossam_youssef/32/83498_2.png) [@Hossam\_Youssef](https://meta.discourse.org/u/Hossam_Youssef)
#### Post date: [2017年十一月30日 11:18 UTC](https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082/1 "2017-11-30T11:18:15Z")

</div>

Hello,

I have found a wrong key which used in the PUT method to suspend an account which is making the suspend action not possible.

in the api documentaion:

> **[Discourse API Docs](https://docs.discourse.org/#tag/Admin%2Fpaths%2F~1admin~1users~1%7Bid%7D~1suspend%2Fput)**

**API Request**

```plaintext
    api_key:{{api_key}}
    api_username:{{api_username}}
    duration:2017-12-04
    reason:Reason Test Here

```

**The expected response**  
Getting the account suspended:

```plaintext
        {
            {
            "suspension": {
                "suspended": true,
                "suspend_reason": "Reason Test Here",
                "suspended_till": "2017-12-04T00:00:00.000Z",
                "suspended_at": "2017-11-30T10:49:51.248Z"
            }
        }

```

**The current response**  
Getting null value in the duration so “It suspend the account till ZERO TIME so it means UNSUPSEND”

```plaintext
    {
        "suspension": {
            "suspended": true,
            "suspend_reason": "Reason Test Here",
            "suspended_till": null,
            "suspended_at": "2017-11-30T10:49:51.248Z"
        }
    }

```

**The Solution**  
Replace the `duration` key to `suspend_until` in the body request and it works fine! like that:

```plaintext
    api_key:{{api_key}}
    api_username:{{api_username}}
    suspend_until:2017-12-04
    reason:Reason Test Here

```

So I will appreciate if you could update this part in the API documentation. it could help others.

 ![48](https://global.discourse-cdn.com/meta/original/3X/5/e/5e6dc467dd60e8902aeece19f10791ec7c5a8d26.png)

Thanks in advance!  
Hossam

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [2017年十一月30日 16:19 UTC](https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082/2 "2017-11-30T16:19:19Z")

</div>

Thank you for figuring this out and writing up a solution!

Is this something you would like to try and update yourself? The [docs are open source](https://github.com/discourse/discourse_api_docs) and contributions are welcome 🙂.

---

<div class="post-metadata">

### Author: ![Hossam\_Youssef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hossam_youssef/32/83498_2.png) [@Hossam\_Youssef](https://meta.discourse.org/u/Hossam_Youssef)
#### Post date: [2017年十一月30日 20:25 UTC](https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082/3 "2017-11-30T20:25:33Z")

</div>

Thanks Blake, I am going to open PR. 🙂

---

<div class="post-metadata">

### Author: ![Hossam\_Youssef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hossam_youssef/32/83498_2.png) [@Hossam\_Youssef](https://meta.discourse.org/u/Hossam_Youssef)
#### Post date: [2017年十一月30日 21:03 UTC](https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082/4 "2017-11-30T21:03:05Z")

</div>

HYG, [Change the duration to suspend\_untill key for suspend end point with … by HossamYoussef2009 · Pull Request #9 · discourse/discourse\_api\_docs · GitHub](https://github.com/discourse/discourse_api_docs/pull/9/files) 🙂

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [2017年十一月30日 21:55 UTC](https://meta.discourse.org/t/api-in-the-documentation-wrong-key-in-the-api-suspend/75082/5 "2017-11-30T21:55:16Z")

</div>


