> ## 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 rules

> List Automation rules visible to the caller.

## Restrictions

| Aspect      | Value                                                               |
| ----------- | ------------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account       |
| Permissions | Valid `app_key`; results are filtered to the caller's visible scope |

## Usage

* `all` returns your personal rules plus team rules you can access.
* Account admins see all team rules in list results, but not other users' personal rules.
* `team_ids` narrows the visible set and never expands access.


## OpenAPI

````yaml /api-reference/safari.openapi.en.json post /safari/automation/rule/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/rule/list:
    post:
      tags:
        - AI SRE/Automations
      summary: List Automation rules
      description: List Automation rules visible to the caller.
      operationId: automation-rule-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationRuleListRequest'
            example:
              scope: all
              limit: 20
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AutomationRuleListResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  total: 1
                  rules:
                    - rule_id: arule_7NnLzY2Qp8xS4kUaV3mR6b
                      account_id: 10023
                      team_id: 123
                      owner_id: 80011
                      name: Weekly on-call review
                      enabled: true
                      run_scope: team
                      cron_expr: 0 9 * * 1
                      timezone: Asia/Shanghai
                      prompt: Summarize last week's alert noise and escalation load.
                      environment_kind: ''
                      environment_id: ''
                      schedule_trigger_id: atrig_6aKp3wT9mQ2xVc8bR1nY7z
                      schedule_trigger_enabled: true
                      http_post_trigger_id: atrig_2bLq4xT8mP1sWd9cN3rF6y
                      http_post_trigger_url: >-
                        /safari/automation/triggers/atrig_2bLq4xT8mP1sWd9cN3rF6y/fire
                      http_post_trigger_enabled: true
                      can_edit: true
                      created_at: 1780367971228
                      updated_at: 1780367971228
                      schedule_next_fire_at_ms: 1780630800000
                      oncall_incident_trigger_id: atrig_9cVb2mN7qKs4dEa8T1rY5p
                      oncall_incident_trigger_enabled: true
                      oncall_incident_channel_ids:
                        - 456
                      oncall_incident_severities:
                        - Critical
                        - Warning
        '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:
    AutomationRuleListRequest:
      type: object
      description: >-
        List Automation rules visible to the caller. `all` includes the caller's
        personal rules plus accessible team rules; account admins do not see
        other users' personal rules in list results.
      properties:
        p:
          type: integer
          default: 1
          description: Page number, 1-based.
        limit:
          type: integer
          description: Page size.
          default: 20
        scope:
          type: string
          enum:
            - all
            - personal
            - team
          description: >-
            Scope filter: `all` (own personal + accessible team rules),
            `personal`, or `team`; default `all`.
        team_ids:
          type: array
          items:
            type: integer
            format: int64
          description: >-
            Filter to these team IDs; this narrows results and does not expand
            access.
        include_person:
          type:
            - boolean
            - 'null'
          description: >-
            Compatibility field; when scope is empty and this is false, behaves
            like team scope.
        enabled:
          type:
            - boolean
            - 'null'
          description: >-
            Filter by enabled state: `true` returns only enabled rules, `false`
            only disabled; omit or pass null for no filter.
        keyword:
          type: string
          maxLength: 64
          description: Filter by name keyword.
    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
    AutomationRuleListResponse:
      type: object
      properties:
        total:
          type: integer
          format: int64
          description: Total count.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/AutomationRuleItem'
          description: >-
            Array of automation rules for the current page, used with `total`
            for pagination.
      required:
        - total
        - rules
    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
    AutomationRuleItem:
      type: object
      description: Automation rule.
      properties:
        rule_id:
          type: string
          description: Rule ID.
        account_id:
          type: integer
          format: int64
          description: Account ID.
        team_id:
          type: integer
          format: int64
          description: Scope team ID; 0 means personal rule.
        owner_id:
          type: integer
          format: int64
          description: Creator person ID.
        name:
          type: string
          description: Rule name.
        enabled:
          type: boolean
          description: Whether the rule is enabled.
        run_scope:
          type: string
          enum:
            - person
            - team
          description: >-
            Hidden session run scope. One of: `person` (personal rule,
            team_id=0, runs as the creator; disabled when the creator leaves the
            account), `team` (team rule, team_id>0, owned by the team and shared
            with its members; survives the creator leaving). Derived from the
            rule's team_id.
        cron_expr:
          type: string
          description: Normalized 5-field cron expression.
        timezone:
          type: string
          description: >-
            IANA timezone `cron_expr` is evaluated in. Always populated for
            rules created after this field shipped; empty on legacy rows created
            before it, which still resolve to UTC when scheduled.
        prompt:
          type: string
          description: Task prompt.
        environment_kind:
          type: string
          description: >-
            Runtime environment kind. Omit or send an empty value for automatic
            selection. One of: `cloud` (platform-hosted cloud sandbox), `byoc`
            (self-hosted BYOC runner in the account); an empty value means
            automatic selection (prefers an online BYOC runner, falls back to
            the cloud sandbox).
          enum:
            - ''
            - cloud
            - byoc
        environment_id:
          type: string
          description: BYOC Runner ID.
        schedule_trigger_id:
          type: string
          description: Schedule trigger ID. Omitted if the rule has no schedule trigger.
        schedule_trigger_enabled:
          type: boolean
          description: Whether the schedule trigger is enabled.
        http_post_trigger_id:
          type: string
          description: >-
            HTTP POST trigger ID. Omitted when the rule has no HTTP POST
            trigger.
        http_post_trigger_url:
          type: string
          description: >-
            HTTP POST trigger path. Omitted when the rule has no HTTP POST
            trigger.
        http_post_trigger_enabled:
          type: boolean
          description: Whether the HTTP POST trigger is enabled.
        oncall_incident_trigger_id:
          type: string
          description: >-
            On-call incident trigger ID. Omitted when the rule has no On-call
            incident trigger.
        oncall_incident_trigger_enabled:
          type: boolean
          description: Whether the On-call incident trigger is enabled.
        oncall_incident_channel_ids:
          type: array
          items:
            type: integer
            format: int64
            minimum: 1
          description: >-
            On-call integration IDs to watch. Creating or enabling this trigger
            requires at least one valid ID. Omitted when no On-call incident
            trigger is configured.
        oncall_incident_severities:
          type: array
          items:
            type: string
            enum:
              - Critical
              - Warning
              - Info
          description: >-
            Incident severities to watch. Supported values are Critical,
            Warning, and Info; creating or enabling this trigger requires at
            least one value. Omitted when no On-call incident trigger is
            configured.
        http_post_token:
          type: string
          description: >-
            HTTP POST trigger token. Returned only on create or token rotation;
            save it immediately.
        can_edit:
          type: boolean
          description: >-
            True when the caller can manage this rule: the personal rule owner;
            for team rules, an account admin or a member of the rule's team.
        created_at:
          type: integer
          format: int64
          description: Creation time, Unix milliseconds.
        updated_at:
          type: integer
          format: int64
          description: Last update time, Unix milliseconds.
        schedule_next_fire_at_ms:
          type: integer
          format: int64
          description: >-
            Next scheduled fire time, Unix milliseconds. 0 means no future
            scheduled fire is available.
      required:
        - rule_id
        - account_id
        - team_id
        - owner_id
        - name
        - enabled
        - run_scope
        - cron_expr
        - timezone
        - prompt
        - environment_kind
        - environment_id
        - schedule_trigger_enabled
        - http_post_trigger_enabled
        - can_edit
        - created_at
        - updated_at
        - schedule_next_fire_at_ms
        - oncall_incident_trigger_enabled
    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.

````