Send message
send_messageAppend a user message to an existing Gumloop session and resume the agent; use the message queue instead if the session is busy.
Instructions
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}/messagesThe 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.
Explicit confirmation is required for this exact account operation. Runs can spend credits or trigger downstream actions; never resubmit unknown outcomes automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | The next user message. Required. Also accepted as `message` for backwards compatibility. | |
| stream | No | Must be `false` (or omitted) when calling `api.gumloop.com`. Set to `true` only when calling `ws.gumloop.com` (see the streaming section above). | |
| account | No | Named private Gumloop account; selects private credentials and user/team identity. | |
| confirm | No | Set true only when the user asked for exactly this action. | |
| payload | No | Complete JSON request body instead of body flags. Preserves current endpoint fields and values. | |
| session_id | Yes | ID of the session to continue. | |
| attachments | No | ||
| payload_file | No | Regular local JSON body file, at most 5 MB. Cannot be mixed with body flags or payload. |