---
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
  - `agent_name` string, nullable — Stable agent name. On this no-agent-id route, an unseen name creates a new agent; an existing name reuses it. Ignored on the /{agent_id}/runs route.
  - `effort` 'low' | 'medium' | 'high' | 'x-high' | '5x-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
  - `origin` 'api' — Origin of public API runs. Public requests are always API-originated.
  - `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.
  - `skill` string, nullable — Skill override for this run. One-time only, except when this run creates a new agent via agent_name, in which case it becomes the new agent's stored skill.
  - `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.
  - `use_case` 'research' | 'enrichment' | 'dataset_building'

## 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' | '5x-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

- `422` — Validation Error

## Changes

- **2026-08-17** `22c2a2291146` — 1 warning, 1 info
  - added the new `5x-high` enum value to the `effort` response property for the response status `202`
  - added the new `5x-high` enum value to the request property `effort/anyOf[subschema #1: Effort]/`
- **2026-07-28** `1217768ca401` — 4 info
  - added the new optional request property `agent_name`
  - added the new optional request property `origin`
  - added the new optional request property `skill`
  - added the new optional request property `use_case`
- **2026-07-20** `d4e4f170f4f4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/nimbleway/apis/api-gateway/changes/v2/agents/:agent_id/runs/post.md)

---

[API](https://skmtc.dev/nimbleway/apis/api-gateway.md) · [All operations](https://skmtc.dev/nimbleway/apis/api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nimbleway/api-gateway/revisions/d1947ec7af21/schema)
