End a Tunnel
"Tunnel" is the term for a live agent connection. You can't end one via REST — to drop a tunnel, the agent has to disconnect (kill the process, or call tunnel.close() if you opened it via ngris.connect()).
To remove the configured endpoint behind it:
Use DELETE /v1/endpoints/{id}. That tears down the routing entry; any agent currently connected to that endpoint will be force-disconnected by the tunnel-server.
Request — delete the endpoint
curl -X DELETE "https://api.ngris.com/v1/endpoints/<endpoint_uuid>" \
-H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
client.endpoints.delete("<endpoint_uuid>")
Python — close an ad-hoc tunnel
import ngris
t = ngris.connect(8080, api_key="<your_api_key>")
# ... do work ...
t.close() # SIGTERM the agent and revoke the auth token