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

# Conversation Run State

> Cheap snapshot of a conversation's run and queue state.

Poll this to see whether a turn is live and how many follow-ups are queued (with previews). It is Redis-backed and cheap, so it is safe to poll frequently.

See the [Agent Gateway overview](/api-reference/v1/agents/gateway/overview) for the full conversation model.


## OpenAPI

````yaml GET /v1/agents/{agent_id}/gateway/conversations/{conversation_id}/run-state
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/agents/{agent_id}/gateway/conversations/{conversation_id}/run-state:
    get:
      tags:
        - API v1
        - Agents
        - Agent Gateway
      summary: Conversation Run State
      description: Cheap snapshot of the conversation's run / queue / steer state.
      operationId: >-
        Conversation_Run_State_v1_agents__agent_id__gateway_conversations__conversation_id__run_state_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            title: Conversation Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayRunState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    GatewayRunState:
      properties:
        conversation_id:
          type: string
          title: Conversation Id
        is_running:
          type: boolean
          title: Is Running
          default: false
        is_steerable:
          type: boolean
          title: Is Steerable
          default: false
        steer_target:
          type: string
          title: Steer Target
          default: none
        active_child_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Active Child Id
        queue_depth:
          type: integer
          title: Queue Depth
          default: 0
        queued_messages:
          items:
            $ref: '#/components/schemas/GatewayQueuedMessage'
          type: array
          title: Queued Messages
        execution_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Execution Status
        conversation_state:
          type: string
          title: Conversation State
          default: regular
      type: object
      required:
        - conversation_id
      title: GatewayRunState
      description: Snapshot the UI uses to render run/queue/steer affordances.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GatewayQueuedMessage:
      properties:
        id:
          type: string
          title: Id
        text:
          type: string
          title: Text
          default: ''
        files:
          items:
            type: string
          type: array
          title: Files
        user:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User
        enqueued_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Enqueued At
        idempotency_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Idempotency Key
      type: object
      required:
        - id
      title: GatewayQueuedMessage
      description: One user message held in the per-conversation queue.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````