---
title: "List All Rules"
method: GET
path: "/rules"
tags: ["api"]
---

# List All Rules

`GET /rules`

This method returns an array of all rules that are stored in the backend. This is useful if you want to get a full
view of what rules you have currently in place.

## Query parameters

- `limit` integer
- `offset` integer

## Response `200`

A list of rules

- Rule[]
  - `authenticators` RuleHandler[] — Authenticators is a list of authentication handlers that will try and authenticate the provided credentials. Authenticators are checked iteratively from index 0 to n and if the first authenticator to return a positive result will be the one used. If you want the rule to first check a specific authenticator before "falling back" to others, have that authenticator as the first item in the array.
    - `config` unknown
    - `handler` string — Handler identifies the implementation which will be used to handle this specific request. Please read the user guide for a complete list of available handlers.
  - `authorizer` RuleHandler
    - `config` unknown
    - `handler` string — Handler identifies the implementation which will be used to handle this specific request. Please read the user guide for a complete list of available handlers.
  - `description` string — Description is a human readable description of this rule.
  - `id` string — ID is the unique id of the rule. It can be at most 190 characters long, but the layout of the ID is up to you. You will need this ID later on to update or delete the rule.
  - `match` RuleMatch
    - `methods` string[] — An array of HTTP methods (e.g. GET, POST, PUT, DELETE, ...). When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the HTTP method of the incoming request with the HTTP methods of each rules. If a match is found, the rule is considered a partial match. If the matchesUrl field is satisfied as well, the rule is considered a full match.
    - `url` string — This field represents the URL pattern this rule matches. When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the full request URL (e.g. https://mydomain.com/api/resource) without query parameters of the incoming request with this field. If a match is found, the rule is considered a partial match. If the matchesMethods field is satisfied as well, the rule is considered a full match. You can use regular expressions in this field to match more than one url. Regular expressions are encapsulated in brackets < and >. The following example matches all paths of the domain `mydomain.com`: `https://mydomain.com/<.*>`.
  - `mutators` RuleHandler[] — Mutators is a list of mutation handlers that transform the HTTP request. A common use case is generating a new set of credentials (e.g. JWT) which then will be forwarded to the upstream server. Mutations are performed iteratively from index 0 to n and should all succeed in order for the HTTP request to be forwarded.
    - `config` unknown
    - `handler` string — Handler identifies the implementation which will be used to handle this specific request. Please read the user guide for a complete list of available handlers.
  - `upstream` Upstream
    - `preserve_host` boolean — PreserveHost, if false (the default), tells ORY Oathkeeper to set the upstream request's Host header to the hostname of the API's upstream's URL. Setting this flag to true instructs ORY Oathkeeper not to do so.
    - `strip_path` string — StripPath if set, replaces the provided path prefix when forwarding the requested URL to the upstream URL.
    - `url` string — URL is the URL the request will be proxied to.

## Other responses

- `500` — genericError

---

[API](https://skmtc.net/ory/apis/ory-oathkeeper.md) · [All operations](https://skmtc.net/ory/apis/ory-oathkeeper/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ory/ory-oathkeeper/versions/60c3888c6dfb/schema)
