Send message
Append a user message to an existing session and resume the agent. The session must be idle, completed, failed, or approval_required; sending to a session that is processing or queued returns 409 interaction_not_in_terminal_state. To hand the agent a message while it is still busy, use the message queue instead.
Files uploaded via Upload session file can be attached to the message with attachments.
Sessions waiting on an approval
A session that stopped to ask you something is approval_required, and you have two ways to move it forward:
- Answer the ask. Send the pending asks’ responses to Resolve approvals. Use this to approve or reject a tool call, or to answer an Ask Question the agent raised. This endpoint rejects
approval_responseswith a400. - Send a follow-up instead. Post a normal message here. It is appended to the session transcript and starts a new turn, leaving the pending ask unanswered. Use this when the answer no longer matters — for example to redirect the agent or drop the request it was asking about.
See Human in the Loop for how agents pause for approvals and questions.
Streaming the response
api.gumloop.com only serves the non-streaming response above. To stream agent output as it’s produced, send the same request body (with stream: true) to the streaming host instead:
POST https://ws.gumloop.com/api/v1/sessions/{session_id}/messages
The response is text/event-stream (Server-Sent Events). With the Python SDK, client.sessions.stream_message(session_id, input="...") routes to ws.gumloop.com automatically and yields parsed StreamEvent objects.
If you send stream: true to api.gumloop.com by mistake, the response is a 400 whose body contains the correct streaming host so you can retry against it.
Authorizations
Path Parameters
ID of the session to continue.
Body
The next user message. Required. Also accepted as message for backwards compatibility.
"Now write a follow-up email."
Must be false (or omitted) when calling api.gumloop.com. Set to true only when calling ws.gumloop.com (see the streaming section above).
Files to attach to the message. Each file_name must be a stored path returned by Upload session file for this session.
10