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

# List snippet runs

> Returns runs for a snippet. Use `view=basic` for a compact listing.



## OpenAPI

````yaml /openapi-public.json get /snippets/{id}/runs
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Public API for managing Akua workspaces, clusters, products, and installs.


    Authenticate with a workspace API token via the `Authorization: Bearer
    sk_akua_...` header.


    A workspace-owned token implies its workspace. Broad tokens select the
    active workspace via the optional `Akua-Context` header.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://akua.dev/docs
servers:
  - url: https://api.akua.dev/v1
    description: Production
security: []
tags:
  - name: Auth
    description: Authentication and token management.
  - name: Agent events
    description: Persisted agent transcripts and response recovery.
  - name: Custom domains
    description: Workspace custom domains and routing targets.
  - name: Cloudflare
    description: Cloudflare account credentials and gateway control.
  - name: Clusters
    description: Kubernetes clusters and cluster access operations.
  - name: ComputeConfigs
    description: Workspace compute provider configurations.
  - name: Entitlements
    description: Effective workspace capabilities and limits.
  - name: Dashboards
    description: Dashboard and widget resources.
  - name: Installs
    description: Installation and render operations.
  - name: Machines
    description: Compute machines and lifecycle events.
  - name: Notifications
    description: User notification state.
  - name: Offer Channels
    description: Private offer channels and policy versions.
  - name: Offers
    description: Marketplace offers and redemption tracking.
  - name: Operations
    description: Long-running operation status and controls.
  - name: Order Drafts
    description: Draft checkout orders and checkout sessions.
  - name: Organizations
    description: Organizations, memberships, and managed workspaces.
  - name: Packages
    description: Software packages, versions, and input schemas.
  - name: Products
    description: Marketplace product catalog resources.
  - name: Preview hostnames
    description: Install preview hostnames and routing state.
  - name: Quotas
    description: Workspace quota limits and usage.
  - name: Regions
    description: Available deployment regions.
  - name: Registry
    description: Container registry credentials and repositories.
  - name: Repository change requests
    description: Fork-backed repository change reviews and lifecycle actions.
  - name: Repositories
    description: Source repositories available to the workspace.
  - name: Secrets
    description: Workspace secrets and secret versions.
  - name: Snippets
    description: Reusable snippets and snippet runs.
  - name: Workspace subdomains
    description: Workspace subdomain identity.
  - name: Workspaces
    description: Workspace resources, members, and billing state.
paths:
  /snippets/{id}/runs:
    get:
      tags:
        - Snippets
      summary: List snippet runs
      description: Returns runs for a snippet. Use `view=basic` for a compact listing.
      operationId: snippets.listRuns
      parameters:
        - name: id
          in: path
          schema:
            type: string
            minLength: 1
            maxLength: 54
          required: true
        - name: cursor
          in: query
          schema:
            type: string
            description: Pagination cursor from a previous response's `next_cursor`.
          required: false
        - name: limit
          in: query
          schema:
            type: integer
            description: Items per page (1-100, default 50)
            default: 50
            examples:
              - 50
            minimum: 1
            maximum: 100
          required: false
        - name: state
          in: query
          schema:
            type: string
            enum:
              - succeeded
              - failed
              - timed_out
          required: false
        - name: view
          in: query
          schema:
            type: string
            enum:
              - basic
              - full
            description: Control whether output and error details are included.
            default: basic
          required: false
      responses:
        '200':
          description: List of snippet runs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnippetRunList'
        '401':
          description: Missing, invalid or expired credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorized'
        '403':
          description: The credential may not act in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbidden'
      security:
        - BearerAuth: []
