v51

latestOpenAPI 3.0.3Mozilla Public License Version 2.0raw.githubusercontent.com2026-08-0165205256.0 KB
Policies

Update a policy.

You can update a Policy in your Tyk Instance by ID.

put/tyk/policies/{polID}

Path parameters

polIDstring required

You can retrieve details of a single policy by ID in your Tyk instance.

Request body

_idstring
access_rightsobject nullable
activeboolean
enable_http_signature_validationboolean
graphql_access_rightsobject nullable
hmac_enabledboolean
idstring
is_inactiveboolean
key_expires_ininteger
last_updatedstring
max_query_depthinteger
meta_dataobject nullable
namestring
org_idstring
pernumber double
post_expiry_action'retain' | 'delete'

Defines the action to take on a Session in Redis after it expires. Valid values are "retain" and "delete".

post_expiry_grace_periodinteger

Duration in seconds to retain a Session in Redis after it expires. Used with post_expiry_action "retain". Set to -1 to retain indefinitely.

quota_maxinteger
quota_renewal_rateinteger
ratenumber double
tagsstring[] nullable
throttle_intervalnumber double
throttle_retry_limitinteger

Example request

{
  "_id": "5ead7120575961000181867e",
  "active": true,
  "id": "5ead7120575961000181867e",
  "last_updated": "1655965189",
  "max_query_depth": -1,
  "name": "Swagger Petstore Policy",
  "org_id": "5e9d9544a1dcd60001d0ed20",
  "partitions": {
    "acl": true,
    "quota": true,
    "rate_limit": true
  },
  "per": 60,
  "post_expiry_action": "delete",
  "quota_max": -1,
  "quota_renewal_rate": 3600,
  "rate": 1000,
  "throttle_interval": -1,
  "throttle_retry_limit": -1
}

Response

Policy updated

actionstring
keystring
key_hashstring
statusstring

Example response

{
  "action": "modified",
  "key": "b13d928b9972bd18",
  "status": "ok"
}