---
updatedAt: 2026-05-20T16:30:20.000Z
---

Fetch the complete documentation index at: https://docs.blockdaemon.com/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Get all Rules

Returns all rules in the system that the user has access to.

<Callout icon="💡" theme="default">
  ### **Compute Unit Value**: `10` (fixed)
</Callout>

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Event Streaming API",
    "description": "Creates and manages config for event streams",
    "contact": {
      "name": "Blockdaemon",
      "email": "info@blockdaemon.com",
      "url": "https://blockdaemon.com"
    },
    "x-logo": {
      "url": "https://storage.googleapis.com/blockdaemon-app-static-images/marketing/PNG/dark-logo.png",
      "altText": "Blockdaemon logo"
    }
  },
  "servers": [
    {
      "url": "https://svc.blockdaemon.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyAuthHeader": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyAuthHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Unlock higher TPS - Create your own API key in the [Blockdaemon App](https://app.blockdaemon.com).\n",
        "x-default": "2go1YqUcuAr4WZ2-3WgSD3c7qpatZqQuNWhTVBldKZnTSUtw"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Opaque",
        "description": "[Legacy Auth] Unlock higher TPS - Create your own API key in the [Blockdaemon App](https://app.blockdaemon.com).\n",
        "x-default": "2go1YqUcuAr4WZ2-3WgSD3c7qpatZqQuNWhTVBldKZnTSUtw"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "x-go-type": "ApiError",
        "x-go-name": "ApiError",
        "required": [
          "message",
          "type",
          "code",
          "status",
          "timestamp"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "HTTP error type",
            "example": "bad-request"
          },
          "code": {
            "type": "integer",
            "description": "Numeric error code",
            "example": 16384
          },
          "status": {
            "type": "integer",
            "description": "HTTP status of the error",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Long error description",
            "example": "Oops theres been an internal error handling"
          },
          "timestamp": {
            "type": "string",
            "description": "Long error description",
            "example": "Oops theres been an internal error handling"
          }
        }
      },
      "ID": {
        "description": "An ID representing a specific template.",
        "type": "string",
        "format": "uuid",
        "x-go-type": "myuuid.UUID",
        "x-go-type-import": {
          "name": "myuuid",
          "path": "github.com/google/uuid"
        }
      },
      "PreDefinedTemplate": {
        "title": "Predefined Template",
        "description": "Available predefined templates that can be used for event formatting",
        "type": "string",
        "enum": [
          "UNIFIED_V1",
          "UNIFIED_V1_RAW",
          "ALL_DATA",
          "INPUT_EMAIL",
          "OUTPUT_EMAIL",
          "TX_EMAIL"
        ]
      },
      "Rule": {
        "type": "object",
        "required": [
          "name",
          "protocol",
          "network",
          "type",
          "target",
          "condition_type",
          "condition"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "x-go-type": "myuuid.UUID",
            "x-go-type-import": {
              "name": "myuuid",
              "path": "github.com/google/uuid"
            }
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "protocol": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "safeDistance": {
            "type": "integer"
          },
          "safeTimeout": {
            "type": "integer"
          },
          "condition_type": {
            "type": "string",
            "default": "antlr",
            "enum": [
              "antlr",
              "match_var"
            ]
          },
          "condition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MatchVars"
              },
              {
                "$ref": "#/components/schemas/Antlr"
              }
            ]
          },
          "target": {
            "type": "string",
            "format": "uuid",
            "x-go-type": "myuuid.UUID",
            "x-go-type-import": {
              "name": "myuuid",
              "path": "github.com/google/uuid"
            }
          },
          "template": {
            "$ref": "#/components/schemas/RuleTemplateRef"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Antlr": {
        "type": "string",
        "description": "A rule expression to define filtering or matching logic. For example, `height > 0` filters out items where the height is not greater than zero.",
        "example": "height > 0"
      },
      "MatchVars": {
        "type": "array",
        "description": "A list of variables used in a matching rule. Each item in the array must reference a valid MatchVar object.",
        "items": {
          "$ref": "#/components/schemas/MatchVar"
        }
      },
      "MatchVar": {
        "type": "object",
        "description": "Represents a single variable used in a matching rule. It includes the variable's type and its ID.",
        "required": [
          "variable_type",
          "variable_id"
        ],
        "properties": {
          "variable_type": {
            "type": "string",
            "example": "addresses"
          },
          "variable_id": {
            "type": "string",
            "format": "uuid",
            "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "x-go-type": "myuuid.UUID",
            "x-go-type-import": {
              "name": "myuuid",
              "path": "github.com/google/uuid"
            }
          }
        }
      },
      "RuleTemplateRef": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ID"
          },
          {
            "$ref": "#/components/schemas/PreDefinedTemplate"
          }
        ]
      }
    }
  },
  "paths": {
    "/streaming/v2/rules": {
      "x-zuplo-path": {
        "pathMode": "open-api"
      },
      "get": {
        "tags": [
          "rule"
        ],
        "summary": "Get all Rules",
        "description": "Returns all rules in the system that the user has access to.",
        "operationId": "find rules",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Name of the rule to fetch",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of rules returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Rule"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-zuplo-route": {
          "custom": {
            "product": "ub_event_streaming",
            "fh": "ubiquity",
            "target_service": "stream-configurator",
            "billing_product": "event-streaming"
          },
          "corsPolicy": "anything-goes",
          "handler": {
            "export": "urlRewriteHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "rewritePattern": "service://bd-workloads-${context.custom.cluster}-k8s-cluster-aegis-stream-configurator-${env.UB_ENV}/rules"
            }
          },
          "policies": {
            "inbound": [
              "event-streaming-default-policy"
            ],
            "outbound": []
          }
        }
      }
    }
  }
}
```