# Suspend API Not Working

**URL:** <https://meta.discourse.org/t/suspend-api-not-working/72375>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [Outubro 18, 2017, 8:47pm UTC](https://meta.discourse.org/t/suspend-api-not-working/72375 "2017-10-18T20:47:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Geoffrey\_Challen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geoffrey_challen/32/119637_2.png) [@Geoffrey\_Challen](https://meta.discourse.org/u/Geoffrey_Challen)\
**Post date:** [Outubro 18, 2017, 8:47pm UTC](https://meta.discourse.org/t/suspend-api-not-working/72375/1 "2017-10-18T20:47:35Z")

</div>

This is related to [API not returning suspended fields properly - #6 by eviltrout](https://meta.discourse.org/t/api-not-returning-suspended-fields-properly/71850/6). Tagging @eviltrout since they seem to own this codebase.

Now it seems the issue is that the suspend API is not working properly. Here’s the code that we’ve been using for several months:

```javascript
client.put('admin/users/' + user.id + '/suspend?' + 
  queryString.stringify({
    api_username: passwords.discourse.username,
    api_key: passwords.discourse.key
  }), {
    duration: 99999,
    reason: 'No longer in CS 125.'
  }, function (err, res, body) {
    should.not.exist(err);
    res.statusCode.should.equal(200);
    return callback();
});   

```

Again, this worked fairly recently. But now when we run it: (a) the suspended count shown on the user page goes up by one, but (b) the user is actually not suspended correctly. They don’t show as suspended in the UI, and return as active the next time we pull the users list.

---

_[View the full topic](https://meta.discourse.org/t/suspend-api-not-working/72375)._
