> ## 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.

# Get Agent Run Result

> Fetch the output of a completed run. The `output` is `type: "text"` (a prose answer) or `type: "json"` (structured data matching the output schema), plus `trust` metadata with per-claim citations for the answer.

While the run is still `queued` or `running` this endpoint returns `409`; if the run `failed` or was `cancelled` it returns `422` with the run and error details.



## OpenAPI

````yaml /api-reference/openapi.json get /v2/agents/{agent_id}/runs/{run_id}/result
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/{agent_id}/runs/{run_id}/result:
    get:
      tags:
        - Public API
      summary: Get Agent Run Result
      description: >-
        Fetch the output of a completed run. The `output` is `type: "text"` (a
        prose answer) or `type: "json"` (structured data matching the output
        schema), plus `trust` metadata with per-claim citations for the answer.


        While the run is still `queued` or `running` this endpoint returns
        `409`; if the run `failed` or was `cancelled` it returns `422` with the
        run and error details.
      operationId: >-
        get_run_result_public_v2_api_v2_public_web_search_agents__agent_id__runs__run_id__result_get
      parameters:
        - in: path
          name: agent_id
          required: true
          schema:
            format: uuid
            title: Agent Id
            type: string
          description: Web Search Agent ID, format `wsa_<uuid>`.
        - in: path
          name: run_id
          required: true
          schema:
            title: Run Id
            type: string
          description: Run ID, format `task_run_<uuid>`.
      responses:
        '200':
          description: Run completed; the output is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunResultPublicV2'
        '404':
          description: Run not found for this agent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    title: Detail
                title: ErrorDetail
              example:
                detail: >-
                  Run 'task_run_c0ffee00-0000-4000-8000-000000000000' not found
                  for agent wsa_2af5b0e2-58b8-4b60-a1a4-9e57e4d33f00
        '409':
          description: >-
            Run is still queued or running. Poll `GET .../runs/{run_id}` until
            `status` is `completed`, then retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    title: Detail
                title: ErrorDetail
              example:
                detail: >-
                  Run still active; poll the run status endpoint (GET
                  .../runs/task_run_c0ffee00-0000-4000-8000-000000000000) until
                  completed
        '422':
          description: >-
            The run failed or was cancelled. `detail` carries the run and its
            error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    $ref: '#/components/schemas/TaskRunFailedResultPublicV2'
                title: FailedRunDetail
      security:
        - BearerAuth: []
