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

# List job runs

> A tenant's runs, newest first, optionally filtered to sandbox_id or schedule_id.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/job
openapi: 3.1.0
info:
  title: Bonya Compute REST API
  version: 0.1.0
  description: >
    Public REST and WebSocket surface on TApi behind Caddy. Non-2xx responses
    are RFC 9457 application/problem+json with a stable machine-readable code.
    WebSocket endpoints are HTTP GET upgrades; their options travel in the START
    frame, never in query strings.
servers:
  - url: https://api.bonya.ai
    description: Production
security:
  - personalApiKey: []
  - supabaseJwt: []
tags:
  - name: Sandboxes
    description: Create, look up, list, pause, fork, snapshot, and delete sandboxes.
  - name: Snapshots
    description: Named point-in-time copies of a sandbox that new sandboxes can start from.
  - name: Templates
    description: Saved, versioned launch configurations for sandboxes.
  - name: Registry Connections
    description: Credentials for pulling private container images.
  - name: Secrets
    description: Write-only secrets and secret sets injected into sandboxes and jobs.
  - name: Previews
    description: Expose a sandbox port as an HTTPS URL.
  - name: Exec
    description: Run a command in a sandbox, buffered or over a TTY.
  - name: Sessions
    description: Named, persistent command sessions that outlive a connection.
  - name: Filesystem
    description: Read, write, and manage files inside a sandbox.
  - name: Jobs
    description: Managed, tracked runs of a command or script.
  - name: Job Schedules
    description: Cron, interval, or one-shot timing wrapped around a job.
  - name: Organizations
    description: Organization membership, administration and usage reporting.
  - name: Invitations
    description: Invite members to an organization and accept invitations.
  - name: API Keys
    description: Personal API key management.
  - name: Device Login
    description: Browser-based login for the CLI.
paths:
  /v1/job:
    parameters:
      - $ref: '#/components/parameters/OrganizationHeader'
    get:
      tags:
        - Jobs
      summary: List job runs
      description: >-
        A tenant's runs, newest first, optionally filtered to sandbox_id or
        schedule_id.
      operationId: listJobRuns
      parameters:
        - name: sandbox_id
          in: query
          schema:
            type: string
        - name: schedule_id
          in: query
          schema:
            type: string
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
        - name: page_token
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Run page
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobRunPage'
        default:
          $ref: '#/components/responses/Problem'
components:
  parameters:
    OrganizationHeader:
      name: X-Bonya-Organization-ID
      in: header
      required: false
      schema:
        type: string
      description: >
        Org context. Omitted means the caller's personal organization. A
        well-formed non-member org is 404; malformed is 400.
  schemas:
    JobRunPage:
      type: object
      required:
        - runs
      properties:
        runs:
          type: array
          items:
            $ref: '#/components/schemas/JobRun'
        next_page_token:
          type: string
    JobRun:
      type: object
      required:
        - run_id
        - status
        - created_sandbox
        - cleanup_failed
        - available_actions
      properties:
        run_id:
          type: string
        name:
          type: string
          description: Optional human-readable name for this job.
        status:
          type: string
          enum:
            - running
            - completed
            - failed
            - canceled
            - timed_out
            - terminated
        sandbox_id:
          type: string
        created_sandbox:
          type: boolean
          description: >-
            Distinguishes whether this run created sandbox_id or was given it,
            which decides whether the caller still owns it after the run.
        schedule_id:
          type: string
        started_at_unix_nanos:
          type: integer
        finished_at_unix_nanos:
          type: integer
        result:
          $ref: '#/components/schemas/JobResult'
        failure:
          type: string
        cleanup_failed:
          type: boolean
          description: >-
            The run finished but could not delete the sandbox it created. That
            sandbox is still billed and still visible in ListSandboxes.
        available_actions:
          type: array
          description: >-
            What the caller may do to this run right now, computed server-side.
            A client must not re-derive these from status alone.
          items:
            type: string
            enum:
              - cancel
              - rerun
              - retry
              - delete
              - delete_sandbox
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        code:
          type: string
        detail:
          type: string
    JobResult:
      type: object
      required:
        - exit_code
        - signaled
        - timed_out
        - stdout_b64
        - stderr_b64
        - stdout_truncated
        - stderr_truncated
      description: >-
        The command's outcome. A non-zero exit_code is a completed run, not a
        failed one; a failure to create or resume the sandbox is a failed run
        instead, reported via the run's own failure field.
      properties:
        exit_code:
          type: integer
        signaled:
          type: boolean
        signal:
          type: integer
        timed_out:
          type: boolean
        stdout_b64:
          type: string
          contentEncoding: base64
        stderr_b64:
          type: string
          contentEncoding: base64
        stdout_truncated:
          type: boolean
        stderr_truncated:
          type: boolean
  responses:
    Problem:
      description: RFC 9457 problem
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    personalApiKey:
      type: http
      scheme: bearer
      description: >-
        Personal byk_ API key; user-principal, resolved to a tenant by org
        context.
    supabaseJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Supabase-issued session JWT; required for org, invite, and key
        management.

````

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