> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nimbleway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Run

> Creates a minimal persistent Web Search Agent and starts a run for it. The response includes `web_search_agent_id` for later agent and run queries.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/agents/runs
openapi: 3.1.0
info:
  title: Nimble SDK
  version: 1.0.0
  description: The AI-Native SDK for Real-Time Web Data at scale
servers:
  - url: https://sdk.nimbleway.com
security: []
paths:
  /v2/agents/runs:
    post:
      tags:
        - Public API
      summary: Create Run
      description: >-
        Creates a minimal persistent Web Search Agent and starts a run for it.
        The response includes `web_search_agent_id` for later agent and run
        queries.
      operationId: >-
        create_run_with_generated_agent_public_v2_api_v2_public_web_search_agents_runs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebSearchAgentRunCreateRequestPublicV2'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunResponsePublicV2'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
        - APIKeyCookie: []
components:
  schemas:
    WebSearchAgentRunCreateRequestPublicV2:
      properties:
        effort:
          anyOf:
            - $ref: '#/components/schemas/Effort'
            - type: 'null'
          description: Effort level overriding the agent default for this run.
        enable_events:
          default: false
          description: Whether to stream run events when supported.
          title: Enable Events
          type: boolean
        input:
          description: User prompt or task instructions for the run.
          title: Input
          type: string
          example: >-
            Find the 10 fastest growing AI startups in Europe and their latest
            funding rounds.
        input_data:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Existing records to ENRICH: a list of partial rows, or a single
            object, mirroring output_schema's shape.
          title: Input Data
        output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            JSON schema overriding the agent's default structured output for
            this run.
          title: Output Schema
        previous_interaction_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Previous interaction identifier used to continue a conversation.
          title: Previous Interaction Id
        sources:
          anyOf:
            - $ref: '#/components/schemas/AgentSourcesPublicV2'
            - type: 'null'
          description: Source guidance overriding the agent default.
      required:
        - input
      title: WebSearchAgentRunCreateRequestPublicV2
      type: object
    TaskRunResponsePublicV2:
      properties:
        completed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the run completed.
          title: Completed At
        created_at:
          description: When the run was created.
          format: date-time
          title: Created At
          type: string
        effort:
          $ref: '#/components/schemas/Effort'
          description: Effort level used for the run.
          example: high
        error:
          anyOf:
            - $ref: '#/components/schemas/TaskRunErrorPublicV2'
            - type: 'null'
          description: Error details when the run failed.
        id:
          description: Run identifier, format "task_run_{uuid}".
          title: Id
          type: string
          example: task_run_c0ffee00-0000-4000-8000-000000000000
        interaction_id:
          description: Interaction ID.
          title: Interaction Id
          type: string
        is_active:
          description: True while status is 'queued' or 'running'.
          title: Is Active
          type: boolean
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          description: Prompt submitted for the run.
          title: Prompt
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the run started executing.
          title: Started At
        status:
          $ref: '#/components/schemas/TaskRunStatusValue'
          description: Current run status.
          example: queued
        web_search_agent_id:
          description: Web Search Agent instance this run belongs to.
          title: Web Search Agent Id
          type: string
          example: wsa_2af5b0e2-58b8-4b60-a1a4-9e57e4d33f00
      required:
        - id
        - interaction_id
        - status
        - is_active
        - effort
        - created_at
        - web_search_agent_id
      title: TaskRunResponsePublicV2
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Effort:
      description: Canonical effort tier names for the research graph.
      enum:
        - low
        - medium
        - high
        - x-high
        - max
      title: Effort
      type: string
    AgentSourcesPublicV2:
      additionalProperties: false
      properties:
        allow:
          description: Source groups the agent is allowed to use.
          items:
            $ref: '#/components/schemas/WebSearchAgentSourceCreateRequestPublicV2'
          title: Allow
          type: array
        avoid:
          anyOf:
            - type: string
            - type: 'null'
          description: Free-text guidance describing sources or domains to avoid.
          title: Avoid
        block:
          description: Source groups the agent should not use.
          items:
            $ref: '#/components/schemas/WebSearchAgentSourceCreateRequestPublicV2'
          title: Block
          type: array
        prioritize:
          anyOf:
            - type: string
            - type: 'null'
          description: Free-text guidance describing sources or domains to prioritize.
          title: Prioritize
      title: AgentSourcesPublicV2
      type: object
    TaskRunErrorPublicV2:
      properties:
        message:
          description: Human-readable error description.
          title: Message
          type: string
        ref_id:
          description: Reference ID (equals the run id).
          title: Ref Id
          type: string
      required:
        - ref_id
        - message
      title: TaskRunErrorPublicV2
      type: object
    TaskRunStatusValue:
      description: >-
        Lowercase status values used in API responses (distinct from the
        DB-level TaskRunStatus enum).
      enum:
        - queued
        - running
        - completed
        - failed
        - cancelled
      title: TaskRunStatusValue
      type: string
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    WebSearchAgentSourceCreateRequestPublicV2:
      properties:
        domains:
          description: Domains included in this source group.
          items:
            type: string
          title: Domains
          type: array
          example:
            - linkedin.com
            - crunchbase.com
        order:
          default: 0
          description: Zero-based source group position.
          title: Order
          type: integer
        title:
          description: Source group title.
          title: Title
          type: string
          example: Professional networks
      required:
        - title
        - domains
      title: WebSearchAgentSourceCreateRequestPublicV2
      type: object

````