Skip to main content
POST
Invoke Agent (Sync)
Invoke an agent synchronously. The request blocks until the agent finishes (typically 5–30 seconds) and returns the completed task with the result. For longer-running tasks, use Invoke Agent (Async) or Invoke Agent (Stream).

Path Parameters

string
required
Agent ID (UUID)

Request Body

input.text, input.user.id, and input.user.email are required. user_oidc_token is optional for MCP OAuth-backed tools.
object
required
string
Optional OIDC token for MCP OAuth-authenticated tools.
string
Thread ID for multi-turn conversations. Pass the id from a previous task’s response to continue the same conversation. The agent will have full context of all prior messages. If omitted, a new thread is created automatically.
boolean
default:"false"
When true, files passed in input.files are not injected into the LLM context window. The file URLs are still available to the agent’s tools, but the raw content won’t be prepended to the prompt.Use this when:
  • Files are large (would exceed the model’s context limit)
  • You want tools to process the files rather than the LLM reading them directly
  • You’re passing many files and don’t need them all in context
Default (false): file contents are downloaded, extracted, and injected directly into the LLM prompt as context.
string
default:"default"
Controls the agent’s reasoning depth. default for standard reasoning, harder for deeper chain-of-thought analysis. Use harder for complex multi-step tasks that benefit from more deliberate planning.
string
Additional instructions appended to the agent’s system prompt for this invocation only. Use this to adjust behavior per-request without changing the agent’s configuration — for example, restricting output format, adding constraints, or changing tone.
string
Extra context appended to the agent’s system prompt for this invocation only. Unlike instructions_override (which adds behavioral instructions), this supplies supplementary facts or context the agent should consider for this run — e.g. relevant background data, the current state of an external system, or a user’s recent activity.
string
Natural-language description of the desired output (e.g., "A bulleted list of key findings"). Guides the agent’s response style.
string
Per-execution LLM provider override. Use the provider’s internal identifier (e.g. openai, anthropic, bedrock) from GET /v1/misc/llm_providers. Omit to use the agent’s configured provider.
string
Per-execution model override. Must be a valid model under the chosen provider (GET /v1/misc/llm_providers/{provider_identifier}/models). Examples: claude-sonnet-4-6, gpt-5, gemini-2.0-flash. Omit to use the agent’s configured model.
string
default:"medium"
Per-execution reasoning-effort override for reasoning-capable models (e.g. GPT-5). One of low, medium, high, xhigh. Omit to use the agent’s configured reasoning effort.

Query Parameters

string
Agent version to invoke. Defaults to the latest deployed version. Use "draft" to test undeployed changes.

Response

The response is the full task object. The key fields you’ll use:
string
Task/thread ID. Pass this back as id in your next request to continue the conversation.
string
completed, failed, error, or stopped
string
The agent’s response. If output_format is json, this is a JSON string — parse it with JSON.parse() or jq.
string
ISO 8601 timestamp when the task was created
string
ISO 8601 timestamp when the task completed
string
Effective LLM provider used for this execution. Reflects the per-execution override when supplied, otherwise the agent’s configured provider.
string
Effective model name used for this execution. Reflects the per-execution override when supplied, otherwise the agent’s configured model.
string
Effective reasoning effort used for this execution. One of low, medium, high, xhigh. Reflects the per-execution override when supplied, otherwise the agent’s configured reasoning effort.

Simplest Possible Invoke

Extract just the result:

Multi-Turn Conversation

Pass the id from the first response to continue the thread:
The agent remembers all previous messages in the thread. Always reuse the same id for follow-ups.

With User Identity

Pass the required user fields so the agent can personalize responses and use identity-aware tools:
The user object is visible to the agent as context. Both id and email are required.

With MCP OAuth

Pass user_oidc_token when the agent uses MCP tools that require OAuth on behalf of the user:

Processing Files

Files passed in input.files are downloaded and injected directly into the LLM context window by default. This works well for small-to-medium files:
The 9-page Bitcoin whitepaper (above) processes successfully — its content fits within the model’s context window.

Large Files Fail with Direct Injection

Large files will exceed the model’s context limit and return an error:
Files are injected into the LLM context by default. Documents over ~100 pages will typically exceed the model’s token limit. For large documents, use a Knowledge Base instead — add the document to a KB, attach it to the agent, and the agent will search it automatically via RAG.

Disable Context Injection

Set disable_attachment_injection: true to pass the file URL to the agent’s tools without injecting its content into the LLM prompt:
With this flag, the file URL is available to the agent’s tools but the raw content is not prepended to the prompt. Use this when you want the agent’s tools to process the file rather than the LLM reading it directly.
For very large files (185+ pages), even disable_attachment_injection: true may not be enough — the file can exceed the HTTP request size limit before reaching the LLM. Use a Knowledge Base for production workflows with large documents.

Per-Request Instruction Override

Append instructions for this specific invocation without changing the agent’s configuration:

Per-Execution LLM Override

