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
    }
  ],
  "actions": {
    "deny": false,
    "async": false,
    "on_success": {
      "feedback": {
        "value": 5,
        "weight": 1,
        "metadata": ""
      }
    },
    "on_fail": {
      "feedback": {
        "value": -5,
        "weight": 1,
        "metadata": ""
      }
    }
  }
}'
{
  "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

Response

200
application/json

Guardrail updated successfully

The response is of type object.