Cancel an in-flight chat stream
Changed onCooperatively stop a POST /conversations/stream or POST /conversations/{conversationId}/messages/stream run that is still generating, using the runId sent when that stream started.
This is a synchronous JSON ack, not another SSE stream. The cancelled run's own stream (if still connected) receives a terminal frame with a stopped status and whatever partial answer had already generated; nothing further is delivered here.
A runId that already finished or was never registered is not an error either, but it is answered { cancelled: true }, not false: the query service's KV-backed run registry publishes the cancel for other workers and acknowledges it as cancelled (a known defect). { cancelled: false } is only returned when that publish fails.
Only the conversation's owner (matched on userId) can cancel; any other caller, or a missing, deleted or agent conversation, is 404.
runId must belong to a run started on THIS conversationId — a runId that exists but was registered under a different conversation (even one owned by the same caller) is rejected with 403, same as a runId owned by a different user/org.
Request
- Base URLhttps://app.pipeshub.com/api/v1
- URLhttps://app.pipeshub.com/api/v1/conversations/{conversationId}/cancel
- Auth
- HTTP bearer
- or OAuth 2Authorization code: /api/v1/oauth2/authorizeClient credentialsToken URL: /api/v1/oauth2/token scopes: conversation:chat
Path parameters
Request body
Response
Cancellation requested, or the run had already finished.
Changes
- breaking
added the pattern
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$to the request property - info
added the media type
application/x-www-form-urlencodedto the request body - info
added the media type
application/jsonfor the response with the status - info
added the media type
application/jsonfor the response with the status - info
added the media type
application/jsonfor the response with the status - info
added the media type
application/jsonfor the response with the status - info
added the non-success response with the status
- info
the response property
became required for the status
- breaking
- info
endpoint added
- info