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

# Retrieve a rule



## OpenAPI

````yaml /openapi.yaml get /api/v1/rules/{id}
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/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: Rule ID
        schema:
          type: string
    get:
      tags:
        - Rules
      summary: Retrieve a rule
      responses:
        '200':
          description: rule retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResponse'
        '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'
        '404':
          description: rule not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    RuleResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Rule'
    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.

````