components:
  schemas:
    SnippetRunList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SnippetRun'
        has_more:
          type: boolean
          description: True if more items exist after this page.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Opaque cursor for the next page, or null if no more pages.
      required:
        - data
        - has_more
        - next_cursor
      additionalProperties: false
    ApiUnauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unauthorized
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiForbidden:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Forbidden
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    SnippetRun:
      oneOf:
        - type: object
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 54
            snippet_id:
              type: string
              minLength: 1
              maxLength: 54
            source:
              type: string
              enum:
                - manual
                - dashboard_open
                - dashboard_refresh
                - agent
              description: Origin that initiated the persisted snippet run.
            snippet_name:
              type: string
            snippet_etag:
              type: string
            dashboard_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 55
                - type: 'null'
            dashboard_name:
              anyOf:
                - type: string
                - type: 'null'
            widget_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 54
                - type: 'null'
            widget_title:
              anyOf:
                - type: string
                - type: 'null'
            run_by:
              type: string
            agent_session_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 54
                - type: 'null'
            agent_turn_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 54
                - type: 'null'
            state:
              type: string
              enum:
                - succeeded
                - failed
                - timed_out
              description: Terminal run state in past participle form.
            inputs:
              type: object
            overrides:
              type: object
              description: >-
                Legacy execution metadata retained for compatibility. It is not
                applied as runtime input.
            error:
              $ref: '#/components/schemas/SnippetRunError'
            duration_ms:
              type: number
            stats:
              type: object
              properties:
                cpu_time_ms:
                  type: number
                wall_time_ms:
                  type: number
                heap_used_bytes:
                  type: number
              required:
                - cpu_time_ms
                - wall_time_ms
                - heap_used_bytes
              additionalProperties: false
            created_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
            etag:
              type: string
            result_contract_version:
              type: 'null'
            result_type:
              type: 'null'
            default_visualization:
              type: 'null'
            output: {}
          required:
            - id
            - snippet_id
            - source
            - snippet_name
            - snippet_etag
            - dashboard_id
            - dashboard_name
            - widget_id
            - widget_title
            - run_by
            - agent_session_id
            - agent_turn_id
            - state
            - inputs
            - duration_ms
            - stats
            - created_at
            - etag
            - result_contract_version
            - result_type
            - default_visualization
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 54
            snippet_id:
              type: string
              minLength: 1
              maxLength: 54
            source:
              type: string
              enum:
                - manual
                - dashboard_open
                - dashboard_refresh
                - agent
              description: Origin that initiated the persisted snippet run.
            snippet_name:
              type: string
            snippet_etag:
              type: string
            dashboard_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 55
                - type: 'null'
            dashboard_name:
              anyOf:
                - type: string
                - type: 'null'
            widget_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 54
                - type: 'null'
            widget_title:
              anyOf:
                - type: string
                - type: 'null'
            run_by:
              type: string
            agent_session_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 54
                - type: 'null'
            agent_turn_id:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 54
                - type: 'null'
            state:
              type: string
              enum:
                - succeeded
                - failed
                - timed_out
              description: Terminal run state in past participle form.
            inputs:
              type: object
            overrides:
              type: object
              description: >-
                Legacy execution metadata retained for compatibility. It is not
                applied as runtime input.
            error:
              $ref: '#/components/schemas/SnippetRunError'
            duration_ms:
              type: number
            stats:
              type: object
              properties:
                cpu_time_ms:
                  type: number
                wall_time_ms:
                  type: number
                heap_used_bytes:
                  type: number
              required:
                - cpu_time_ms
                - wall_time_ms
                - heap_used_bytes
              additionalProperties: false
            created_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
            etag:
              type: string
            result_contract_version:
              type: number
              enum:
                - 1
            result_type:
              type: string
              enum:
                - scalar
                - timeseries
                - categorical
                - table
                - status_list
                - logs
                - json
            default_visualization:
              type: string
              enum:
                - stat
                - sparkline
                - line
                - area
                - bar
                - donut
                - table
                - status_list
                - logs
                - json
            output:
              oneOf:
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - scalar
                    value:
                      anyOf:
                        - type: string
                          maxLength: 16384
                        - type: number
                        - type: boolean
                        - type: 'null'
                    unit:
                      type: string
                      minLength: 1
                      maxLength: 64
                    definition:
                      type: string
                      minLength: 1
                      maxLength: 500
                    timestamp:
                      type: integer
                      minimum: 0
                    history:
                      type: array
                      items:
                        type: object
                        properties:
                          timestamp:
                            type: integer
                            minimum: 0
                          value:
                            anyOf:
                              - type: number
                              - type: 'null'
                        required:
                          - timestamp
                          - value
                        additionalProperties: false
                      maxItems: 2000
                  required:
                    - contract_version
                    - type
                    - value
                  additionalProperties: false
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - timeseries
                    series:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                          unit:
                            type: string
                            minLength: 1
                            maxLength: 64
                          definition:
                            type: string
                            minLength: 1
                            maxLength: 500
                        required:
                          - key
                          - label
                        additionalProperties: false
                      minItems: 1
                      maxItems: 8
                    points:
                      type: array
                      items:
                        type: object
                        properties:
                          timestamp:
                            type: integer
                            minimum: 0
                          values:
                            type: array
                            items:
                              anyOf:
                                - type: number
                                - type: 'null'
                            maxItems: 8
                        required:
                          - timestamp
                          - values
                        additionalProperties: false
                      maxItems: 2000
                  required:
                    - contract_version
                    - type
                    - series
                    - points
                  additionalProperties: false
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - categorical
                    series:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                          unit:
                            type: string
                            minLength: 1
                            maxLength: 64
                          definition:
                            type: string
                            minLength: 1
                            maxLength: 500
                        required:
                          - key
                          - label
                        additionalProperties: false
                      minItems: 1
                      maxItems: 8
                    categories:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                        required:
                          - key
                          - label
                        additionalProperties: false
                      maxItems: 100
                    values:
                      type: array
                      items:
                        type: array
                        items:
                          anyOf:
                            - type: number
                            - type: 'null'
                        maxItems: 8
                      maxItems: 100
                  required:
                    - contract_version
                    - type
                    - series
                    - categories
                    - values
                  additionalProperties: false
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - table
                    columns:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                              label:
                                type: string
                                minLength: 1
                                maxLength: 200
                              definition:
                                type: string
                                minLength: 1
                                maxLength: 500
                              kind:
                                type: string
                                enum:
                                  - text
                            required:
                              - key
                              - label
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                              label:
                                type: string
                                minLength: 1
                                maxLength: 200
                              definition:
                                type: string
                                minLength: 1
                                maxLength: 500
                              kind:
                                type: string
                                enum:
                                  - number
                              unit:
                                type: string
                                minLength: 1
                                maxLength: 64
                            required:
                              - key
                              - label
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                              label:
                                type: string
                                minLength: 1
                                maxLength: 200
                              definition:
                                type: string
                                minLength: 1
                                maxLength: 500
                              kind:
                                type: string
                                enum:
                                  - boolean
                            required:
                              - key
                              - label
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                              label:
                                type: string
                                minLength: 1
                                maxLength: 200
                              definition:
                                type: string
                                minLength: 1
                                maxLength: 500
                              kind:
                                type: string
                                enum:
                                  - timestamp
                            required:
                              - key
                              - label
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                              label:
                                type: string
                                minLength: 1
                                maxLength: 200
                              definition:
                                type: string
                                minLength: 1
                                maxLength: 500
                              kind:
                                type: string
                                enum:
                                  - link
                            required:
                              - key
                              - label
                              - kind
                            additionalProperties: false
                      minItems: 1
                      maxItems: 32
                    rows:
                      type: array
                      items:
                        type: array
                        items:
                          anyOf:
                            - type: string
                              maxLength: 16384
                            - type: number
                            - type: boolean
                            - type: 'null'
                        maxItems: 32
                      maxItems: 500
                  required:
                    - contract_version
                    - type
                    - columns
                    - rows
                  additionalProperties: false
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - status_list
                    items:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                          severity:
                            type: string
                            enum:
                              - info
                              - success
                              - warning
                              - critical
                              - unknown
                          detail:
                            type: string
                            maxLength: 16384
                          timestamp:
                            type: integer
                            minimum: 0
                          link:
                            type: string
                            minLength: 1
                            maxLength: 2048
                        required:
                          - key
                          - label
                          - severity
                        additionalProperties: false
                      maxItems: 200
                  required:
                    - contract_version
                    - type
                    - items
                  additionalProperties: false
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - logs
                    entries:
                      type: array
                      items:
                        type: object
                        properties:
                          message:
                            type: string
                            minLength: 1
                            maxLength: 4096
                          timestamp:
                            type: integer
                            minimum: 0
                          level:
                            type: string
                            minLength: 1
                            maxLength: 32
                        required:
                          - message
                        additionalProperties: false
                      maxItems: 1000
                  required:
                    - contract_version
                    - type
                    - entries
                  additionalProperties: false
                - type: object
                  properties:
                    contract_version:
                      type: number
                      enum:
                        - 1
                    type:
                      type: string
                      enum:
                        - json
                    value: {}
                  required:
                    - contract_version
                    - type
                    - value
                  additionalProperties: false
          required:
            - id
            - snippet_id
            - source
            - snippet_name
            - snippet_etag
            - dashboard_id
            - dashboard_name
            - widget_id
            - widget_title
            - run_by
            - agent_session_id
            - agent_turn_id
            - state
            - inputs
            - duration_ms
            - stats
            - created_at
            - etag
            - result_contract_version
            - result_type
            - default_visualization
          additionalProperties: false
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          description: Machine-readable error code
          examples:
            - 7002
        message:
          type: string
          description: Human-readable error message
          examples:
            - Resource not found
        path:
          type: array
          items:
            type: string
          description: Field path that caused the error, when applicable
          examples:
            - - body
              - name
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
      additionalProperties: false
    SnippetRunError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details: {}
      required:
        - code
        - message
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      description: >-
        workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at
        https://akua.dev/developers/api-tokens
      type: http
      scheme: bearer

````

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