> ## Documentation Index
> Fetch the complete documentation index at: https://magica-adi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get run status

> Poll until status is COMPLETE, FAILED, or CANCELLED.
The public snapshot does not mint a realtime token.




## OpenAPI

````yaml /openapi.yaml get /chats/{chatId}/runs/{runId}
openapi: 3.1.0
info:
  title: Galaxy Agent API
  version: 1.0.0
  description: |
    Public REST for agent chats, Magica tools, and run status.
    Authenticate with `Authorization: Bearer gxk_live_…`.
servers:
  - url: https://magica-backend-oda9.onrender.com/api/v1
    description: Production
  - url: http://localhost:4000/api/v1
    description: Local
security:
  - bearerAuth: []
tags:
  - name: Chats
  - name: Messages
  - name: Runs
  - name: Magica
paths:
  /chats/{chatId}/runs/{runId}:
    get:
      tags:
        - Runs
      summary: Get run status
      description: |
        Poll until status is COMPLETE, FAILED, or CANCELLED.
        The public snapshot does not mint a realtime token.
      operationId: getRun
      parameters:
        - $ref: '#/components/parameters/chatId'
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Run snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunSnapshot'
        '404':
          description: Run or chat was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    chatId:
      name: chatId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    RunSnapshot:
      type: object
      required:
        - chatId
        - runId
        - messageId
        - status
      properties:
        chatId:
          type: string
          format: uuid
        runId:
          type: string
          format: uuid
        messageId:
          type: string
          format: uuid
        assistantMessageId:
          type: string
          format: uuid
          nullable: true
        triggerRunId:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - QUEUED
            - THINKING
            - WORKING
            - WAITING
            - STOPPING
            - COMPLETE
            - FAILED
            - CANCELLED
        currentStep:
          type: string
          nullable: true
        thinkingDurationMs:
          type: integer
          nullable: true
        progressPercent:
          type: integer
          nullable: true
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        tools:
          type: array
          items:
            type: object
            properties:
              toolCallId:
                type: string
              toolName:
                type: string
              status:
                type: string
                enum:
                  - PENDING
                  - RUNNING
                  - SUCCESS
                  - FAILED
                  - CANCELLED
              errorMessage:
                type: string
                nullable: true
        waitpoint:
          type: object
          nullable: true
          properties:
            waitpointId:
              type: string
              format: uuid
            type:
              type: string
              enum:
                - OPTIONS
                - PLAN
                - CREDIT
                - MEDIA
            status:
              type: string
              enum:
                - WAITING
                - COMPLETED
                - EXPIRED
                - CANCELLED
            timeoutAt:
              type: string
              format: date-time
            payload: {}
        assistant:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            status:
              type: string
            contentBlocks:
              type: array
              items: {}
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
          examples:
            - UNAUTHORIZED
            - CHAT_NOT_FOUND
            - RUN_ACTIVE
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key created in the product. Shown once, prefix `gxk_live_`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.