Override the agent’s configured provider, model, or reasoning effort for a single invocation without mutating the agent. Useful for A/B testing models, routing specific requests to a stronger or cheaper model, or dialing up reasoning effort on complex prompts:
All three fields are optional and independent — supply only the ones you want to override. Omitted fields fall back to the agent’s configured values. The response object includes the effective llm_model_provider, llm_model_name, and llm_reasoning_effort that were actually used, so downstream metrics and dashboards correctly attribute the run.

Structured JSON Output

Request structured output with a JSON Schema:
To configure output_format and output_schema for structured output, use the Update Agent endpoint or configure it in the dashboard under the Output tab.

Example Response

See Also

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Query Parameters

version
string | null

The agent/workflow version to invoke. default = latest

Body

application/json
input
AgentExecutionInput · object
required
id
string | null
payload_extension
Payload Extension · object | null
parent_execution_id
string | null
worker_id
string | null
source
string | null
output_format
enum<string> | null
Available options:
text,
markdown,
json,
voice
output_schema
Output Schema · object | null
run_locally
boolean | null
default:false
additional_context
string | null
instructions_override
string | null
test_run_node_id
string | null
expected_output
string | null
events_streaming
boolean | null
default:false
mcp_servers
Mcp Servers · object[] | null
triggering_agent_id
string | null
title
string | null
think_mode
enum<string> | null
default:default
Available options:
default,
harder
disable_attachment_injection
boolean | null
default:false
user_tokens
User Tokens · object | null
user_oidc_token
string | null
return_metrics
boolean | null
default:false
llm_model_provider
string | null

Per-execution override for the LLM provider (e.g. 'openai', 'anthropic'). Falls back to the agent's configured provider when unset.

llm_model_name
string | null

Per-execution override for the LLM model name. Falls back to the agent's configured model when unset.

llm_reasoning_effort
enum<string> | null

Per-execution override for reasoning effort on reasoning-capable models.

Available options:
low,
medium,
high,
xhigh
source_node_type
enum<string> | null

Surface that created this execution (mirrored to AgentExecutionHistory.source_node_type). Falls back to SourceNodeType.SDK at persist time when unset.

Available options:
workbench,
sdk,
task,
assistant,
webhook,
mcp,
a2a,
telegram,
slack,
email,
api
is_app
boolean | null
default:false
is_steering
boolean | null
default:false
sub_tasks_mode
enum<string> | null

Forces gateway sub-task dispatch: 'sync' runs all downstream sub-tasks inline, 'async' queues them all, 'auto' restores the computed per-sub-task decision.

Available options:
sync,
async,
auto

Response

Successful Response

Task creation response model.

Extends AgentExecution with additional agent_id field.

id
string
required
agent_id
string
required
organization_id
string
required
input
AgentExecutionInput · object
required
created_at
string<date-time>
required
status
enum<string> | null
default:pending
Available options:
pending,
executing,
paused,
error,
failed,
completed,
stopped
internal_status
string | null
last_executed_node_id
string | null
agent_version
string | null
started_at
string<date-time> | null
paused_at
string<date-time> | null
finished_at
string<date-time> | null
result
string | null
parent_execution
string | null
sub_executions
string[] | null
finished_sub_executions
string[] | null
should_update_parent
boolean | null
default:false
is_manually_stopped
boolean | null
default:false
is_background
boolean | null
default:false
payload_extension
Payload Extension · object | null
hitl_request
HumanInTheLoopRequest · object | null

Model representing human-in-the-loop approval records for tasks.

Attributes: wait_node_id (str): The id of the node that triggered this HITL.

pending_eca_request
PendingECARequest · object | null
source
string | null
worker_id
string | null
additional_context
string | null
instructions_override
string | null
expected_output
string | null
test_run_node_id
string | null
is_orchestration
boolean | null
default:false
is_gateway
boolean | null
default:false
is_app
boolean | null
default:false
sub_tasks_mode
enum<string> | null
Available options:
sync,
async,
auto
output_format
enum<string> | null
default:text
Available options:
text,
markdown,
json,
voice
voice_id
string | null
output_schema
Output Schema · object | null
events_streaming
boolean | null
default:false
used_mutating_tools
boolean | null
default:false
is_continuous
boolean | null
default:false
mcp_servers
Mcp Servers · object[] | null
triggering_agent_id
string | null
title
string | null
think_mode
enum<string> | null
default:default
Available options:
default,
harder
disable_attachment_injection
boolean | null
default:false
deep_planning
DeepPlanning · object | null
must_deep_plan
boolean | null
default:false
execution_attempts
integer | null
default:1
user_tokens
User Tokens · object | null
user_oidc_token
string | null
return_metrics
boolean | null
default:false
tokens
LLMTokens · object | null
llm_model_provider
string | null

Snapshot of the LLM provider used for this execution (request override or agent default at run time).

llm_model_name
string | null

Snapshot of the LLM model name used for this execution (request override or agent default at run time).

llm_reasoning_effort
enum<string> | null

Snapshot of the reasoning effort applied during this execution, when supported by the model.

Available options:
low,
medium,
high,
xhigh