---
title: "Create Agent Run"
method: POST
path: "/v2/agents/{agent_id}/runs"
tags: ["Public API"]
---

# Create Agent Run

`POST /v2/agents/{agent_id}/runs`

Start an agent run. The run executes asynchronously: the response returns immediately with status `queued`, then poll `GET .../runs/{run_id}` until `completed` and fetch the output from `GET .../runs/{run_id}/result` — or set `enable_events: true` and follow `GET .../runs/{run_id}/events` for live progress.

To enrich existing records instead of researching from scratch, pass them in `input_data`; this requires an `output_schema` (on the request or the agent).

## Path parameters

- `agent_id` string, uuid, required

## Request body

- WebSearchAgentRunCreateRequestPublicV2
  - `effort` 'low' | 'medium' | 'high' | 'x-high' | 'max' — Canonical effort tier names for the research graph.
  - `enable_events` boolean — Whether to stream run events when supported.
  - `input` string, required — User prompt or task instructions for the run.
  - `input_data` union — Existing records to ENRICH: a list of partial rows, or a single object, mirroring output_schema's shape.
    - object[]
    - object
  - `output_schema` object, nullable — JSON schema overriding the agent's default structured output for this run.
  - `previous_interaction_id` string, nullable — Previous interaction identifier used to continue a conversation.
  - `sources` AgentSourcesPublicV2
    - `allow` WebSearchAgentSourceCreateRequestPublicV2[] — Source groups the agent is allowed to use.
      - `domains` string[], required — Domains included in this source group.
      - `order` integer — Zero-based source group position.
      - `title` string, required — Source group title.
    - `avoid` string, nullable — Free-text guidance describing sources or domains to avoid.
    - `block` WebSearchAgentSourceCreateRequestPublicV2[] — Source groups the agent should not use.
      - `domains` string[], required — Domains included in this source group.
      - `order` integer — Zero-based source group position.
      - `title` string, required — Source group title.
    - `prioritize` string, nullable — Free-text guidance describing sources or domains to prioritize.

## Response `202`

Successful Response

- TaskRunResponsePublicV2
  - `completed_at` string, date-time, nullable — When the run completed.
  - `created_at` string, date-time, required — When the run was created.
  - `effort` 'low' | 'medium' | 'high' | 'x-high' | 'max', required — Canonical effort tier names for the research graph.
  - `error` TaskRunErrorPublicV2
    - `message` string, required — Human-readable error description.
    - `ref_id` string, required — Reference ID (equals the run id).
  - `id` string, required — Run identifier, format "task_run_{uuid}".
  - `interaction_id` string, required — Interaction ID.
  - `is_active` boolean, required — True while status is 'queued' or 'running'.
  - `prompt` string, nullable — Prompt submitted for the run.
  - `started_at` string, date-time, nullable — When the run started executing.
  - `status` 'queued' | 'running' | 'completed' | 'failed' | 'cancelled', required — Lowercase status values used in API responses (distinct from the DB-level TaskRunStatus enum).
  - `web_search_agent_id` string, required — Web Search Agent instance this run belongs to.

## Other responses

- `404` — Agent not found, not owned by your account, or deactivated.
- `422` — Validation Error

---

[API](https://skmtc.net/nimbleway/apis/nimble-sdk.md) · [All operations](https://skmtc.net/nimbleway/apis/nimble-sdk/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nimbleway/nimble-sdk/versions/725be79e7005/schema)
