Skip to main content
POST
/
sessions
/
by-slug
/
:slug
/
close
Close Session
curl --request POST \
  --url https://api.example.com/sessions/by-slug/:slug/close
{
  "ok": true
}
Mark a session as closed, preventing new connections.

Endpoint

POST /sessions/by-slug/:slug/close

Path Parameters

slug
string
required
The session slug (format: adjective-noun-number)

Response

ok
boolean
required
Whether the session was successfully closed

Example Request

curl -X POST https://control.wormkey.io/sessions/by-slug/quiet-lime-42/close

Example Response

{
  "ok": true
}

Behavior

  • Sets the session’s closed flag to true
  • The session remains in the control plane’s memory
  • The edge gateway should check this flag before allowing new connections
  • Existing connections may continue until they disconnect
Closing a session does not immediately terminate active tunnel connections. Use this endpoint to prevent new connections to an existing session.

Use Cases

  • Gracefully shut down a tunnel without deleting the session record
  • Prevent new viewers from joining while existing viewers finish
  • Administrative control over session access

Build docs developers (and LLMs) love