Update policy
curl --request PATCH \
--url https://api-v2.requesty.ai/v1/manage/policy/{policy_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "production-chat",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
]
},
"load_balance": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
]
},
"latency": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
]
}
},
"scope": "POLICY_SCOPE_ORGANIZATION"
}
'import requests
url = "https://api-v2.requesty.ai/v1/manage/policy/{policy_id}"
payload = {
"name": "production-chat",
"config": {
"fallback": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
] },
"load_balance": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
] },
"latency": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
] }
},
"scope": "POLICY_SCOPE_ORGANIZATION"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'production-chat',
config: {
fallback: {
models: [{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST', retries: 2}]
},
load_balance: {
models: [{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST', weight: 1}]
},
latency: {models: [{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST'}]}
},
scope: 'POLICY_SCOPE_ORGANIZATION'
})
};
fetch('https://api-v2.requesty.ai/v1/manage/policy/{policy_id}', 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-v2.requesty.ai/v1/manage/policy/{policy_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'production-chat',
'config' => [
'fallback' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST',
'retries' => 2
]
]
],
'load_balance' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST',
'weight' => 1
]
]
],
'latency' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST'
]
]
]
],
'scope' => 'POLICY_SCOPE_ORGANIZATION'
]),
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://api-v2.requesty.ai/v1/manage/policy/{policy_id}"
payload := strings.NewReader("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n }\n ]\n },\n \"load_balance\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"weight\": 1\n }\n ]\n },\n \"latency\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\"\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api-v2.requesty.ai/v1/manage/policy/{policy_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n }\n ]\n },\n \"load_balance\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"weight\": 1\n }\n ]\n },\n \"latency\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\"\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.requesty.ai/v1/manage/policy/{policy_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n }\n ]\n },\n \"load_balance\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"weight\": 1\n }\n ]\n },\n \"latency\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\"\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
]
},
"load_balance": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
]
},
"latency": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
]
}
},
"organization_id": "<string>",
"author_id": "<string>",
"scope": "POLICY_SCOPE_ORGANIZATION"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Update Policy
Replace a policy’s name and configuration. Both name and config are required; the configuration you send replaces the existing one in full. Changes apply to new inference requests immediately. Requires an API key with write manage permissions.
PATCH
/
v1
/
manage
/
policy
/
{policy_id}
Update policy
curl --request PATCH \
--url https://api-v2.requesty.ai/v1/manage/policy/{policy_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "production-chat",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
]
},
"load_balance": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
]
},
"latency": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
]
}
},
"scope": "POLICY_SCOPE_ORGANIZATION"
}
'import requests
url = "https://api-v2.requesty.ai/v1/manage/policy/{policy_id}"
payload = {
"name": "production-chat",
"config": {
"fallback": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
] },
"load_balance": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
] },
"latency": { "models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
] }
},
"scope": "POLICY_SCOPE_ORGANIZATION"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'production-chat',
config: {
fallback: {
models: [{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST', retries: 2}]
},
load_balance: {
models: [{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST', weight: 1}]
},
latency: {models: [{model: 'openai/gpt-4o', key: 'POLICY_KEY_REQUESTY_FIRST'}]}
},
scope: 'POLICY_SCOPE_ORGANIZATION'
})
};
fetch('https://api-v2.requesty.ai/v1/manage/policy/{policy_id}', 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-v2.requesty.ai/v1/manage/policy/{policy_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'production-chat',
'config' => [
'fallback' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST',
'retries' => 2
]
]
],
'load_balance' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST',
'weight' => 1
]
]
],
'latency' => [
'models' => [
[
'model' => 'openai/gpt-4o',
'key' => 'POLICY_KEY_REQUESTY_FIRST'
]
]
]
],
'scope' => 'POLICY_SCOPE_ORGANIZATION'
]),
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://api-v2.requesty.ai/v1/manage/policy/{policy_id}"
payload := strings.NewReader("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n }\n ]\n },\n \"load_balance\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"weight\": 1\n }\n ]\n },\n \"latency\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\"\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api-v2.requesty.ai/v1/manage/policy/{policy_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n }\n ]\n },\n \"load_balance\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"weight\": 1\n }\n ]\n },\n \"latency\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\"\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.requesty.ai/v1/manage/policy/{policy_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"production-chat\",\n \"config\": {\n \"fallback\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"retries\": 2\n }\n ]\n },\n \"load_balance\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\",\n \"weight\": 1\n }\n ]\n },\n \"latency\": {\n \"models\": [\n {\n \"model\": \"openai/gpt-4o\",\n \"key\": \"POLICY_KEY_REQUESTY_FIRST\"\n }\n ]\n }\n },\n \"scope\": \"POLICY_SCOPE_ORGANIZATION\"\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"config": {
"fallback": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"retries": 2
}
]
},
"load_balance": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST",
"weight": 1
}
]
},
"latency": {
"models": [
{
"model": "openai/gpt-4o",
"key": "POLICY_KEY_REQUESTY_FIRST"
}
]
}
},
"organization_id": "<string>",
"author_id": "<string>",
"scope": "POLICY_SCOPE_ORGANIZATION"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Replace a policy’s name and configuration. Both
name and config are required; the configuration you send replaces the existing one in full. Changes apply to new inference requests immediately.Authorizations
API key for authentication
Path Parameters
The policy ID
Body
application/json
New policy name
Example:
"production-chat"
Policy strategy and model chain. Set exactly one of fallback, load_balance, or latency, with at least one model.
Show child attributes
Show child attributes
Policy scope. The Management API only accepts POLICY_SCOPE_ORGANIZATION.
Available options:
POLICY_SCOPE_ORGANIZATION Example:
"POLICY_SCOPE_ORGANIZATION"
Response
Policy updated successfully
Show child attributes
Show child attributes
Last modified on September 8, 2026
Was this page helpful?