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

# Get run

> Poll until `status` reaches a terminal state.



## OpenAPI

````yaml api-reference/openapi.json GET /v1/agent/runs/{id}
openapi: 3.1.0
info:
  title: Seltz API
  description: >-
    REST API for the Seltz platform: context retrieval (`/v1/search`), RAG
    answers (`/v1/answer`), monitors (`/v1/monitors`), and page fetching
    (`/v1/fetch`).
  contact:
    name: Seltz API Support
    url: https://seltz.ai/contact
  license:
    name: Seltz Terms of Use
    url: https://seltz.ai/terms
  version: 1.8.0
servers:
  - url: https://api.seltz.ai
    description: Seltz API
security: []
tags:
  - name: search
    description: Search operations
  - name: answer
    description: Answer operations
  - name: monitors
    description: Monitor configuration
  - name: records
    description: The delivered records
  - name: runs
    description: Run history and per-request outcomes
  - name: agent
    description: 'Agent runs: create, poll, list, cancel'
  - name: fetch
    description: Fetch operations
paths:
  /v1/agent/runs/{id}:
    get:
      tags:
        - agent
      summary: Retrieve an agent run
      description: Poll until `status` reaches a terminal state.
      operationId: getAgentRun
      parameters:
        - name: id
          in: path
          description: The run id.
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          description: 'Seltz API key: https://console.seltz.ai/api-keys'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRun'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: No such run in this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    AgentRun:
      type: object
      description: An agent run.
      properties:
        completed_at:
          type:
            - string
            - 'null'
          description: When the run reached a terminal state. Unset until then.
          default: null
        created_at:
          type: string
          description: When the run was created, as an ISO 8601 timestamp.
          default: ''
        id:
          type: string
          description: Unique run id.
          default: ''
        object:
          type: string
          description: Object type, always "agent.run".
          default: ''
        output:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/AgentRunOutput'
              description: The run's output. Its members are unset until the run completes.
          default: null
        request:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/AgentRunRequest'
              description: The request the run was created with.
          default: null
        started_at:
          type:
            - string
            - 'null'
          description: When the run started. Unset while pending.
          default: null
        status:
          oneOf:
            - $ref: '#/components/schemas/AgentRunStatus'
              description: Where the run is in its lifecycle.
          default: pending
        stop_reason:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/AgentRunStopReason'
              description: Why the run stopped. Set once the run reaches a terminal state.
          default: null
    ErrorEnvelope:
      type: object
      description: 'The `{"error": {...}}` envelope a non-200 carries.'
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/EnvelopeError'
          description: The rejection.
    AgentRunOutput:
      type: object
      description: A run's output.
      properties:
        grounding:
          type: array
          items:
            $ref: '#/components/schemas/AgentRunGrounding'
          description: >-
            Per-field citations for `structured`. Empty when there is no
            structured

            output.
          default: []
        sources:
          type: array
          items:
            $ref: '#/components/schemas/AgentRunSource'
          description: The sources the run consulted.
          default: []
        structured:
          type:
            - object
            - 'null'
          description: >-
            Structured result shaped by the request's `output_schema`. Unset
            when the

            request had none. Fields that could not be grounded are null. On
            gRPC the

            object is JSON-encoded.
        text:
          type:
            - string
            - 'null'
          description: >-
            Cited markdown report. Inline `\[n\]` markers cite the entry of
            `sources`

            whose `id` is `n`.
          default: null
    AgentRunRequest:
      type: object
      description: The request a run was created with.
      properties:
        output_schema:
          type:
            - object
            - 'null'
          description: >-
            The request's `output_schema`, when one was given. On gRPC the
            object is

            JSON-encoded.
        query:
          type: string
          description: The natural-language question.
          default: ''
    AgentRunStatus:
      type: string
      description: |-
        Where a run is in its lifecycle:
        pending → running → completed / failed / cancelled.
      enum:
        - pending
        - running
        - completed
        - failed
        - cancelled
    AgentRunStopReason:
      type: string
      description: |-
        Why a run stopped. `budget_reached` and `timeout` pair with `completed`
        when the output so far is usable and with `failed` when it is not.
      enum:
        - finished
        - budget_reached
        - timeout
        - cancelled
        - invalid_output
        - internal_error
    EnvelopeError:
      type: object
      description: |-
        The failure inside a non-200 envelope. Its `code` is `SCREAMING` and the
        set is closed, because it is a pure function of the gRPC code.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: A stable name for the rejection.
        message:
          type: string
          description: What went wrong, in prose. Never an internal service name.
    AgentRunGrounding:
      type: object
      description: Citations for one field of `output.structured`.
      properties:
        citations:
          type: array
          items:
            $ref: '#/components/schemas/AgentRunCitation'
          description: Citations supporting this field's value.
          default: []
        field:
          type: string
          description: >-
            Dot-notation path into the structured output, e.g.
            "companies.0.ceo".
          default: ''
    AgentRunSource:
      type: object
      description: One source a run consulted.
      properties:
        id:
          type: integer
          format: int32
          description: >-
            Identifier within the run, cited as `\[id\]` in `text` and as
            `source_id`

            in `grounding`.
          default: 0
          minimum: 0
        url:
          type: string
          description: URL of the source document.
          default: ''
    AgentRunCitation:
      type: object
      description: One citation supporting a grounded field.
      properties:
        source_id:
          type: integer
          format: int32
          description: '`id` of the entry in `sources` this citation points at.'
          default: 0
          minimum: 0
        url:
          type: string
          description: URL of the cited document.
          default: ''

````