v1

latestOpenAPI 3.1.02026-07-1324323188.8 KB
Rule

Retrieves the collection of currently published Rule resources.

Retrieves the collection of currently published Rule resources.

💡 Please note that draft rules are not included in this list. If you have deleted a rule, it will still be listed here until you publish your ruleset.

💡 Also, please note that there is pagination on this endpoint. Each page contain 100 items. Traversing the rules collection can be done using the searchAfterId query string parameter.

get/rules

Query parameters

projectIdstring required

The id of the project.

searchAfterIdstring

The id of the last rule returned in the previous page. Used for pagination.

tagsstring[]

The name of one or more tags. Every Rule that is attached to at least one of those tags will be returned. Tags can also be passed as a comma separated list.

enabledboolean

The enabled status of the rule.

triggerUrlstring

The trigger source URL. This allows to filter rules that are triggered by a specific URL.

Response

Rule collection

descriptionstring nullable required

This description field is used to describe the rule and share knowledge with other users

enabledboolean required

Set to false to disable this rule

idstring required
lastUsedAtstring date-time nullable required

The date and time when this rule was last used to handle a request

metadataobject required
priorityinteger required

A rule with higher priority takes precedence over lower priorities, which means that the actions defined in the higher priority rule will override the similar actions defined in a lower priority one

tagsstring[] required

Tags are useful to filter rules and retrieve them easily

usageCountinteger required

The total number of times this rule has been used to handle a request

Example response

[
  {
    "actions": [
      {
        "mode": "default"
      }
    ],
    "markers": [
      {
        "description": "My enum marker that only allow \"dog\" or \"cat\"",
        "name": "MyEnum",
        "transformers": [
          {
            "something": "foo",
            "with": "bar"
          }
        ]
      }
    ],
    "trigger": {
      "date": [
        {
          "operator": "equals"
        }
      ],
      "datetime": [
        {
          "operator": "after"
        }
      ],
      "ipAddress": {
        "ip": "1.2.3.4"
      },
      "methods": [
        "GET",
        "POST"
      ],
      "requestHeaders": [
        {
          "name": "Accept",
          "operator": "isNotEqualTo",
          "value": "application/json"
        }
      ],
      "responseStatusCodes": [
        500,
        503
      ],
      "sampling": 47,
      "source": "/old-url",
      "time": [
        {
          "operator": "after"
        }
      ]
    },
    "variables": [
      {
        "marker": "markerName",
        "name": "myVariable",
        "transformers": [
          {
            "something": "foo",
            "with": "bar"
          }
        ]
      }
    ]
  }
]