Update key API error

Hi,

I’m using rest API to cretate/update keys.
Create key request ->
Approve key request ->
GET key api/apis/8a33e5448d504dde4e9e2c77a6b7c17e/keys/5f23d52cd9a543000165d66ad99cf65772f74aea83652592adcb6468 ->
PUT key without modification

and getting error during key update - [{“Status”:“Error”,“Message”:“User/Key object validation failed.”,“Meta”:null,“Errors”:[“allowance: allowance is required”,“per: per is required”,“quota_max: quota_max is required”,“rate: rate is required”]}]
All mentioned fields are present. Updating same key from Dashboard UI works good.

Key data:
{
“api_model”: {},
“key_id”: “5f23d52cd9a543000165d66ad99cf65772f74aea83652592adcb6468”,
“data”: {
“access_rights_array”: [
{
“api_name”: “open-data”,
“api_id”: “8a33e5448d504dde4e9e2c77a6b7c17e”,
“versions”: [
“1”
],
“allowed_urls”: [],
“restricted_types”: [],
“limit”: {
“rate”: 1000,
“per”: 60,
“throttle_interval”: 0,
“throttle_retry_limit”: 0,
“max_query_depth”: -1,
“quota_max”: 5000,
“quota_renews”: 0,
“quota_remaining”: 5000,
“quota_renewal_rate”: 2592000,
“set_by_policy”: false
},
“allowance_scope”: “”
}
],
“oauth_keys_array”: [],
“last_check”: 0,
“allowance”: 1000,
“rate”: 1000,
“per”: 60,
“throttle_interval”: -1,
“throttle_retry_limit”: -1,
“max_query_depth”: -1,
“date_created”: “2020-12-17T06:35:21.589155391Z”,
“expires”: 0,
“quota_max”: 5000,
“quota_renews”: 0,
“quota_remaining”: 0,
“quota_renewal_rate”: 2592000,
“access_rights”: {
“8a33e5448d504dde4e9e2c77a6b7c17e”: {
“api_name”: “open-data”,
“api_id”: “8a33e5448d504dde4e9e2c77a6b7c17e”,
“versions”: [
“1”
],
“allowed_urls”: [],
“restricted_types”: [],
“limit”: {
“rate”: 1000,
“per”: 60,
“throttle_interval”: 0,
“throttle_retry_limit”: 0,
“max_query_depth”: -1,
“quota_max”: 5000,
“quota_renews”: 0,
“quota_remaining”: 5000,
“quota_renewal_rate”: 2592000,
“set_by_policy”: false
},
“allowance_scope”: “”
}
},
“org_id”: “5f23d52cd9a543000165d66a”,
“oauth_client_id”: “”,
“oauth_keys”: null,
“certificate”: “”,
“basic_auth_data”: {
“user”: “”,
“password”: “”,
“hash_type”: “”
},
“jwt_data”: {
“secret”: “”
},
“hmac_enabled”: false,
“hmac_string”: “”,
“is_inactive”: false,
“apply_policy_id”: “”,
“apply_policies”: [
“5fc79950868a500001052acb”
],
“data_expires”: 0,
“monitor”: {
“trigger_limits”: null
},
“enable_detailed_recording”: true,
“meta_data”: {
“tyk_developer_id”: “5f2d145a2578ab0001c17ed0”,
“tyk_key_request_fields”: “{}”
},
“tags”: [],
“alias”: “[email protected]”,
“last_updated”: “1608186921”,
“id_extractor_deadline”: 0,
“session_lifetime”: 0
}
}

Tyk version latest 3.1.1.
Please help.

Hello @orixis, does this only happen when you PUT to a key without any modifications?

It doesn’t depend. I tried all cases, with and without modifications.

@orixis can you please send me the requests you’re running in order so that I can try to recreate the issue and investigate?

@zaid it would not be easy, as this error may depend on my custom API config or policy config. The body of key is in my first post.
If you are developer of dashboard, could you look at source code of dashboard API and tell which fields missing may lead to “allowance is required”

@orixis I am unfortunately not. And without being able to replicate the issue I won’t be able to do much.