User delete with API

Hello Guys!

We tried to delete a user from Grafana 7.3.4 with API.

We tried this API command:

`curl -u myadmin:mypasswd <mywebsite>/api/users?query="delthis"`

`[{"id":39,name":"delthis","login":"delthis","email":"delthis","avatarUrl":"/avatar/e87a4e38621c37df5307dd9f0496b8c0","isAdmin":false,"isDisabled":false,"lastSeenAt":"2021-01-13T10:51:57+01:00","lastSeenAtAge":"39m","authLabels":[]}]`

`curl -u myadmin:mypasswd -X DELETE <mywebsite>/api/admin/users/:39`

`{"message":"User deleted"}`

We see, the delete command send me “user deleted” status, but the user will not be deleted. We checked her(API) and on the UI too.

Do we some failure? Please help us!

Thanks, Barnabás

Hi,

Your delete request should include the id (39). Please use as follow :

Reference :

Hope it helps.

Good Luck

I edited my topics. Sorry, the display was corrupted. We used this command:

curl -u myadmin:mypasswd -X DELETE mywebsite/api/admin/users/:39

Hi,

Did you try on a newer version ?

Good Luck

No, we use this 7.3.4 version. We only plan an upgrade. You have a new version, and works this command fine?

Hi,

Indeed the command shouldn’t be saying user deleted :

The correct syntax is (without the : )

Before :

After :

Good Luck

1 Like

Big Thanks, we use :39 This was the problem… Without : is working fine. :slight_smile:

1 Like