PUT
/
api
/
apis
/
{apiID}
/
keys
/
{keyID}
With API ID and key ID.
curl --request PUT \
  --url https://{tenant}/api/apis/{apiID}/keys/{keyID} \
  --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": "portal-developer@example.org",
    "allowance": 1000,
    "apply_policies": [
      "641c15dd0fffb800010197bf",
      "615d2e528bf3980001c7c6c2"
    ],
    "apply_policy_id": "641c15dd0fffb800010197bf",
    "basic_auth_data": {
      "hash_type": "bcrypt",
      "password": "testuse1",
      "user": "admin-user@example.org"
    },
    "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": "<any>",
    "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"
}

Authorizations

Authorization
string
header
required

The Tyk Dashboard API Access Credentials

Path Parameters

apiID
string
required

ID of API the keys grant access to. Can either be the internal or external API ID.

keyID
string
required

The Key ID.

Query Parameters

auto_guess
boolean
default:false

If you are not sure if a key is hashed you can send this as true.

hashed
string

Use the hash of the key as input instead of the full key. Any none empty string will be interpreted as to say you want to use hash input.

username
boolean

Set to true if the passed key ID is a username.

suppress_reset
string

Adding the suppress_reset parameter and setting it to 1, will cause Tyk not to reset the quota limit that is in the current live quota manager. By default Tyk will reset the quota in the live quota manager (initialising it) when adding a key. Adding the suppress_reset flag to the URL parameters will avoid this behaviour.

Body

application/json
access_rights
object | null
alias
string
Example:

"portal-developer@example.org"

allowance
number
Example:

1000

apply_policies
string[] | null
Example:
[
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
]
apply_policy_id
string
deprecated

deprecated use apply_policies going forward instead to send a list of policies ids

Example:

"641c15dd0fffb800010197bf"

basic_auth_data
object
certificate
string
data_expires
integer
Example:

0

date_created
string<date-time>
Example:

"2024-05-14T13:15:46.560506+03:00"

enable_detailed_recording
boolean
Example:

true

expires
integer
Example:

1716895221

hmac_enabled
boolean
Example:

false

hmac_string
string
id_extractor_deadline
integer
Example:

0

is_inactive
boolean
jwt_data
object
key_id
string
last_check
integer
Example:

0

last_updated
string
Example:

"1715681746"

max_query_depth
integer
Example:

5

meta_data
any
monitor
object
oauth_client_id
string
oauth_keys
object | null
org_id
string
Example:

"5e9d9544a1dcd60001d0ed20"

per
number
Example:

60

quota_max
integer
Example:

1710302205

quota_remaining
integer
Example:

20000

quota_renewal_rate
integer
Example:

-1

quota_renews
integer
Example:

1715681745

rate
number
Example:

1000

session_lifetime
integer
Example:

0

smoothing
object | null
tags
string[] | null
Example:
["edge", "edge-eu"]
throttle_interval
number
Example:

10

throttle_retry_limit
integer
Example:

-1

Response

Key updated

api_model
object
data
object
key_hash
string
Example:

"41c5cb1e"

key_id
string
Example:

"5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5"