curl --request POST \
--url https://{tenant}/api/portal/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"_id": "<string>",
"access_rights": {},
"active": true,
"date_created": "2023-11-07T05:31:56Z",
"hmac_enabled": true,
"id": "<string>",
"is_inactive": true,
"key_expires_in": 123,
"last_updated": "<string>",
"max_query_depth": 123,
"meta_data": {},
"name": "<string>",
"org_id": "<string>",
"partitions": {
"acl": true,
"complexity": true,
"per_api": true,
"quota": true,
"rate_limit": true
},
"per": 123,
"quota_max": 123,
"quota_renewal_rate": 123,
"rate": 123,
"smoothing": {
"delay": 2,
"enabled": true,
"step": 2,
"threshold": 2,
"trigger": 1
},
"tags": [
"<string>"
],
"throttle_interval": 123,
"throttle_retry_limit": 123
}
'{
"ID": "<string>",
"Message": "<string>",
"Meta": "<unknown>",
"Status": "<string>"
}Creating policy definitions is slightly different to the core API, API definitions are wrapped inside an api_definition field and event handlers, such as webhooks are not embedded in the main api_definition object (though they can be), webhooks are instead appended as references into the hook_references field, the API will embed the correct webhook data into the event handler interface.
curl --request POST \
--url https://{tenant}/api/portal/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"_id": "<string>",
"access_rights": {},
"active": true,
"date_created": "2023-11-07T05:31:56Z",
"hmac_enabled": true,
"id": "<string>",
"is_inactive": true,
"key_expires_in": 123,
"last_updated": "<string>",
"max_query_depth": 123,
"meta_data": {},
"name": "<string>",
"org_id": "<string>",
"partitions": {
"acl": true,
"complexity": true,
"per_api": true,
"quota": true,
"rate_limit": true
},
"per": 123,
"quota_max": 123,
"quota_renewal_rate": 123,
"rate": 123,
"smoothing": {
"delay": 2,
"enabled": true,
"step": 2,
"threshold": 2,
"trigger": 1
},
"tags": [
"<string>"
],
"throttle_interval": 123,
"throttle_retry_limit": 123
}
'{
"ID": "<string>",
"Message": "<string>",
"Meta": "<unknown>",
"Status": "<string>"
}The Tyk Dashboard API Access Credentials
Show child attributes
Show child attributes
"d1dfc6a927a046c54c0ed470f19757cc"
"Rate Limit Proxy API"
false
Show child attributes
Show child attributes
Show child attributes
Delay is a hold-off between smoothing events and controls how frequently the current allowance will step up or down (in seconds).
x >= 1Enabled indicates if rate limit smoothing is active.
Step is the increment by which the current allowance will be increased or decreased each time a smoothing event is emitted.
x >= 1Threshold is the initial rate limit beyond which smoothing will be applied. It is a count of requests during the per interval and should be less than the maximum configured rate.
x >= 1Trigger is a fraction (typically in the range 0.1-1.0) of the step at which point a smoothing event will be emitted as the request rate approaches the current allowance.
x >= 0Must be a multiple of 0.01["Default", "v2"]Show child attributes
Delay is a hold-off between smoothing events and controls how frequently the current allowance will step up or down (in seconds).
x >= 1Enabled indicates if rate limit smoothing is active.
Step is the increment by which the current allowance will be increased or decreased each time a smoothing event is emitted.
x >= 1Threshold is the initial rate limit beyond which smoothing will be applied. It is a count of requests during the per interval and should be less than the maximum configured rate.
x >= 1Trigger is a fraction (typically in the range 0.1-1.0) of the step at which point a smoothing event will be emitted as the request rate approaches the current allowance.
x >= 0Must be a multiple of 0.01Was this page helpful?