> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787375856936.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List rules



## OpenAPI

````yaml /openapi.yaml get /api/v1/rules
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation generated from executable request specs.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/rules:
    get:
      tags:
        - Rules
      summary: List rules
      parameters:
        - name: page
          in: query
          required: false
          description: 'Page number (default: 1)'
          schema:
            type: integer
        - name: per_page
          in: query
          required: false
          description: 'Items per page (default: 25, max: 100)'
          schema:
            type: integer
        - name: resource_type
          in: query
          required: false
          description: Filter by rule resource type
          schema:
            type: string
            enum:
              - transaction
        - name: active
          in: query
          required: false
          description: Filter by active status
          schema:
            type: boolean
      responses:
        '200':
          description: rules listed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleCollection'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: forbidden - requires read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: unsupported resource type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    RuleCollection:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
        meta:
          type: object
          required:
            - current_page
            - total_pages
            - total_count
            - per_page
          properties:
            current_page:
              type: integer
            next_page:
              type: integer
              nullable: true
            prev_page:
              type: integer
              nullable: true
            total_pages:
              type: integer
            total_count:
              type: integer
            per_page:
              type: integer
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
        errors:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Validation error messages (alternative to details used by trades,
            valuations, etc.)
    Rule:
      type: object
      required:
        - id
        - resource_type
        - active
        - conditions
        - actions
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        resource_type:
          type: string
          enum:
            - transaction
        active:
          type: boolean
        effective_date:
          type: string
          format: date
          nullable: true
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/RuleAction'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    RuleCondition:
      type: object
      required:
        - id
        - condition_type
        - operator
        - sub_conditions
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        condition_type:
          type: string
        operator:
          type: string
        value:
          type: string
          nullable: true
        sub_conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    RuleAction:
      type: object
      required:
        - id
        - action_type
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        action_type:
          type: string
        value:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````