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

# List background run attempts



## OpenAPI

````yaml /docs/reference/openapi.json get /background/runs/{run_id}/attempts
openapi: 3.1.0
info:
  description: >-
    The HTTP API of an agent served with `omniserve run --agent agent.py`: runs,
    approvals, budgets, background tasks, sessions and the evidence of every
    run.
  title: OmniServe
  version: latest
servers:
  - description: omniserve run, locally
    url: http://localhost:8000
security: []
paths:
  /background/runs/{run_id}/attempts:
    get:
      tags:
        - Background
      summary: List background run attempts
      operationId: list_background_run_attempts_background_runs__run_id__attempts_get
      parameters:
        - in: path
          name: run_id
          required: true
          schema:
            title: Run Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/BackgroundAttempt'
                title: >-
                  Response List Background Run Attempts Background Runs  Run Id 
                  Attempts Get
                type: array
          description: Successful Response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
          description: Service Unavailable
components:
  schemas:
    BackgroundAttempt:
      additionalProperties: false
      properties:
        attempt_id:
          title: Attempt Id
          type: string
        attempt_number:
          title: Attempt Number
          type: integer
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        finished_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Finished At
        lease_token:
          title: Lease Token
          type: string
        reason:
          $ref: '#/components/schemas/AttemptReason'
          default: initial
        retry_delay_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retry Delay Seconds
        run_id:
          title: Run Id
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          $ref: '#/components/schemas/AttemptStatus'
          default: running
        worker_id:
          title: Worker Id
          type: string
      required:
        - run_id
        - attempt_number
        - worker_id
        - lease_token
      title: BackgroundAttempt
      type: object
    HttpErrorResponse:
      description: Response shape produced by FastAPI HTTPException.
      properties:
        detail:
          description: Error detail
          title: Detail
      required:
        - detail
      title: HttpErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AttemptReason:
      enum:
        - initial
        - retry
        - recovery
        - lease_expired
      title: AttemptReason
      type: string
    AttemptStatus:
      enum:
        - running
        - completed
        - failed
        - timeout
        - cancelled
        - interrupted
      title: AttemptStatus
      type: string
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````