Update Workspace Exclusions
curl --request PUT \
--url https://api.portkey.ai/v1/workspace-exclusions/input-guardrails \
--header 'Content-Type: application/json' \
--data '
{
"organisation_id": "<string>",
"workspaces": [
{}
],
"workspaces[].workspace_id": "<string>",
"workspaces[].excluded": true,
"override_existing": true
}
'import requests
url = "https://api.portkey.ai/v1/workspace-exclusions/input-guardrails"
payload = {
"organisation_id": "<string>",
"workspaces": [{}],
"workspaces[].workspace_id": "<string>",
"workspaces[].excluded": True,
"override_existing": True
}
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({
organisation_id: '<string>',
workspaces: [{}],
'workspaces[].workspace_id': '<string>',
'workspaces[].excluded': true,
override_existing: true
})
};
fetch('https://api.portkey.ai/v1/workspace-exclusions/input-guardrails', 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.portkey.ai/v1/workspace-exclusions/input-guardrails",
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([
'organisation_id' => '<string>',
'workspaces' => [
[
]
],
'workspaces[].workspace_id' => '<string>',
'workspaces[].excluded' => true,
'override_existing' => true
]),
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.portkey.ai/v1/workspace-exclusions/input-guardrails"
payload := strings.NewReader("{\n \"organisation_id\": \"<string>\",\n \"workspaces\": [\n {}\n ],\n \"workspaces[].workspace_id\": \"<string>\",\n \"workspaces[].excluded\": true,\n \"override_existing\": true\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.portkey.ai/v1/workspace-exclusions/input-guardrails")
.header("Content-Type", "application/json")
.body("{\n \"organisation_id\": \"<string>\",\n \"workspaces\": [\n {}\n ],\n \"workspaces[].workspace_id\": \"<string>\",\n \"workspaces[].excluded\": true,\n \"override_existing\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portkey.ai/v1/workspace-exclusions/input-guardrails")
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 \"organisation_id\": \"<string>\",\n \"workspaces\": [\n {}\n ],\n \"workspaces[].workspace_id\": \"<string>\",\n \"workspaces[].excluded\": true,\n \"override_existing\": true\n}"
response = http.request(request)
puts response.read_bodyUpdate Workspace Exclusions
Bulk update which workspaces are excluded from organization-level input or output guardrails
Update Workspace Exclusions
curl --request PUT \
--url https://api.portkey.ai/v1/workspace-exclusions/input-guardrails \
--header 'Content-Type: application/json' \
--data '
{
"organisation_id": "<string>",
"workspaces": [
{}
],
"workspaces[].workspace_id": "<string>",
"workspaces[].excluded": true,
"override_existing": true
}
'import requests
url = "https://api.portkey.ai/v1/workspace-exclusions/input-guardrails"
payload = {
"organisation_id": "<string>",
"workspaces": [{}],
"workspaces[].workspace_id": "<string>",
"workspaces[].excluded": True,
"override_existing": True
}
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({
organisation_id: '<string>',
workspaces: [{}],
'workspaces[].workspace_id': '<string>',
'workspaces[].excluded': true,
override_existing: true
})
};
fetch('https://api.portkey.ai/v1/workspace-exclusions/input-guardrails', 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.portkey.ai/v1/workspace-exclusions/input-guardrails",
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([
'organisation_id' => '<string>',
'workspaces' => [
[
]
],
'workspaces[].workspace_id' => '<string>',
'workspaces[].excluded' => true,
'override_existing' => true
]),
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.portkey.ai/v1/workspace-exclusions/input-guardrails"
payload := strings.NewReader("{\n \"organisation_id\": \"<string>\",\n \"workspaces\": [\n {}\n ],\n \"workspaces[].workspace_id\": \"<string>\",\n \"workspaces[].excluded\": true,\n \"override_existing\": true\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.portkey.ai/v1/workspace-exclusions/input-guardrails")
.header("Content-Type", "application/json")
.body("{\n \"organisation_id\": \"<string>\",\n \"workspaces\": [\n {}\n ],\n \"workspaces[].workspace_id\": \"<string>\",\n \"workspaces[].excluded\": true,\n \"override_existing\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portkey.ai/v1/workspace-exclusions/input-guardrails")
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 \"organisation_id\": \"<string>\",\n \"workspaces\": [\n {}\n ],\n \"workspaces[].workspace_id\": \"<string>\",\n \"workspaces[].excluded\": true,\n \"override_existing\": true\n}"
response = http.request(request)
puts response.read_bodyExclude or re-include workspaces from organization-level input or output guardrails. When a workspace is excluded, the corresponding org default guardrails are not applied to requests in that workspace.
Choose the path based on which org-level defaults you want to change:
Request body, validation, and response shape are the same for both.
The
| Entity | Endpoint |
|---|---|
| Input guardrails | PUT /v1/workspace-exclusions/input-guardrails |
| Output guardrails | PUT /v1/workspace-exclusions/output-guardrails |
Requires an Admin API key (
organisation-service) with the organisation_exclusions.update scope. Only Organization Owners and Admins can be granted this scope.Body Parameters
string
required
Organization UUID.
object[]
required
List of workspace exclusion updates. Must contain at least one entry. Duplicate
workspace_id values are rejected.string
required
Workspace UUID or workspace slug (for example,
ws-engineering).boolean
required
Set to
true to exclude the workspace from the selected org-level guardrails. Set to false to remove the exclusion and re-apply org defaults.boolean
default:false
When
true, archives all existing active exclusions for that entity type in the organization, then applies the provided workspaces list. When false (default), only the listed workspaces are upserted.Example Request
Exclude a workspace from org input guardrails
curl -X PUT https://api.portkey.ai/v1/workspace-exclusions/input-guardrails \
-H "x-portkey-api-key: $PORTKEY_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"organisation_id": "6e44dcff-c77a-4325-a653-a77459f40aa6",
"workspaces": [
{ "workspace_id": "ws-sandbox", "excluded": true },
{ "workspace_id": "ws-staging", "excluded": false }
],
"override_existing": false
}'
Exclude a workspace from org output guardrails
curl -X PUT https://api.portkey.ai/v1/workspace-exclusions/output-guardrails \
-H "x-portkey-api-key: $PORTKEY_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"organisation_id": "6e44dcff-c77a-4325-a653-a77459f40aa6",
"workspaces": [
{ "workspace_id": "ws-sandbox", "excluded": true }
]
}'
Example Response
{
"success": true,
"data": {
"message": "Workspace exclusions for input guardrails updated successfully"
}
}
message text reflects the entity type you updated (input guardrails or output guardrails).
Related
- List Workspace Exclusions
- Enforcing Org Level Guardrails
- API Keys (AuthN and AuthZ) — includes
organisation_exclusions.update/.list
Last modified on July 28, 2026
Was this page helpful?
⌘I

