Ory

Ory Rules API

The Rules API from Ory — 2 operation(s) for rules.

Business capability
Identity & Access Management BC-620.20

Operations 2

GET /rules List All Rules #
GET /rules/{id} Retrieve a Rule #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ory:ory-rules-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ory-rules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: hi@ory.sh
  description: Documentation for all of Ory Oathkeeper's APIs.
  license:
    name: Apache 2.0
  title: Ory Oathkeeper Rules API
  version: ''
tags:
- name: Rules
paths:
  /rules:
    get:
      description: '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.'
      operationId: listRules
      parameters:
      - description: The maximum amount of rules returned.
        in: query
        name: limit
        schema:
          format: int64
          type: integer
      - description: The offset from where to start looking.
        in: query
        name: offset
        schema:
          format: int64
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/rules'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
          description: genericError
      summary: List All Rules
      tags:
      - Rules
  /rules/{id}:
    get:
      description: Use this method to retrieve a rule from the storage. If it does not exist you will receive a 404 error.
      operationId: getRule
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/rule'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
          description: genericError
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
          description: genericError
      summary: Retrieve a Rule
      tags:
      - Rules
components:
  responses:
    rule:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/rule'
      description: A rule
    rules:
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/rule'
            type: array
      description: A list of rules
  schemas:
    rule:
      properties:
        authenticators:
          description: '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.'
          items:
            $ref: '#/components/schemas/ruleHandler'
          type: array
        authorizer:
          $ref: '#/components/schemas/ruleHandler'
        description:
          description: Description is a human readable description of this rule.
          type: string
        id:
          description: '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.'
          type: string
        match:
          $ref: '#/components/schemas/ruleMatch'
        mutators:
          description: '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.'
          items:
            $ref: '#/components/schemas/ruleHandler'
          type: array
        upstream:
          $ref: '#/components/schemas/Upstream'
      title: swaggerRule is a single rule that will get checked on every HTTP request.
      type: object
    ruleMatch:
      properties:
        methods:
          description: '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.'
          items:
            type: string
          type: array
        url:
          description: '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/<.*>`.'
          type: string
      type: object
    ruleHandler:
      properties:
        config:
          description: 'Config contains the configuration for the handler. Please read the user

            guide for a complete list of each handler''s available settings.'
        handler:
          description: '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.'
          type: string
      type: object
    Upstream:
      properties:
        preserve_host:
          description: '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.'
          type: boolean
        strip_path:
          description: StripPath if set, replaces the provided path prefix when forwarding the requested URL to the upstream URL.
          type: string
        url:
          description: URL is the URL the request will be proxied to.
          type: string
      type: object
    genericError:
      description: The standard error format
      properties:
        code:
          format: int64
          type: integer
        details:
          items:
            additionalProperties: {}
            type: object
          type: array
        message:
          type: string
        reason:
          type: string
        request:
          type: string
        status:
          type: string
      type: object
x-forwarded-proto: string
x-request-id: string