components:
  schemas:
    TaskRunResultPublicV2:
      properties:
        output:
          anyOf:
            - $ref: '#/components/schemas/TaskRunTextOutputPublicV2'
            - $ref: '#/components/schemas/TaskRunJsonOutputPublicV2'
          description: Output from the completed task.
          title: Output
        run:
          $ref: '#/components/schemas/TaskRunResponsePublicV2'
          description: Task run object with status 'completed'.
      required:
        - run
        - output
      title: TaskRunResultPublicV2
      type: object
    TaskRunFailedResultPublicV2:
      properties:
        error:
          $ref: '#/components/schemas/TaskRunErrorPublicV2'
          description: Structured error detail.
        run:
          $ref: '#/components/schemas/TaskRunResponsePublicV2'
          description: Task run object with status 'failed'.
      required:
        - run
        - error
      title: TaskRunFailedResultPublicV2
      type: object
    TaskRunTextOutputPublicV2:
      properties:
        content:
          description: The final prose answer.
          title: Content
          type: string
        trust:
          $ref: '#/components/schemas/TextRunTrust'
          description: Trust and citation metadata for the output.
        type:
          const: text
          default: text
          description: Output content type.
          title: Type
          type: string
      required:
        - content
        - trust
      title: TaskRunTextOutputPublicV2
      type: object
    TaskRunJsonOutputPublicV2:
      properties:
        content:
          anyOf:
            - additionalProperties: true
              type: object
            - items: {}
              type: array
          description: The final structured output.
          title: Content
        trust:
          $ref: '#/components/schemas/JsonRunTrust'
          description: Trust and citation metadata for the output.
        type:
          const: json
          default: json
          description: Output content type.
          title: Type
          type: string
      required:
        - content
        - trust
      title: TaskRunJsonOutputPublicV2
      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
    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
    TextRunTrust:
      description: >-
        Trust metadata for a prose answer: run-level confidence plus per-claim
        citations.
      properties:
        claims:
          description: Per-claim trust, keyed by callout markers in the answer text.
          items:
            $ref: '#/components/schemas/TextClaimTrust'
          title: Claims
          type: array
        confidence:
          $ref: '#/components/schemas/TrustConfidence'
          description: Overall confidence in the answer.
        reasoning:
          description: Why this confidence level was assigned.
          title: Reasoning
          type: string
        sources:
          description: Sources consulted while producing the answer.
          items:
            $ref: '#/components/schemas/TrustSource'
          title: Sources
          type: array
      required:
        - sources
        - confidence
        - reasoning
        - claims
      title: TextRunTrust
      type: object
    JsonRunTrust:
      description: >-
        Trust metadata for a structured answer: run-level confidence plus
        per-value citations.
      properties:
        claims:
          description: Per-value trust, keyed by JSON path in the structured output.
          items:
            $ref: '#/components/schemas/JsonClaimTrust'
          title: Claims
          type: array
        confidence:
          $ref: '#/components/schemas/TrustConfidence'
          description: Overall confidence in the answer.
        reasoning:
          description: Why this confidence level was assigned.
          title: Reasoning
          type: string
        sources:
          description: Sources consulted while producing the answer.
          items:
            $ref: '#/components/schemas/TrustSource'
          title: Sources
          type: array
      required:
        - sources
        - confidence
        - reasoning
        - claims
      title: JsonRunTrust
      type: object
    Effort:
      description: Canonical effort tier names for the research graph.
      enum:
        - low
        - medium
        - high
        - x-high
        - max
      title: Effort
      type: string
    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
    TextClaimTrust:
      description: Trust metadata for one claim in a prose answer, keyed by callout marker.
      properties:
        callout:
          description: Callout marker number referencing this claim in the answer text.
          title: Callout
          type: integer
        citations:
          description: Citations backing this claim.
          items:
            $ref: '#/components/schemas/TrustCitation'
          title: Citations
          type: array
        confidence:
          $ref: '#/components/schemas/TrustConfidence'
          description: Confidence in this claim.
        reasoning:
          description: Why this confidence level was assigned.
          title: Reasoning
          type: string
      required:
        - citations
        - confidence
        - reasoning
        - callout
      title: TextClaimTrust
      type: object
    TrustConfidence:
      enum:
        - high
        - medium
        - low
        - pre_existing
      title: TrustConfidence
      type: string
    TrustSource:
      description: A source consulted while producing the answer.
      properties:
        extract_template_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Extract template used to read the source, when one was used.
          title: Extract Template Name
        source_category:
          anyOf:
            - $ref: '#/components/schemas/SourceCategory'
            - type: 'null'
          description: >-
            Kind of source: official, news, social, academic, aggregator, or
            other.
        source_intent:
          anyOf:
            - $ref: '#/components/schemas/SourceCategory'
            - type: 'null'
          description: Kind of source the underlying question asked for.
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: Title of the source page.
          title: Title
        type:
          $ref: '#/components/schemas/TrustSourceType'
          description: 'How authoritative the source is: ''primary'' or ''secondary''.'
        url:
          description: URL of the source page.
          title: Url
          type: string
      required:
        - url
        - type
      title: TrustSource
      type: object
    JsonClaimTrust:
      description: >-
        Trust metadata for one value in a structured (JSON) answer, keyed by
        JSON path.
      properties:
        citations:
          description: Citations backing this value.
          items:
            $ref: '#/components/schemas/TrustCitation'
          title: Citations
          type: array
        confidence:
          $ref: '#/components/schemas/TrustConfidence'
          description: Confidence in this value.
        path:
          description: >-
            JSON path of the value in the structured output this claim refers
            to.
          title: Path
          type: string
        reasoning:
          description: Why this confidence level was assigned.
          title: Reasoning
          type: string
      required:
        - citations
        - confidence
        - reasoning
        - path
      title: JsonClaimTrust
      type: object
    TrustCitation:
      description: A citation backing a specific claim in the answer.
      properties:
        excerpts:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Verbatim excerpts supporting the claim.
          title: Excerpts
          example:
            - Acme raised a $30M Series B in June 2026.
        extract_template_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Extract template used to read the source, when one was used.
          title: Extract Template Name
        source_category:
          anyOf:
            - $ref: '#/components/schemas/SourceCategory'
            - type: 'null'
          description: >-
            Kind of source: official, news, social, academic, aggregator, or
            other.
        source_intent:
          anyOf:
            - $ref: '#/components/schemas/SourceCategory'
            - type: 'null'
          description: Kind of source the underlying question asked for.
        source_type:
          anyOf:
            - $ref: '#/components/schemas/TrustSourceType'
            - type: 'null'
          description: 'How authoritative the source is: ''primary'' or ''secondary''.'
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: Title of the cited page.
          title: Title
        url:
          description: URL of the cited page.
          title: Url
          type: string
          example: https://www.linkedin.com/company/acme
      required:
        - url
      title: TrustCitation
      type: object
    SourceCategory:
      description: >-
        What *kind* of source this is (classified by the compress LLM),
        independent

        of TrustSourceType (how authoritative it is for a specific claim).
        Deliberately

        uses "official" rather than "primary" so the two axes can never collide.


        Also doubles as the sub-question's ``source_intent`` (what kind of
        source a

        question *needs*) — the two concepts overlap enough that a single enum
        lets

        ``classify_source_importance`` compare "what we got" against "what we
        asked

        for" directly.
      enum:
        - official
        - news
        - social
        - academic
        - aggregator
        - other
      title: SourceCategory
      type: string
    TrustSourceType:
      enum:
        - primary
        - secondary
      title: TrustSourceType
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````