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

# List Rules API

> Retrieve Breezing automation rules with cursor pagination and search to review the conditions and actions used in crypto accounting workflows.



## OpenAPI

````yaml GET /rules
openapi: 3.1.0
info:
  title: Breezing Public API
  version: 1.0.0
  description: >-
    Crypto accounting API for programmatic access and AI agents. Authenticate
    with an API key using the Authorization header: `Bearer brz_...`
servers:
  - url: https://api.breezing.io/v1
security:
  - BearerAuth: []
paths:
  /rules:
    get:
      tags:
        - Rules
      summary: List rules
      description: >-
        List automation rules for the company. Each rule has conditions (filter
        spec) and actions (what to set on matching transactions). Use POST
        /rules/apply to retroactively apply rules to existing transactions.
      parameters:
        - schema:
            type: string
            description: >-
              Organization ID. Use GET /v1/companies to discover available
              org/company pairs.
            example: '1'
          required: true
          description: >-
            Organization ID. Use GET /v1/companies to discover available
            org/company pairs.
          name: orgId
          in: query
        - schema:
            type: string
            description: >-
              Company ID. Use GET /v1/companies to discover available companies
              and their access levels.
            example: '1'
          required: true
          description: >-
            Company ID. Use GET /v1/companies to discover available companies
            and their access levels.
          name: companyId
          in: query
        - schema:
            type: string
            description: Rule ID to start after (cursor pagination, ordered id desc).
          required: false
          description: Rule ID to start after (cursor pagination, ordered id desc).
          name: cursor
          in: query
        - schema:
            type: string
            default: '50'
            description: Number of rules to return (1-100, default 50)
          required: false
          description: Number of rules to return (1-100, default 50)
          name: limit
          in: query
        - schema:
            type: string
            description: Filter by rule name (prefix match, case-insensitive).
          required: false
          description: Filter by rule name (prefix match, case-insensitive).
          name: search
          in: query
      responses:
        '200':
          description: Rules retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Rule'
                  pagination:
                    type: object
                    properties:
                      limit:
                        type: integer
                      cursor:
                        type: integer
                        nullable: true
                      hasMore:
                        type: boolean
                    required:
                      - limit
                      - cursor
                      - hasMore
                required:
                  - success
                  - data
                  - pagination
        '400':
          description: Invalid query parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: >-
            API key has no access to this company, has read-only access where
            write was required, or the company subscription is inactive
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
      security:
        - BearerAuth: []
components:
  schemas:
    Rule:
      type: object
      properties:
        id:
          type: number
        name:
          type: string
        description:
          type: string
          nullable: true
        conditions:
          nullable: true
          description: >-
            Opaque JSON object describing the conditions matching transactions
            must satisfy. Mirror the shape used by Breezing's rule builder UI;
            the runtime resolves it with `getConditions`. Example fields include
            wallet, token, direction, counterparty, amount range.
        actions:
          type: array
          items:
            nullable: true
          description: >-
            Opaque JSON array describing what to set on matching transactions
            (e.g. account code, asset account, status).
        conditionsLength:
          type: number
        actionsLength:
          type: number
        isActive:
          type: boolean
          nullable: true
        order:
          type: integer
          minimum: 0
          description: >-
            Apply priority. 0 is the highest priority; rules apply in ascending
            order.
        orgId:
          type: number
        companyId:
          type: number
        createdAt:
          type: number
        updatedAt:
          type: number
      required:
        - id
        - name
        - description
        - actions
        - conditionsLength
        - actionsLength
        - isActive
        - order
        - orgId
        - companyId
        - createdAt
        - updatedAt

````