curl --request PUT \
--url https://api.example.com/limits/rules \
--header 'Content-Type: application/json' \
--data '
[
{
"pattern": "<string>",
"description": "<string>",
"disabled": true,
"limits": {
"concurrency": 2
},
"precondition": {
"type": "none"
}
}
]
'import requests
url = "https://api.example.com/limits/rules"
payload = [
{
"pattern": "<string>",
"description": "<string>",
"disabled": True,
"limits": { "concurrency": 2 },
"precondition": { "type": "none" }
}
]
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
pattern: '<string>',
description: '<string>',
disabled: true,
limits: {concurrency: 2},
precondition: {type: 'none'}
}
])
};
fetch('https://api.example.com/limits/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/limits/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'pattern' => '<string>',
'description' => '<string>',
'disabled' => true,
'limits' => [
'concurrency' => 2
],
'precondition' => [
'type' => 'none'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/limits/rules"
payload := strings.NewReader("[\n {\n \"pattern\": \"<string>\",\n \"description\": \"<string>\",\n \"disabled\": true,\n \"limits\": {\n \"concurrency\": 2\n },\n \"precondition\": {\n \"type\": \"none\"\n }\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/limits/rules")
.header("Content-Type", "application/json")
.body("[\n {\n \"pattern\": \"<string>\",\n \"description\": \"<string>\",\n \"disabled\": true,\n \"limits\": {\n \"concurrency\": 2\n },\n \"precondition\": {\n \"type\": \"none\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/limits/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"pattern\": \"<string>\",\n \"description\": \"<string>\",\n \"disabled\": true,\n \"limits\": {\n \"concurrency\": 2\n },\n \"precondition\": {\n \"type\": \"none\"\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"disabled": true,
"last_modified_millis_since_epoch": 1,
"limits": {
"concurrency": 2
},
"pattern": "<string>",
"version": 1,
"description": "<string>"
}
]{
"message": "<string>",
"restate_code": "<string>"
}{
"message": "<string>",
"restate_code": "<string>"
}{
"message": "<string>",
"restate_code": "<string>"
}Upsert a batch of rules.
Each entry carries an optional [Precondition]. Setting it to
DoesNotExist makes the entry a strict insert; Matches(v) rejects
the batch unless the rule’s current version is v; omitting it
(None) is unconditional. The whole batch is atomic: any failed
precondition or cap-exceeded condition rolls back the rest.
curl --request PUT \
--url https://api.example.com/limits/rules \
--header 'Content-Type: application/json' \
--data '
[
{
"pattern": "<string>",
"description": "<string>",
"disabled": true,
"limits": {
"concurrency": 2
},
"precondition": {
"type": "none"
}
}
]
'import requests
url = "https://api.example.com/limits/rules"
payload = [
{
"pattern": "<string>",
"description": "<string>",
"disabled": True,
"limits": { "concurrency": 2 },
"precondition": { "type": "none" }
}
]
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
pattern: '<string>',
description: '<string>',
disabled: true,
limits: {concurrency: 2},
precondition: {type: 'none'}
}
])
};
fetch('https://api.example.com/limits/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/limits/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'pattern' => '<string>',
'description' => '<string>',
'disabled' => true,
'limits' => [
'concurrency' => 2
],
'precondition' => [
'type' => 'none'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/limits/rules"
payload := strings.NewReader("[\n {\n \"pattern\": \"<string>\",\n \"description\": \"<string>\",\n \"disabled\": true,\n \"limits\": {\n \"concurrency\": 2\n },\n \"precondition\": {\n \"type\": \"none\"\n }\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/limits/rules")
.header("Content-Type", "application/json")
.body("[\n {\n \"pattern\": \"<string>\",\n \"description\": \"<string>\",\n \"disabled\": true,\n \"limits\": {\n \"concurrency\": 2\n },\n \"precondition\": {\n \"type\": \"none\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/limits/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"pattern\": \"<string>\",\n \"description\": \"<string>\",\n \"disabled\": true,\n \"limits\": {\n \"concurrency\": 2\n },\n \"precondition\": {\n \"type\": \"none\"\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"disabled": true,
"last_modified_millis_since_epoch": 1,
"limits": {
"concurrency": 2
},
"pattern": "<string>",
"version": 1,
"description": "<string>"
}
]{
"message": "<string>",
"restate_code": "<string>"
}{
"message": "<string>",
"restate_code": "<string>"
}{
"message": "<string>",
"restate_code": "<string>"
}Body
The pattern that selects which scope/limit-key combinations the
rule applies to. Examples: "*", "scope1/*", "scope1/foo/bar".
Free-form description shown in the rule book; not consulted at runtime.
Soft-tombstone toggle. true parks the rule (the runtime treats
it as absent) without removing it.
Per-rule effective limits.
None on a field means "unlimited" (no rule constrains this dimension).
Under the bilrost feature this type is also the wire shape persisted
inside [crate::PersistedRule]; under serde it's the JSON wire shape
for the admin REST model — adding a new limit kind here means allocating
a fresh bilrost(tag(...)) next to the new field.
Show child attributes
Show child attributes
Optimistic-concurrency guard. { "type": "matches", "version": v }
requires the rule's current version to be v;
{ "type": "does_not_exist" } requires the rule to be absent
(strict insert); { "type": "none" } (or omitted) is
unconditional.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Response
Rules upserted
Millis since UNIX epoch.
x >= 0Per-rule effective limits.
None on a field means "unlimited" (no rule constrains this dimension).
Under the bilrost feature this type is also the wire shape persisted
inside [crate::PersistedRule]; under serde it's the JSON wire shape
for the admin REST model — adding a new limit kind here means allocating
a fresh bilrost(tag(...)) next to the new field.
Show child attributes
Show child attributes
Per-rule version: bumped on runtime-relevant changes.
x >= 0