Set quotas
curl --request PUT \
--url https://control.api.niadra.com/v1/quotas \
--header 'Content-Type: application/json' \
--header 'X-Niadra-Operator-Token: <api-key>' \
--data '
{
"tenant_id": "0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01",
"metric": "session_billable",
"limit": 250000,
"period": "month"
}
'import requests
url = "https://control.api.niadra.com/v1/quotas"
payload = {
"tenant_id": "0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01",
"metric": "session_billable",
"limit": 250000,
"period": "month"
}
headers = {
"X-Niadra-Operator-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Niadra-Operator-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenant_id: '0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01',
metric: 'session_billable',
limit: 250000,
period: 'month'
})
};
fetch('https://control.api.niadra.com/v1/quotas', 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://control.api.niadra.com/v1/quotas",
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([
'tenant_id' => '0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01',
'metric' => 'session_billable',
'limit' => 250000,
'period' => 'month'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Niadra-Operator-Token: <api-key>"
],
]);
$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://control.api.niadra.com/v1/quotas"
payload := strings.NewReader("{\n \"tenant_id\": \"0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01\",\n \"metric\": \"session_billable\",\n \"limit\": 250000,\n \"period\": \"month\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Niadra-Operator-Token", "<api-key>")
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://control.api.niadra.com/v1/quotas")
.header("X-Niadra-Operator-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tenant_id\": \"0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01\",\n \"metric\": \"session_billable\",\n \"limit\": 250000,\n \"period\": \"month\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.api.niadra.com/v1/quotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Niadra-Operator-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenant_id\": \"0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01\",\n \"metric\": \"session_billable\",\n \"limit\": 250000,\n \"period\": \"month\"\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01",
"metric": "session_billable",
"limit": 250000,
"period": "month"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Control: platform operations
Set quotas
Usage limits per tenant. A Niadra operations route.
PUT
/
v1
/
quotas
Set quotas
curl --request PUT \
--url https://control.api.niadra.com/v1/quotas \
--header 'Content-Type: application/json' \
--header 'X-Niadra-Operator-Token: <api-key>' \
--data '
{
"tenant_id": "0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01",
"metric": "session_billable",
"limit": 250000,
"period": "month"
}
'import requests
url = "https://control.api.niadra.com/v1/quotas"
payload = {
"tenant_id": "0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01",
"metric": "session_billable",
"limit": 250000,
"period": "month"
}
headers = {
"X-Niadra-Operator-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Niadra-Operator-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenant_id: '0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01',
metric: 'session_billable',
limit: 250000,
period: 'month'
})
};
fetch('https://control.api.niadra.com/v1/quotas', 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://control.api.niadra.com/v1/quotas",
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([
'tenant_id' => '0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01',
'metric' => 'session_billable',
'limit' => 250000,
'period' => 'month'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Niadra-Operator-Token: <api-key>"
],
]);
$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://control.api.niadra.com/v1/quotas"
payload := strings.NewReader("{\n \"tenant_id\": \"0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01\",\n \"metric\": \"session_billable\",\n \"limit\": 250000,\n \"period\": \"month\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Niadra-Operator-Token", "<api-key>")
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://control.api.niadra.com/v1/quotas")
.header("X-Niadra-Operator-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tenant_id\": \"0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01\",\n \"metric\": \"session_billable\",\n \"limit\": 250000,\n \"period\": \"month\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.api.niadra.com/v1/quotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Niadra-Operator-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenant_id\": \"0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01\",\n \"metric\": \"session_billable\",\n \"limit\": 250000,\n \"period\": \"month\"\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "0192f0a0-1b2c-7d3e-8f40-5a6b7c8d9e01",
"metric": "session_billable",
"limit": 250000,
"period": "month"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
Body
application/json

