API Reference
Virtual Keys
Prompts
- POSTCreate Prompt
- GETList Prompts
- GETRetrieve Prompt
- PUTUpdate Prompt
- DELDelete Prompt
- PUTPublish Prompt
- GETList Prompt Versions
- GETRetrieve Prompt Version
- PUTUpdate Prompt Version
- Prompt Partials
- Prompt Labels
- Prompt Collections
API Keys
Analytics [BETA]
- Summary
- Groups Paginated Data
- Graphs - Time Series Data
User Invites
Workspaces
Workspace Members
Audit Logs
Guardrails
OpenAPI
Update Guardrail
Updates an existing guardrail’s name, checks, or actions
PUT
/
guardrails
/
{guardrailId}
Update a guardrail
Copy
Ask AI
curl --request PUT \
--url https://api.portkey.ai/v1/guardrails/{guardrailId} \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: <api-key>' \
--data '{
"name": "<string>",
"checks": [
{
"id": "default.jwt",
"parameters": {
"jwksUri": "<string>",
"headerKey": "<string>",
"cacheMaxAge": 86400,
"clockTolerance": 5,
"maxTokenAge": "1d",
"algorithms": [
"RS256"
]
},
"name": "<string>",
"enabled": true
}
],
"actions": {
"onFail": "block",
"onPass": "continue",
"message": "<string>",
"logLevel": "info",
"metadata": {}
}
}'
Copy
Ask AI
{
"id": "<string>",
"slug": "<string>",
"version_id": "<string>"
}
Authorizations
Path Parameters
Guardrail UUID or slug to update
Body
application/json
Response
200
application/json
Guardrail updated successfully
The response is of type object
.
Was this page helpful?
Update a guardrail
Copy
Ask AI
curl --request PUT \
--url https://api.portkey.ai/v1/guardrails/{guardrailId} \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: <api-key>' \
--data '{
"name": "<string>",
"checks": [
{
"id": "default.jwt",
"parameters": {
"jwksUri": "<string>",
"headerKey": "<string>",
"cacheMaxAge": 86400,
"clockTolerance": 5,
"maxTokenAge": "1d",
"algorithms": [
"RS256"
]
},
"name": "<string>",
"enabled": true
}
],
"actions": {
"onFail": "block",
"onPass": "continue",
"message": "<string>",
"logLevel": "info",
"metadata": {}
}
}'
Copy
Ask AI
{
"id": "<string>",
"slug": "<string>",
"version_id": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.