Invoke Agent (Async)
Execute an agent asynchronously. Returns immediately with a task ID for polling.
Invoke an agent asynchronously. Returns immediately with a task ID andDocumentation Index
Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
Use this file to discover all available pages before exploring further.
status: "pending". Poll the Get Task endpoint to check when results are ready.
Use this for long-running tasks, background processing, or when you don’t want to block a request.
Path Parameters
Request Body
The request body is identical to Invoke Agent (Sync).input.textis requiredinput.user.idis requiredinput.user.emailis requireduser_oidc_tokenis optional for MCP OAuth-backed tools
id from a previous task to continue the conversation.true, files in input.files are not injected into the LLM context window. See Invoke Sync: Processing Files.default or harder. Controls reasoning depth.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.low | medium | high | xhigh). See Invoke Sync: Per-Execution LLM Override.Query Parameters
"draft" to test undeployed changes.Response
Returns immediately with the task object inpending state.
pending on initial return. Transitions to executing → completed (or failed/error).null until the task completesBasic Example
Polling for Results
Example Response (After Completion)
Poll the task after it finishes to get the full result:Task Status Flow
pending → executing → completed | failed | error | stopped
completed before sending the next message with the same id. Sending a follow-up while the previous task is still executing may cause unexpected behavior.See Also
- Invoke Agent (Sync) — blocks until completion (best for quick tasks)
- Invoke Agent (Stream) — real-time SSE stream
- Get Task — poll for task status and results
- Webhook documentation — get notified when tasks complete instead of polling
Authorizations
API Key for authentication
Path Parameters
Query Parameters
The agent/workflow version to invoke. default = latest
Body
Pass the id from a previous response to continue a multi-turn conversation with the same agent. Omit for a new conversation.
"02843b37-4d77-48a0-8da7-2c76afe54401"
Per-execution override of the agent's LLM provider (e.g. openai, anthropic). Must match one of GET /llm_providers. Omit to use the agent's configured provider.
Per-execution override of the model name within the chosen provider. Must match a model from GET /llm_providers/{provider}/models. Examples: claude-sonnet-4-6, gpt-5, gemini-2.0-flash. Omit to use the agent's configured model.
Per-execution override of reasoning effort for reasoning-capable models (e.g. GPT-5). low for simple tasks, medium for balanced performance, high for complex reasoning, xhigh for maximum reasoning depth (slower, more expensive). Omit to use the agent's configured reasoning effort.
low, medium, high, xhigh Response
Successful Response
Unique task identifier. Use this to poll for results when invoking async.
"02843b37-4d77-48a0-8da7-2c76afe54401"
"47c3b020-9a6b-4699-8d94-d92d71929b53"
"91fbe9bc-35b3-41e8-b59d-922fb5a0f031"
pending | executing | completed | error
pending, executing, completed, error, failed, stopped "completed"
The agent's response. Populated when status is 'completed'. Null for async until polling shows completed.
"Hello! 👋"
"2026-04-10T19:01:22.898813Z"
Null until the task completes.
"2026-04-10T19:01:33.120590Z"
"api"

