Skip to main content
POST
https://{tenantDomain}/api/v2
/
rate-limit-policies
Create a rate limit policy
curl --request POST \
  --url https://{tenantDomain}/api/v2/rate-limit-policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource": "oauth_authentication_api",
  "consumer": "client",
  "consumer_selector": "<string>",
  "configuration": {
    "action": "allow"
  }
}
'
import requests

url = "https://{tenantDomain}/api/v2/rate-limit-policies"

payload = {
"resource": "oauth_authentication_api",
"consumer": "client",
"consumer_selector": "<string>",
"configuration": { "action": "allow" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource: 'oauth_authentication_api',
consumer: 'client',
consumer_selector: '<string>',
configuration: {action: 'allow'}
})
};

fetch('https://{tenantDomain}/api/v2/rate-limit-policies', 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://{tenantDomain}/api/v2/rate-limit-policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource' => 'oauth_authentication_api',
'consumer' => 'client',
'consumer_selector' => '<string>',
'configuration' => [
'action' => 'allow'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenantDomain}/api/v2/rate-limit-policies"

payload := strings.NewReader("{\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"<string>\",\n \"configuration\": {\n \"action\": \"allow\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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.post("https://{tenantDomain}/api/v2/rate-limit-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"<string>\",\n \"configuration\": {\n \"action\": \"allow\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/rate-limit-policies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"<string>\",\n \"configuration\": {\n \"action\": \"allow\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "resource": "oauth_authentication_api",
  "consumer": "client",
  "consumer_selector": "<string>",
  "configuration": {
    "action": "allow"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

resource
enum<string>
required

The API protected by the Rate Limit Policy.

Available options:
oauth_authentication_api
consumer
enum<string>
required

The consumer to which the rate limit policy applies.

Available options:
client
consumer_selector
string
required

Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

Maximum string length: 255
configuration
object
required

The configuration of the rate limit policy.

Response

Rate limit policy successfully created.

id
string<rate-limit-policy-id>
required

Unique identifier for the Rate Limit Policy.

Maximum string length: 26
resource
enum<string>
required

The API protected by the Rate Limit Policy.

Available options:
oauth_authentication_api
consumer
enum<string>
required

The consumer to which the rate limit policy applies.

Available options:
client
consumer_selector
string
required

Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

Maximum string length: 255
configuration
object
required

The configuration of the rate limit policy.

created_at
string<date-time>

The date and time when the rate limit policy was created.

updated_at
string<date-time>

The date and time when the rate limit policy was last updated.