curl --request POST \
--url https://api.portkey.ai/v1/guardrails \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: <api-key>' \
--data '
{
"name": "JWT Authentication Guard",
"organisation_id": "550e8400-e29b-41d4-a716-446655440001",
"checks": [
{
"id": "default.jwt",
"parameters": {
"jwksUri": "https://example.com/.well-known/jwks.json",
"headerKey": "Authorization",
"algorithms": [
"RS256"
],
"cacheMaxAge": 86400,
"clockTolerance": 5,
"maxTokenAge": "1d"
}
}
],
"actions": {
"onFail": "block",
"message": "Invalid JWT token"
}
}
'{
"id": "<string>",
"slug": "<string>",
"version_id": "<string>"
}Create Guardrail
Creates a new guardrail with specified checks and actions
POST
/
guardrails
curl --request POST \
--url https://api.portkey.ai/v1/guardrails \
--header 'Content-Type: application/json' \
--header 'x-portkey-api-key: <api-key>' \
--data '
{
"name": "JWT Authentication Guard",
"organisation_id": "550e8400-e29b-41d4-a716-446655440001",
"checks": [
{
"id": "default.jwt",
"parameters": {
"jwksUri": "https://example.com/.well-known/jwks.json",
"headerKey": "Authorization",
"algorithms": [
"RS256"
],
"cacheMaxAge": 86400,
"clockTolerance": 5,
"maxTokenAge": "1d"
}
}
],
"actions": {
"onFail": "block",
"message": "Invalid JWT token"
}
}
'{
"id": "<string>",
"slug": "<string>",
"version_id": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://portkey-docs-feat-byteplus-provider.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Body
application/json
Name of the guardrail
Example:
"Content Safety Check"
Array of guardrail checks to apply
Minimum array length:
1Show child attributes
Show child attributes
Actions to take when guardrail checks fail or pass
Show child attributes
Show child attributes
Workspace UUID (required if organisation_id not provided and not using API key)
Organisation UUID (required if workspace_id not provided and not using API key)
Last modified on May 24, 2026
Was this page helpful?
⌘I

