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

# Get Rule API

> Retrieve a single Breezing automation rule by ID to inspect conditions, actions, and active status for crypto accounting categorization.



## OpenAPI

````yaml GET /rules/{id}
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/{id}:
    get:
      tags:
        - Rules
      summary: Get a single rule
      description: Get a single rule by ID. Returns 404 if not found.
      parameters:
        - schema:
            type: string
            description: Rule ID
            example: '1'
          required: true
          description: Rule ID
          name: id
          in: path
        - 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
      responses:
        '200':
          description: Rule retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/Rule'
                required:
                  - success
                  - data
        '400':
          description: Invalid rule ID
          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
        '404':
          description: Rule not found
          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

````