POST
/chat-messages/{task_id}/stopStop Chat Message Generation
Available for: Chatflow, Agent, Chatbot, Legacy Agent apps.
Stops a chat message generation task. Only supported in streaming mode, or after a blocking call returns with a Chatflow run paused.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
task_idstringrequired
Task ID, from the streaming events of [Send Chat Message](/en/api-reference/chat-messages/send-chat-message).
userstringrequired
End-user identifier, defined by your app and unique within it. Must match the `user` sent with the original message; if it differs, the stop silently does nothing and still returns success. See [End User Identity](/en/api-reference/guides/end-user-identity).
200Operation successful.
resultstringoptional
Operation result. Always `success`.
400- `not_chat_app` : App mode does not match the API route.
- `invalid_param` : The required `user` field is missing.
2 documented failures
invalid_paramArg user must be provided.
invalid_param
not_chat_appPlease check if your app mode matches the right API route.
not_chat_app
Error handling
A 400 is returned: - not_chat_app : App mode does not match the API route.
invalid_param: The requireduserfield is missing.