> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Automation runs

> List run history for a rule the caller can manage.

## Restrictions

| Aspect      | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |
| Permissions | Valid `app_key`; caller must manage the target rule           |

## Usage

* Run history is visible only when the caller can manage the rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.


## OpenAPI

````yaml /api-reference/safari.openapi.en.json post /safari/automation/run/list
openapi: 3.1.0
info:
  title: Flashduty Open API
  description: >-
    Public HTTP API for the Flashduty AI SRE platform — skills, MCP servers
    (connectors), A2A agents, and sessions. Every operation is authenticated
    with an `app_key` query parameter issued from the Flashduty console.
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: AI SRE/Skills
    description: AI SRE agent skill management.
  - name: AI SRE/MCP servers
    description: MCP (Model Context Protocol) server management.
  - name: AI SRE/A2A agents
    description: A2A (agent-to-agent) remote agent management.
  - name: AI SRE/Sessions
    description: AI SRE agent session history — list, inspect, and export transcripts.
  - name: AI SRE/Automations
  - name: AI SRE/Knowledge
  - name: AI SRE/Artifacts
    description: >-
      AI SRE artifact gallery — publish, browse, and publicly share
      agent-produced files.
paths:
  /safari/automation/run/list:
    post:
      tags:
        - AI SRE/Automations
      summary: List Automation runs
      description: List run history for a rule the caller can manage.
      operationId: automation-run-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationRunListRequest'
            example:
              rule_id: arule_7NnLzY2Qp8xS4kUaV3mR6b
              limit: 20
              trigger_kind: schedule
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AutomationRunListResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  total: 1
                  runs:
                    - run_id: trun_5oDvqiG64uur6sBNsTc4u
                      session_id: sess_f8oDvqiG64uur6sBNsTc4u
                      session_name: Weekly on-call review
                      kind: automation_rule
                      account_id: 10023
                      rule_id: arule_7NnLzY2Qp8xS4kUaV3mR6b
                      trigger_kind: schedule
                      occurrence_key: atrig_6aKp3wT9mQ2xVc8bR1nY7z:1780630800000
                      status: succeeded
                      attempts: 1
                      started_at: 1780630800000
                      completed_at: 1780630923456
                      duration_ms: 123456
                      error_code: ''
                      error_message: ''
                      stats_json: {}
                      result_json:
                        session_id: sess_f8oDvqiG64uur6sBNsTc4u
                      created_at: 1780630800000
                      updated_at: 1780630923456
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - AppKeyAuth: []
components:
  schemas:
    AutomationRunListRequest:
      type: object
      properties:
        rule_id:
          type: string
          description: >-
            Target rule ID, from the list returned by `POST
            /safari/automation/rule/list`.
        p:
          type: integer
          default: 1
          description: Page number, 1-based.
        limit:
          type: integer
          description: Page size.
          default: 20
        status:
          type: string
          enum:
            - queued
            - running
            - retrying
            - succeeded
            - partial
            - failed
            - skipped
            - abandoned
            - blocked
          description: >-
            Run status filter: `queued`, `running`, `retrying`, `succeeded`,
            `partial` (partially succeeded), `failed`, `skipped` (e.g. rule or
            trigger no longer valid), `abandoned` (stale run terminated by the
            system), `blocked` (terminal; produced output but a connector is
            waiting on a human authorization); omit for no filter.
        trigger_kind:
          type: string
          enum:
            - schedule
            - debug
            - manual
            - http_post
            - oncall_incident
          description: >-
            Trigger source filter: `schedule` cron trigger, `debug` debug run,
            `manual` manual run, `http_post` HTTP POST trigger,
            `oncall_incident` on-call incident trigger; omit for no filter.
        started_after_ms:
          type: integer
          format: int64
          description: >-
            Start-time lower bound, Unix milliseconds. Values below the 180-day
            run-history retention floor are clamped to it (that floor is also
            the default when omitted).
          minimum: 0
        started_before_ms:
          type: integer
          format: int64
          description: >-
            Start-time upper bound, Unix milliseconds. Must be greater than or
            equal to the effective `started_after_ms`; a value below the
            retention floor yields an empty result.
          minimum: 0
      required:
        - rule_id
    ResponseEnvelope:
      type: object
      description: >-
        Standard response envelope used by every Flashduty public API. On
        success `data` contains the endpoint-specific payload and `error` is
        absent. On failure `error` is present and `data` is absent. `request_id`
        is always present and is also mirrored in the `Flashcat-Request-Id`
        response header.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
    AutomationRunListResponse:
      type: object
      properties:
        total:
          type: integer
          format: int64
          description: Total count.
        runs:
          type: array
          items:
            $ref: '#/components/schemas/AutomationRunItem'
          description: >-
            Array of run records for the given `rule_id`, filtered by the
            request's status/trigger-kind/time-range and paginated.
      required:
        - total
        - runs
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    AutomationRunItem:
      type: object
      properties:
        run_id:
          type: string
          description: Run ID.
        session_id:
          type: string
          description: >-
            Session created for this run, extracted from `result_json`. Omitted
            when the run has not (yet) started a session.
        session_name:
          type: string
          description: >-
            Display name of the run's session, stamped via a batch lookup.
            Omitted when empty or when the lookup fails.
        kind:
          type: string
          description: Run kind; runs listed for a rule are always `automation_rule`.
          enum:
            - automation_rule
        account_id:
          type: integer
          format: int64
          description: Account ID.
        rule_id:
          type: string
          description: Rule ID.
        trigger_kind:
          type: string
          enum:
            - schedule
            - debug
            - manual
            - http_post
            - oncall_incident
          description: >-
            Trigger kind. One of:

            | Value | Meaning |

            | --- | --- |

            | `schedule` | Fired by the rule's schedule trigger |

            | `debug` | Debug run (reserved; current rule runs never carry this
            kind) |

            | `manual` | Triggered manually by a user |

            | `http_post` | Fired via the rule's HTTP POST webhook |

            | `oncall_incident` | Fired by an on-call incident event |
        occurrence_key:
          type: string
          description: Idempotency key for this occurrence.
        status:
          type: string
          enum:
            - queued
            - running
            - retrying
            - succeeded
            - partial
            - failed
            - skipped
            - abandoned
            - blocked
          description: >-
            Run status. One of (the first three are in-flight, the rest
            terminal):

            | Value | Meaning |

            | --- | --- |

            | `queued` | Enqueued, waiting for a worker |

            | `running` | Executing |

            | `retrying` | An attempt failed and a retry is scheduled |

            | `succeeded` | Completed successfully |

            | `partial` | Partially succeeded (currently only produced by
            memory-consolidation runs; rule runs never reach it) |

            | `failed` | Terminal failure, no further retries |

            | `skipped` | Not executed (e.g. grace period expired, trigger or
            rule invalid); the reason is kept on the run record |

            | `abandoned` | Still in-flight past the stale threshold and swept
            as never-completed (e.g. worker died) |

            | `blocked` | Terminal: the run produced output but ended with a
            connector waiting on a human to complete authorization (distinct
            from `failed`) |
        attempts:
          type: integer
          description: Attempt count.
        started_at:
          type: integer
          format: int64
          description: Start time, Unix milliseconds.
        completed_at:
          type: integer
          format: int64
          description: Completion time, Unix milliseconds. 0 means not completed.
        duration_ms:
          type: integer
          format: int64
          description: Duration in milliseconds.
        error_code:
          type: string
          description: Error code; empty when the run did not fail.
        error_message:
          type: string
          description: Error message; empty when the run did not fail.
        stats_json:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Raw run statistics JSON; null when empty.
        result_json:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: >-
            Raw run result JSON (carries the run's `session_id` once started);
            null when empty.
        created_at:
          type: integer
          format: int64
          description: Creation time, Unix milliseconds.
        updated_at:
          type: integer
          format: int64
          description: Last update time, Unix milliseconds.
      required:
        - run_id
        - kind
        - account_id
        - rule_id
        - trigger_kind
        - occurrence_key
        - status
        - attempts
        - started_at
        - completed_at
        - duration_ms
        - created_at
        - updated_at
        - error_code
        - error_message
        - stats_json
        - result_json
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these stable wire strings. HTTP status is informational — the
        authoritative signal is the enum value.


        | Code | HTTP | Meaning |

        |---|---|---|

        | `OK` | 200 | Reserved — not returned on real errors. |

        | `InvalidParameter` | 400 | A required parameter is missing or failed
        validation. |

        | `BadRequest` | 400 | Generic 400 used when no more specific code fits.
        |

        | `InvalidContentType` | 400 | The `Content-Type` header is not
        `application/json`. |

        | `ResourceNotFound` | 400 | The referenced resource does not exist.
        Note: returned as HTTP 400, not 404 (historical choice). |

        | `NoLicense` | 400 | The feature is license-gated and no active license
        was found. |

        | `ReferenceExist` | 400 | Deletion blocked — other entities still
        reference this resource. |

        | `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |

        | `BalanceNotEnough` | 402 | Billing-gated operation with insufficient
        account balance. |

        | `AccessDenied` | 403 | Authenticated but lacking the permission
        required for this operation. |

        | `RouteNotFound` | 404 | The request URL path is not a known route. |

        | `MethodNotAllowed` | 405 | The HTTP method is not allowed on this
        otherwise-known path. |

        | `UndonedOrderExist` | 409 | An outstanding billing order blocks this
        new one. Wait and retry. |

        | `RequestLocked` | 423 | Operation temporarily locked due to repeated
        failures. |

        | `EntityTooLarge` | 413 | Request body exceeds the configured max size.
        |

        | `RequestTooFrequently` | 429 | Rate limit hit — API-global,
        per-account, or per-integration. |

        | `RequestVerifyRequired` | 428 | Second-factor verification required
        but not supplied. |

        | `DangerousOperation` | 428 | High-risk operation requires MFA
        verification. |

        | `InternalError` | 500 | Unhandled server-side error. Include
        `request_id` in the bug report. |

        | `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try
        again later. |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: Reserved — not returned on real errors.
        InvalidParameter: A required parameter is missing or failed validation.
        BadRequest: Generic 400 used when no more specific code fits.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        NoLicense: The feature is license-gated and no active license was found.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        AccessDenied: Authenticated but lacking the permission required for this operation.
        RouteNotFound: The request URL path is not a known route.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
        RequestLocked: Operation temporarily locked due to repeated failures.
        EntityTooLarge: Request body exceeds the configured max size.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        DangerousOperation: High-risk operation requires MFA verification.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
      example: InvalidParameter
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              summary: Missing required parameter
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter skill_id is not valid.
    Unauthorized:
      description: Missing or invalid app_key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    Forbidden:
      description: The app_key is valid but lacks permission for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            accessDenied:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    TooManyRequests:
      description: Rate limit hit. Either the global API limit or a per-account limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        App key issued from the Flashduty console. Required on every public API
        call. Keep it secret — it grants the same access as the owning account.

````