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

# Test Custom Rule



## OpenAPI

````yaml /api-reference/openapi.json post /api/custom-rules/test
openapi: 3.1.0
info:
  title: Blindsight API
  version: 0.1.0
servers: []
security: []
paths:
  /api/custom-rules/test:
    post:
      tags:
        - custom-rules
      summary: Test Custom Rule
      operationId: test_custom_rule_api_custom_rules_test_post
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: blindsight_session
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Blindsight Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRuleTestRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRuleTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CustomRuleTestRequest:
      properties:
        pattern:
          type: string
          title: Pattern
        flags:
          items:
            type: string
          type: array
          title: Flags
          default: []
        sample:
          type: string
          title: Sample
      type: object
      required:
        - pattern
        - sample
      title: CustomRuleTestRequest
    CustomRuleTestResponse:
      properties:
        matches:
          items:
            $ref: '#/components/schemas/CustomRuleTestMatch'
          type: array
          title: Matches
          default: []
        count:
          type: integer
          title: Count
          default: 0
      type: object
      title: CustomRuleTestResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomRuleTestMatch:
      properties:
        match:
          type: string
          title: Match
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
      type: object
      required:
        - match
        - start
        - end
      title: CustomRuleTestMatch
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````