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

# Get the status of an agent run

> Returns the current status of an agent run, the original question, and (for completed
runs) the rendered result. Use this to discover whether a run is still running, completed,
failed, or expired (e.g. after a dropped SSE connection).




## OpenAPI

````yaml /api-reference/openapi.yml get /query/runs/{runId}
openapi: 3.0.3
info:
  title: DataLinks
  version: 2.2.3
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /query/runs/{runId}:
    get:
      tags:
        - agentRuns
      summary: Get the status of an agent run
      description: >
        Returns the current status of an agent run, the original question, and
        (for completed

        runs) the rendered result. Use this to discover whether a run is still
        running, completed,

        failed, or expired (e.g. after a dropped SSE connection).
      operationId: getAgentRunStatus
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Run status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunStatusResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    AgentRunStatusResponse:
      required:
        - agentKind
        - canResume
        - question
        - runId
        - status
      type: object
      properties:
        runId:
          type: string
          format: uuid
        agentKind:
          type: string
          example: auto_rag
        question:
          type: string
          description: The original prompt that started the conversation.
        status:
          type: string
          enum:
            - running
            - completed
            - failed
            - expired
        canResume:
          type: boolean
          description: >-
            True only when the status is `running` AND the checkpoint blob loads
            cleanly.
        lastNodeId:
          type: string
        errorMessage:
          type: string
        result:
          type: object
          additionalProperties: true
          description: >-
            Rendered AutoRag result for completed runs, in the same shape as
            `POST /query/autorag`'s response body.
    ErrorResponse:
      required:
        - error_code
        - message
      type: object
      properties:
        error_code:
          type: string
          example: UNAUTHORIZED
        error_message:
          type: string
          example: ''
        message:
          type: string
          example: Missing authentication token
        sub_errors:
          type: array
          items:
            required:
              - code
              - message
            type: object
            properties:
              code:
                type: string
              message:
                type: string
  responses:
    Unauthorized:
      description: >-
        Unauthorized. This error occurs if the authentication token is missing
        or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      description: >
        Use a Bearer token for authentication. Submit the token using the
        `Authorization`

        header: `Authorization: Bearer <token>`.
      scheme: bearer
    openId:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://login.datalinks.com/realms/datalinks-realm/protocol/openid-connect/auth
          scopes:
            openid: openid

````