Skip to main content
GET
Retrieve Agent Status
Poll the status of an API-initiated agent interaction. Once the interaction reaches the COMPLETED state, the response includes the full conversation messages and the agent’s final text response.

Request

Headers

URL Parameters

string
required
The interaction ID returned from the Start Agent endpoint.

Query Parameters

string
Your Gumloop user ID. Required if project_id is not provided.
string
Your team (workspace) ID. Required if user_id is not provided.

Example Request

Response

While Processing (200 OK)

When the agent is still working, the response contains only the interaction metadata:

On Completion (200 OK)

When the agent finishes, the response includes the full conversation and a convenience response field:

On Failure (200 OK)

When the agent encounters an error, the response includes an error_message:

Response Fields

string
The unique interaction identifier.
string
The agent’s ID.
string
Current state of the interaction. One of: ASYNC_PROCESSING, COMPLETED, FAILED.
string
ISO 8601 timestamp of when the interaction was created.
array
Full conversation history including the user message and all agent messages with tool call details. Only present when state is COMPLETED.
string
The agent’s final text response extracted from the last assistant message. This is a convenience field: the same text exists in the messages array. Only present when state is COMPLETED.
string
Description of what went wrong (truncated to 4096 characters). Only present when state is FAILED.

Error Responses


Interaction States


Message Structure

When the interaction completes, the messages array contains the full conversation. Each message has the following structure:

User Message

Assistant Message

Assistant messages contain parts instead of content. Each part represents a piece of the response: Text Part:
Tool Invocation Part:
File Part:
Error Part:
Messages are sanitized to include only safe fields. Message-level fields: id, role, timestamp, parts, content. Part-level fields: id, type, text, reasoning, toolCallId, toolName, toolCallState, result, error, file. Result-level fields: args, result.

Polling Best Practices

  • Poll interval: 2-5 seconds is recommended. Avoid polling more frequently than every 1 second.
  • Timeout: Set a reasonable timeout (e.g., 5-10 minutes) depending on your agent’s expected workload.
  • Backoff: Consider exponential backoff if you’re making many concurrent requests.
  • Resumable: If your client disconnects, you can resume polling with the same interaction_id. Each call to /start_agent creates a new interaction, so there’s no risk of duplicate processing.
  • Use response for simple integrations: It contains just the agent’s final text. Use messages when you need tool call details or the full conversation.