# Delete users via API

**URL:** https://meta.discourse.org/t/delete-users-via-api/106443
**Category:** Development
**Created:** [January 13, 2019, 8:23pm UTC](https://meta.discourse.org/t/delete-users-via-api/106443 "2019-01-13T20:23:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Martin\_Delille](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin_delille/32/122252_2.png) [@Martin\_Delille](https://meta.discourse.org/u/Martin_Delille)
#### Post date: [January 13, 2019, 8:23pm UTC](https://meta.discourse.org/t/delete-users-via-api/106443/1 "2019-01-13T20:23:22Z")

</div>

I try to delete a user on my instance hosted by discourse with the following comand:

```plaintext
curl -X DELETE "https://forum.atelier-medias.org/admin/users/SergeGainsbourg.json?api_key=xxxxxx&api_username=system"

```

I have the following error:

```plaintext
{
  "errors": [
    "You are not permitted to view the requested resource."
  ],
  "error_type": "invalid_access"
}

```

I don’t know how to access the production log on hosted instance.

Any idea what is going wrong?

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [January 13, 2019, 10:20pm UTC](https://meta.discourse.org/t/delete-users-via-api/106443/2 "2019-01-13T22:20:44Z")

</div>

> [@Martin\_Delille](#):
>
> SergeGainsbourg.json

use userid.json here.

---

<div class="post-metadata">

### Author: ![Martin\_Delille](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin_delille/32/122252_2.png) [@Martin\_Delille](https://meta.discourse.org/u/Martin_Delille)
#### Post date: [January 15, 2019, 8:14pm UTC](https://meta.discourse.org/t/delete-users-via-api/106443/3 "2019-01-15T20:14:50Z")

</div>

Thanks it works now!
