The curl DELETE command can be used to delete a route. This assumes you have already created a route. If not, refer to Kong - create Route using curl. Let's say you've created a route with the following ID. If you do not know the ID, refer to Kong - get Route using curl.
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 route that has ID a714d55e-a168-4efc-ae1a-6c380b0d5c84.
curl -X DELETE "http://localhost:8001/services/foo-service/routes/a714d55e-a168-4efc-ae1a-6c380b0d5c84"
From a remote server
If issuing this command from a remote server, this command will delete the route that has ID a714d55e-a168-4efc-ae1a-6c380b0d5c84.
curl -X DELETE "http://hostname:8000/admin-api/services/foo-service/routes/a714d55e-a168-4efc-ae1a-6c380b0d5c84"
If the route was successfully deleted, something like this should be displayed. 204 No Content means the server has successfully fulfilled the request to delete the route. Additionally, the cURL command can be used to ensure the route no longer exists.
HTTP/1.1 204 No Content