Invoke Agent (Sync)
Execute an agent and wait for completion. Returns the final result.
Path Parameters
Request Body
input.text, input.user.id, and input.user.email are required. user_oidc_token is optional for MCP OAuth-backed tools.
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.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
false): file contents are downloaded, extracted, and injected directly into the LLM prompt as context.default for standard reasoning, harder for deeper chain-of-thought analysis. Use harder for complex multi-step tasks that benefit from more deliberate planning.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."A bulleted list of key findings"). Guides the agent’s response style.openai, anthropic, bedrock) from GET /v1/llm_providers. Omit to use the agent’s configured provider.GET /v1/llm_providers/{provider}/models). Examples: claude-sonnet-4-6, gpt-5, gemini-2.0-flash. Omit to use the agent’s configured model.low, medium, high, xhigh. Omit to use the agent’s configured reasoning effort.Query Parameters
"draft" to test undeployed changes.Response
The response is the full task object. The key fields you’ll use:id in your next request to continue the conversation.completed, failed, error, or stoppedoutput_format is json, this is a JSON string — parse it with JSON.parse() or jq.low, medium, high, xhigh. Reflects the per-execution override when supplied, otherwise the agent’s configured reasoning effort.Simplest Possible Invoke
Multi-Turn Conversation
Pass theid from the first response to continue the thread:
id for follow-ups.
With User Identity
Pass the required user fields so the agent can personalize responses and use identity-aware tools:user object is visible to the agent as context. Both id and email are required.
With MCP OAuth
Passuser_oidc_token when the agent uses MCP tools that require OAuth on behalf of the user:
Processing Files
Files passed ininput.files are downloaded and injected directly into the LLM context window by default. This works well for small-to-medium files:
Large Files Fail with Direct Injection
Large files will exceed the model’s context limit and return an error:Disable Context Injection
Setdisable_attachment_injection: true to pass the file URL to the agent’s tools without injecting its content into the LLM prompt:
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: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: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
- Invoke Agent (Async) — returns immediately with a task ID for polling
- Invoke Agent (Stream) — real-time SSE stream of agent activity
- Get Thread — retrieve the full conversation history
- Webhook documentation — trigger agents from external systems via the auto-generated
webhook_url
Authorizations
API Key for authentication
Path Parameters
Query Parameters
The agent/workflow version to invoke. default = latest
Body
text, markdown, json, voice default, harder Per-execution override for the LLM provider (e.g. 'openai', 'anthropic'). Falls back to the agent's configured provider when unset.
Per-execution override for the LLM model name. Falls back to the agent's configured model when unset.
Per-execution override for reasoning effort on reasoning-capable models.
low, medium, high, xhigh Surface that created this execution (mirrored to AgentExecutionHistory.source_node_type). Falls back to SourceNodeType.SDK at persist time when unset.
workbench, sdk, task, assistant, webhook, mcp, a2a, telegram, slack Response
Successful Response
Task creation response model.
Extends AgentExecution with additional agent_id field.
pending, executing, paused, error, failed, completed, stopped Model representing human-in-the-loop approval records for tasks.
Attributes: wait_node_id (str): The id of the node that triggered this HITL.
text, markdown, json, voice default, harder Snapshot of the LLM provider used for this execution (request override or agent default at run time).
Snapshot of the LLM model name used for this execution (request override or agent default at run time).
Snapshot of the reasoning effort applied during this execution, when supported by the model.
low, medium, high, xhigh 
