FreeKB - Kong delete Consumers using curl
Kong - delete Consumers using curl

The curl DELETE command can be used to delete a Consumer.


On the Kong server

If Kong is running on docker, refer to Kong - Docker container command line for the steps on how to issue commands in the Kong Docker container. Assuming you are using the default kong.conf file, the Kong Admin API will listen on port 8001.

admin_listen = 127.0.0.1:8001

 

If issuing this command on the Kong server, this command will delete the Consumer named "john.doe".

curl -X DELETE "http://localhost:8001/consumers/john.doe"

 

Or, you can do the same using the Consumer id.

curl -X DELETE "http://localhost:8001/consumers/52508431-a759-4eca-8f21-a327f6ef570c"

 


From a remote server

If issuing this command from a remote server, this command will delete the Consumer named "john.doe".

curl -X DELETE "http://hostname:8000/admin-api/consumers"

 

Or, you can do the same using the Consumer id.

curl -X DELETE "http://hostname:8000/admin-api/consumers/consumer_name_or_id"

 


Validation

If there are no Consumers, something like this will be displayed.

{
 "message":"Not Found"
}

 

If there are Consumers, something like this will be displayed.

{
 "custom_id":null
 "created_at":1583244607
 "id":"a51b05c4-fc81-4552-88a0-17842065e8b2"
 "tags":null
 "username":"john.doe"
}

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 0fd9e in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |