Skip to main content
PUT
/
guardrails
/
{guardrailId}
Update a guardrail
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>",
      "is_enabled": true
    }
  ]
}
'
{
  "id": "<string>",
  "slug": "<string>",
  "version_id": "<string>"
}

Authorizations

x-portkey-api-key
string
header
required

Path Parameters

guardrailId
string
required

Guardrail UUID or slug to update

Body

application/json
name
string

Updated name of the guardrail

checks
object[]

Updated array of guardrail checks

Minimum array length: 1
actions
object

Actions to take when guardrail checks fail or pass

Response

Guardrail updated successfully

id
string
required

Unique identifier of the updated guardrail

slug
string
required

URL-friendly slug for the guardrail

version_id
string

New version identifier after update

Last modified on March 31, 2026