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

# List Rules

> Use this endpoint to list validation rules with cursor-based pagination and optional filters. DELETED rules are not returned in listings.



## OpenAPI

````yaml /en/openapi/v3-current/tracer.yaml get /v1/rules
openapi: 3.1.0
info:
  title: Tracer API
  description: >-
    Complete API reference for Tracer services including transaction validation,
    rules management, spending limits, and audit events for SOX/GLBA compliance.
  version: 1.0.0
servers:
  - url: https://tracer.lerian.io
security: []
tags:
  - name: Health API
    description: >-
      Health check endpoints for liveness and readiness probes. These endpoints
      do not require authentication.
  - name: Validations API
    description: >-
      Transaction validation endpoints. Performance target is under 80ms (p99).
      Validations are not idempotent.
  - name: Rules API
    description: >-
      Validation rule management endpoints. Rules use CEL (Common Expression
      Language) expressions.
  - name: Limits API
    description: >-
      Spending limit management endpoints. Limits control transaction amounts by
      scope and period.
  - name: Audit Events API
    description: >-
      Audit trail endpoints for SOX/GLBA compliance. All validation decisions
      and configuration changes are recorded.
paths:
  /v1/rules:
    get:
      tags:
        - Rules API
      summary: List Rules
      description: >-
        Use this endpoint to list validation rules with cursor-based pagination
        and optional filters. DELETED rules are not returned in listings.
      operationId: listRules
      parameters:
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XApiKey'
        - $ref: '#/components/parameters/XRequestId'
        - name: limit
          in: query
          description: >-
            The maximum number of items to include in the response. Default: 10,
            Max: 100
          required: false
          example: 10
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
        - name: cursor
          in: query
          description: Pagination cursor from previous response.
          required: false
          schema:
            type: string
        - name: name
          in: query
          description: Filter by name (case-insensitive partial match).
          required: false
          schema:
            type: string
            maxLength: 255
        - name: status
          in: query
          description: >-
            Filter by status (DRAFT, ACTIVE, INACTIVE). DELETED rules are not
            listable.
          required: false
          schema:
            type: string
            enum:
              - DRAFT
              - ACTIVE
              - INACTIVE
        - name: action
          in: query
          description: Filter by action (ALLOW, DENY, REVIEW).
          required: false
          schema:
            type: string
            enum:
              - ALLOW
              - DENY
              - REVIEW
        - name: sortBy
          in: query
          description: The field used to sort the results.
          required: false
          schema:
            type: string
            enum:
              - createdAt
              - name
            default: createdAt
        - name: sortOrder
          in: query
          description: The order used to sort the results.
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: DESC
      responses:
        '200':
          description: >-
            Indicates that the request was successful and the response contains
            the expected data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRulesResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0001:
                  $ref: '#/components/examples/Error0001'
                Error0006:
                  $ref: '#/components/examples/Error0006'
                Error0040:
                  $ref: '#/components/examples/Error0040'
                Error0041:
                  $ref: '#/components/examples/Error0041'
                Error0042:
                  $ref: '#/components/examples/Error0042'
                Error0043:
                  $ref: '#/components/examples/Error0043'
                Error0044:
                  $ref: '#/components/examples/Error0044'
                Error0045:
                  $ref: '#/components/examples/Error0045'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0010:
                  $ref: '#/components/examples/Error0010'
                Error0011:
                  $ref: '#/components/examples/Error0011'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0004:
                  $ref: '#/components/examples/Error0004'
      security: []
