curl --request POST \
--url https://{tenant}/api/keys/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alias": "portal-key",
"allowance": 1000,
"apply_policies": [
"62a0ec9092faf50001395817"
],
"enable_detailed_recording": true,
"expires": 1718439136,
"hmac_enabled": false,
"is_inactive": false,
"meta_data": {
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": -1,
"quota_remaining": 0,
"quota_renewal_rate": -1,
"quota_renews": 1715847135,
"rate": 1000,
"tags": [
"edge-eu",
"edge"
],
"throttle_interval": 0,
"throttle_retry_limit": 0
}
'{
"api_model": {},
"data": {
"access_rights": {},
"alias": "[email protected]",
"allowance": 1000,
"apply_policies": [
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
],
"apply_policy_id": "641c15dd0fffb800010197bf",
"basic_auth_data": {
"hash_type": "bcrypt",
"password": "testuse1",
"user": "[email protected]"
},
"certificate": "<string>",
"data_expires": 0,
"date_created": "2024-05-14T13:15:46.560506+03:00",
"enable_detailed_recording": true,
"expires": 1716895221,
"hmac_enabled": false,
"hmac_string": "<string>",
"id_extractor_deadline": 0,
"is_inactive": true,
"jwt_data": {
"secret": "<string>"
},
"key_id": "<string>",
"last_check": 0,
"last_updated": "1715681746",
"max_query_depth": 5,
"meta_data": "<unknown>",
"monitor": {
"trigger_limits": [
80,
60,
50
]
},
"oauth_client_id": "<string>",
"oauth_keys": {},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 1710302205,
"quota_remaining": 20000,
"quota_renewal_rate": -1,
"quota_renews": 1715681745,
"rate": 1000,
"session_lifetime": 0,
"smoothing": {
"delay": 2,
"enabled": true,
"step": 2,
"threshold": 2,
"trigger": 1
},
"tags": [
"edge",
"edge-eu"
],
"throttle_interval": 10,
"throttle_retry_limit": -1
},
"key_hash": "41c5cb1e",
"key_id": "5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5"
}This will check if the body of a key definition is valid. And return a response with how the key would look like if you create it.
curl --request POST \
--url https://{tenant}/api/keys/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alias": "portal-key",
"allowance": 1000,
"apply_policies": [
"62a0ec9092faf50001395817"
],
"enable_detailed_recording": true,
"expires": 1718439136,
"hmac_enabled": false,
"is_inactive": false,
"meta_data": {
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": -1,
"quota_remaining": 0,
"quota_renewal_rate": -1,
"quota_renews": 1715847135,
"rate": 1000,
"tags": [
"edge-eu",
"edge"
],
"throttle_interval": 0,
"throttle_retry_limit": 0
}
'{
"api_model": {},
"data": {
"access_rights": {},
"alias": "[email protected]",
"allowance": 1000,
"apply_policies": [
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
],
"apply_policy_id": "641c15dd0fffb800010197bf",
"basic_auth_data": {
"hash_type": "bcrypt",
"password": "testuse1",
"user": "[email protected]"
},
"certificate": "<string>",
"data_expires": 0,
"date_created": "2024-05-14T13:15:46.560506+03:00",
"enable_detailed_recording": true,
"expires": 1716895221,
"hmac_enabled": false,
"hmac_string": "<string>",
"id_extractor_deadline": 0,
"is_inactive": true,
"jwt_data": {
"secret": "<string>"
},
"key_id": "<string>",
"last_check": 0,
"last_updated": "1715681746",
"max_query_depth": 5,
"meta_data": "<unknown>",
"monitor": {
"trigger_limits": [
80,
60,
50
]
},
"oauth_client_id": "<string>",
"oauth_keys": {},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 1710302205,
"quota_remaining": 20000,
"quota_renewal_rate": -1,
"quota_renews": 1715681745,
"rate": 1000,
"session_lifetime": 0,
"smoothing": {
"delay": 2,
"enabled": true,
"step": 2,
"threshold": 2,
"trigger": 1
},
"tags": [
"edge",
"edge-eu"
],
"throttle_interval": 10,
"throttle_retry_limit": -1
},
"key_hash": "41c5cb1e",
"key_id": "5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5"
}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"]1000
[
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
]deprecated use apply_policies going forward instead to send a list of policies ids
"641c15dd0fffb800010197bf"
Show child attributes
"bcrypt"
"testuse1"
0
"2024-05-14T13:15:46.560506+03:00"
true
1716895221
false
0
0
"1715681746"
5
"5e9d9544a1dcd60001d0ed20"
60
1710302205
20000
-1
1715681745
1000
0
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["edge", "edge-eu"]10
-1
Key definition is valid.
Show child attributes
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"]1000
[
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
]deprecated use apply_policies going forward instead to send a list of policies ids
"641c15dd0fffb800010197bf"
Show child attributes
"bcrypt"
"testuse1"
0
"2024-05-14T13:15:46.560506+03:00"
true
1716895221
false
0
0
"1715681746"
5
"5e9d9544a1dcd60001d0ed20"
60
1710302205
20000
-1
1715681745
1000
0
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["edge", "edge-eu"]10
-1
"41c5cb1e"
"5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5"
Was this page helpful?