Cancel an in-flight connect session
Changed onTerminate a still-active session at the user's request.
Gated like /status — the poll_token the SPA already holds, or the target agent's owner / org:admin without it.
A still-existing but already-terminal session is a 204 no-op — a "Cancel" click racing the poll scanner doesn't error. A session that has already been cascade-deleted (unhappy-terminal path in _mark_terminal) surfaces as 403, matching /status — the caller can't distinguish "gone" from "your poll_token is wrong", which is the enumeration-oracle guard. The SPA's cancel-on-unmount is fire-and-forget and .catches the 403, so this doesn't leak into the UX.
Request
- Base URL: / (relative, and the document was published on a file host, not at the API’s origin)
- URL: /connect-sessions/{session_id}:cancel
- Auth: HTTP bearer
Path parameters
Query parameters
Opaque poll capability returned by :connect. Optional for the target agent's owner (with credentials:write and agents:write) and org:admin
Response
Successful Response
Changes
- info
the
queryrequest parameterpoll_tokenbecame optional - info
queryrequest parameterpoll_tokenlist-of-types was widened by adding typesnull - info
for the
queryrequest parameterpoll_token, the type was generalized fromstringto no type
- info
- info
endpoint added
- info