components:
  parameters:
    ContentType:
      name: Content-Type
      in: header
      description: The type of media of the resource. Must be `application/json`.
      required: true
      example: application/json
      schema:
        type: string
    XApiKey:
      name: X-API-Key
      in: header
      description: >-
        The API Key for authentication. **This header is required for all
        endpoints except health checks**.
      required: true
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: A unique identifier used to trace and track each request.
      required: false
      example: 019c96a0-10ce-75fc-a273-dc799079a99c
      schema:
        type: string
        format: uuid
  schemas:
    ListRulesResponse:
      type: object
      description: Paginated list of rules.
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
          description: List of rule records.
        hasMore:
          type: boolean
          description: Whether there are more results available.
        nextCursor:
          type:
            - string
            - 'null'
          description: Cursor for fetching the next page. Null if no more results.
    ErrorFormat:
      type: object
      description: The response message error.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
        fields:
          type: object
          additionalProperties: true
          description: Additional information about the fields that caused the error.
    Rule:
      type: object
      description: Validation rule.
      properties:
        ruleId:
          type: string
          format: uuid
          description: Unique identifier for the rule.
        name:
          type: string
          description: Human-readable rule name (globally unique).
          maxLength: 255
        description:
          type: string
          description: Rule purpose and logic explanation.
          maxLength: 1000
        expression:
          type: string
          description: CEL expression that must evaluate to boolean.
          maxLength: 5000
        action:
          type: string
          enum:
            - ALLOW
            - DENY
            - REVIEW
          description: Action taken when rule expression evaluates to true.
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/Scope'
          description: Scopes that determine which transactions this rule applies to.
        status:
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - INACTIVE
            - DELETED
          description: Rule lifecycle status.
        createdAt:
          type: string
          format: date-time
          description: When the rule was created.
        updatedAt:
          type: string
          format: date-time
          description: When the rule was last modified.
        activatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When rule was last activated (null if never activated).
        deactivatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When rule was last deactivated (null if never deactivated).
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When rule was deleted (null if not deleted).
    Scope:
      type: object
      description: Scope definition for rules and limits. At least one field must be set.
      properties:
        segmentId:
          type: string
          format: uuid
          description: Apply to transactions from this segment.
        portfolioId:
          type: string
          format: uuid
          description: Apply to transactions from this portfolio.
        accountId:
          type: string
          format: uuid
          description: Apply to transactions from this specific account.
        merchantId:
          type: string
          format: uuid
          description: Apply to transactions to this specific merchant.
        transactionType:
          type: string
          enum:
            - CARD
            - WIRE
            - PIX
            - CRYPTO
          description: Apply to this transaction type only.
        subType:
          type: string
          maxLength: 50
          description: Apply to this transaction subType only.
  examples:
    Error0001:
      summary: Generic Validation Error
      value:
        code: TRC-0001
        title: Validation Error
        message: >-
          Field validation failed. Please verify the provided data and try
          again.
    Error0006:
      summary: Invalid Query Parameters
      value:
        code: TRC-0006
        title: Invalid Query Parameters
        message: >-
          One or more query parameters are invalid. Please verify the parameters
          and try again.
    Error0040:
      summary: Limit Exceeds Maximum
      value:
        code: TRC-0040
        title: Limit Exceeds Maximum
        message: >-
          The limit parameter exceeds the maximum allowed value. Please reduce
          the limit and try again.
    Error0041:
      summary: Limit Below Minimum
      value:
        code: TRC-0041
        title: Limit Below Minimum
        message: >-
          The limit parameter must be at least 1. Please provide a valid limit
          and try again.
    Error0042:
      summary: Invalid Sort Order
      value:
        code: TRC-0042
        title: Invalid Sort Order
        message: Sort order must be ASC or DESC. Please provide a valid value.
    Error0043:
      summary: Invalid Sort Column
      value:
        code: TRC-0043
        title: Invalid Sort Column
        message: >-
          The specified sort column is not supported. Please check the allowed
          fields.
    Error0044:
      summary: Invalid Pagination Cursor
      value:
        code: TRC-0044
        title: Invalid Pagination Cursor
        message: >-
          The provided pagination cursor is invalid or expired. Please start a
          new query without a cursor.
    Error0045:
      summary: Sort Parameters Locked
      value:
        code: TRC-0045
        title: Sort Parameters Locked
        message: >-
          Cannot change sortBy or sortOrder when using a pagination cursor.
          Please start a new query to change sort parameters.
    Error0010:
      summary: API Key Missing
      value:
        code: TRC-0010
        title: API Key Missing
        message: >-
          A valid API Key must be provided in the X-API-Key header. Please
          include your API Key and try again.
    Error0011:
      summary: Invalid API Key
      value:
        code: TRC-0011
        title: Invalid API Key
        message: >-
          The provided API Key is invalid or expired. Please provide a valid API
          Key and try again.
    Error0004:
      summary: Internal Server Error
      value:
        code: TRC-0004
        title: Internal Server Error
        message: >-
          An unexpected error occurred. Please try again later or contact
          support if the issue persists.

````