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

Only input is required, with the prompt in input.text. input.user is optional. When you send it, input.user.email is required. user_oidc_token is optional and is used by skills that sign in with MCP OAuth.
object
required
string
Optional OIDC token for MCP OAuth-authenticated tools. An MCP skill set to Signed-in user (SSO) does not read this field: on an API call it uses the stored SSO sign-in of the agent’s default user.
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
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
The provider override sent with this request, or null when you did not override it.
string
The model name override sent with this request, or null when you did not override it.
string
The reasoning effort override sent with this request, or null when you did not override it.

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 user’s identity so the agent can personalize responses and use identity-aware skills:
The agent sees the user object as context. When you send user, email is required and id is optional.

With MCP OAuth

Pass user_oidc_token when the agent uses MCP skills that sign in with 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

A large file is still accepted. This request sends a 185-page PDF, and the agent answers correctly:
Every file you inject uses part of the model’s context window, on every turn of the thread. For large documents, or documents you query often, use a Knowledge Base. Add the document to a knowledge base and attach it to the agent. The agent then searches it when it needs to.

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.

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 echoes the override in llm_model_provider, llm_model_name and llm_reasoning_effort. A field you did not override is null in the response, and the agent’s configured value applies.

Structured JSON Output

Request structured output with a JSON Schema:
The per-call schema applies to runs the API starts directly; a turn inside an agent’s conversation uses the agent-level schema.
To configure output_format and output_schema on the agent itself, 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