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

# Get a run

> Returns current state of a run. Poll every 1-3 seconds until `status` is `completed`, `failed`, or `cancelled`.

When `status` is `completed`, `output` is keyed by normalized User Result node labels.



## OpenAPI

````yaml /openapi.json get /api/v1/runs/{runId}
openapi: 3.0.3
info:
  title: Blend AI Workflow API
  version: 1.0.0
  description: Run published Blend AI workflows over HTTP.
  contact:
    name: Blend AI Support
    url: https://tryblend.ai
servers:
  - url: https://tryblend.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v1/runs/{runId}:
    get:
      summary: Get a run
      description: >-
        Returns current state of a run. Poll every 1-3 seconds until `status` is
        `completed`, `failed`, or `cancelled`.


        When `status` is `completed`, `output` is keyed by normalized User
        Result node labels.
      operationId: getRun
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
          description: Run ID returned from `POST /api/v1/responses`.
      responses:
        '200':
          description: Run detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RunDetail:
      type: object
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: run_xyz789
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - cancelled
          description: Terminal states are `completed`, `failed`, `cancelled`.
        published_workflow_id:
          type: string
          nullable: true
        published_workflow_version_id:
          type: string
          nullable: true
        output:
          type: object
          nullable: true
          description: >-
            Present only when `status` is `completed`. Keys are normalized
            labels of each User Result node. Values are ordered arrays of result
            output items.
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/OutputItem'
          example:
            image:
              - id: item_1
                item_index: 0
                status: completed
                parts:
                  - type: image
                    url: https://cdn.tryblend.ai/runs/abc/image.png
            caption:
              - id: item_2
                item_index: 0
                status: completed
                parts:
                  - type: text
                    text: A cat on the moon, gazing at earth.
        error:
          type: string
          nullable: true
          description: Error message if `status` is `failed`.
        total_cost:
          type: number
          nullable: true
          description: Total cost of the run in USD.
          example: 0.0123
        created_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
    OutputItem:
      type: object
      required:
        - id
        - item_index
        - status
        - parts
      description: >-
        One ordered result output item. Failed items remain present with
        `status: failed` and may have empty `parts` plus `error`.
      properties:
        id:
          type: string
        item_index:
          type: integer
          minimum: 0
        status:
          type: string
          enum:
            - completed
            - failed
            - pending
            - running
        parts:
          type: array
          items:
            $ref: '#/components/schemas/OutputPart'
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: number
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid or missing API key.
            type:
              type: string
              enum:
                - authentication_error
                - insufficient_credits
                - rate_limit_error
                - invalid_request_error
                - not_found_error
                - server_error
            code:
              type: string
              description: >-
                Machine-readable sub-code. Examples: `invalid_api_key`,
                `rate_limit_exceeded`, `insufficient_credits`, `not_found`,
                `published_workflow_not_found`,
                `published_workflow_version_not_found`, `invalid_input_fields`,
                `workflow_graph_corrupt`.
    OutputPart:
      type: object
      required:
        - type
      description: >-
        One output part inside a result output item. Check the `type` field to
        branch: `text` has `text`; `image` / `video` / `file` have `url`; `json`
        has `data`.
      properties:
        type:
          type: string
          enum:
            - text
            - image
            - video
            - file
            - json
        text:
          type: string
          description: Present when `type` is `text`.
        url:
          type: string
          format: uri
          description: Present when `type` is `image`, `video`, or `file`.
        mime_type:
          type: string
          description: Optional. Present when `type` is `file`.
        data:
          description: Present when `type` is `json`.
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: >-
        Run, published workflow, or version not found — or not owned by the
        caller.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: >-
        Per-API-key rate limit exceeded. Inspect `X-RateLimit-*` and
        `Retry-After` headers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: bai_...
      description: >-
        API key issued from the Blend AI dashboard. Prefix: `bai_`. Send as
        `Authorization: Bearer bai_...`.

````