Skip to main content

Terminate a device tunnel

DELETE 

/api/v1/devices/{deviceId}/tunnels/sessions/{tunnelSessionId}

Initiates a graceful or immediate shutdown of the specified tunnel session. In this version, a termination requested through this endpoint currently reports terminationSource as TunnelMgmt instead of User.

Preconditions: The session must be in REQUESTED, ESTABLISHING, ESTABLISHED, or RECONNECTING state. If the session is already FAILED, TERMINATING, or TERMINATED, the request returns 409 (WEDA.Tunnel.SessionInTerminalStatus).

Request body (required; omitting it returns 400):

  • reason: Human-readable explanation for the termination.
  • graceful: When true, the agent honours the forceTimeout before hard-closing existing connections. Defaults to false (close immediately).
  • forceTimeout: Maximum seconds to wait for the device to close the tunnel before forcing closure, whether or not graceful is true. If omitted, 0, or negative, the default is used (60 seconds unless the deployment configures a different value).

Request​

Responses​

The tunnel session being terminated.