Skip to main content
PUT
/
tyk
/
apis
/
{apiID}
Updating an API definition with its ID.
curl --request PUT \
  --url https://{tenant}/tyk/apis/{apiID} \
  --header 'Content-Type: application/json' \
  --header 'X-Tyk-Authorization: <api-key>' \
  --data '
{
  "CORS": {
    "allow_credentials": false,
    "allowed_headers": [
      "Origin",
      "Accept",
      "Content-Type",
      "Authorization"
    ],
    "allowed_methods": [
      "GET",
      "HEAD",
      "POST"
    ],
    "allowed_origins": [
      "https://*.foo.com"
    ],
    "debug": true,
    "enable": false,
    "exposed_headers": [
      "Accept",
      "Content-Type"
    ],
    "max_age": 24,
    "options_passthrough": false
  },
  "active": true,
  "allowed_ips": [
    "<string>"
  ],
  "analytics_plugin": {
    "enable": true,
    "func_name": "<string>",
    "plugin_path": "<string>"
  },
  "api_id": "<string>",
  "auth": {
    "auth_header_name": "Authorization",
    "cookie_name": "<string>",
    "disable_header": true,
    "name": "<string>",
    "param_name": "<string>",
    "signature": {
      "algorithm": "<string>",
      "allowed_clock_skew": 123,
      "error_code": 123,
      "error_message": "<string>",
      "header": "<string>",
      "param_name": "<string>",
      "secret": "<string>",
      "use_param": true
    },
    "use_certificate": true,
    "use_cookie": true,
    "use_param": true,
    "validate_signature": true
  },
  "auth_configs": {},
  "auth_provider": {
    "meta": {},
    "name": "<string>",
    "storage_engine": "<string>"
  },
  "base_identity_provided_by": "<string>",
  "basic_auth": {
    "body_password_regexp": "<string>",
    "body_user_regexp": "<string>",
    "cache_ttl": 123,
    "disable_caching": true,
    "extract_from_body": true
  },
  "blacklisted_ips": [
    "<string>"
  ],
  "cache_options": {
    "cache_all_safe_requests": false,
    "cache_by_headers": [
      "<string>"
    ],
    "cache_control_ttl_header": "<string>",
    "cache_response_codes": [
      123
    ],
    "cache_timeout": 60,
    "enable_cache": true,
    "enable_upstream_cache_control": false
  },
  "certificate_pinning_disabled": true,
  "certificates": [
    "<string>"
  ],
  "client_certificates": [
    "<string>"
  ],
  "config_data": {},
  "config_data_disabled": true,
  "custom_middleware": {
    "auth_check": {
      "disabled": true,
      "name": "PreMiddlewareFunction",
      "path": "<string>",
      "raw_body_only": false,
      "require_session": false
    },
    "driver": "<string>",
    "id_extractor": {
      "disabled": true,
      "extract_from": "<string>",
      "extract_with": "<string>",
      "extractor_config": {}
    },
    "post": [
      {
        "disabled": true,
        "name": "PreMiddlewareFunction",
        "path": "<string>",
        "raw_body_only": false,
        "require_session": false
      }
    ],
    "post_key_auth": [
      {
        "disabled": true,
        "name": "PreMiddlewareFunction",
        "path": "<string>",
        "raw_body_only": false,
        "require_session": false
      }
    ],
    "pre": [
      {
        "disabled": true,
        "name": "PreMiddlewareFunction",
        "path": "<string>",
        "raw_body_only": false,
        "require_session": false
      }
    ],
    "response": [
      {
        "disabled": true,
        "name": "PreMiddlewareFunction",
        "path": "<string>",
        "raw_body_only": false,
        "require_session": false
      }
    ]
  },
  "custom_middleware_bundle": "<string>",
  "custom_middleware_bundle_disabled": true,
  "custom_plugin_auth_enabled": true,
  "definition": {
    "default": "<string>",
    "enabled": true,
    "fallback_to_default": true,
    "key": "x-api-version",
    "location": "header",
    "name": "<string>",
    "strip_path": true,
    "strip_versioning_data": true,
    "url_versioning_pattern": "<string>",
    "versions": {}
  },
  "detailed_tracing": true,
  "disable_quota": true,
  "disable_rate_limit": true,
  "do_not_track": true,
  "domain": "<string>",
  "domain_disabled": true,
  "dont_set_quota_on_create": true,
  "enable_batch_request_support": true,
  "enable_context_vars": true,
  "enable_coprocess_auth": true,
  "enable_detailed_recording": true,
  "enable_ip_blacklisting": true,
  "enable_ip_whitelisting": true,
  "enable_jwt": true,
  "enable_proxy_protocol": true,
  "enable_signature_checking": true,
  "event_handlers": {
    "events": {}
  },
  "expiration": "<string>",
  "expire_analytics_after": 123,
  "external_oauth": {
    "enabled": true,
    "providers": [
      {
        "introspection": {
          "cache": {
            "enabled": true,
            "timeout": 123
          },
          "client_id": "<string>",
          "client_secret": "<string>",
          "enabled": true,
          "identity_base_field": "<string>",
          "url": "<string>"
        },
        "jwt": {
          "enabled": true,
          "expires_at_validation_skew": 1,
          "identity_base_field": "<string>",
          "issued_at_validation_skew": 1,
          "not_before_validation_skew": 1,
          "signing_method": "<string>",
          "source": "<string>"
        }
      }
    ]
  },
  "global_rate_limit": {
    "disabled": true,
    "per": 123,
    "rate": 123
  },
  "graphql": {
    "enabled": true,
    "engine": {
      "data_sources": [
        {
          "config": "<unknown>",
          "internal": true,
          "kind": "<string>",
          "name": "<string>",
          "root_fields": [
            {
              "fields": [
                "<string>"
              ],
              "type": "<string>"
            }
          ]
        }
      ],
      "field_configs": [
        {
          "disable_default_mapping": true,
          "field_name": "<string>",
          "path": [
            "<string>"
          ],
          "type_name": "<string>"
        }
      ],
      "global_headers": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ]
    },
    "execution_mode": "proxyOnly",
    "introspection": {
      "disabled": true
    },
    "last_schema_update": "2023-11-07T05:31:56Z",
    "playground": {
      "enabled": true,
      "path": "<string>"
    },
    "proxy": {
      "auth_headers": {},
      "features": {
        "use_immutable_headers": true
      },
      "request_headers": {},
      "request_headers_rewrite": {},
      "subscription_type": "<string>",
      "use_response_extensions": {
        "on_error_forwarding": true
      }
    },
    "schema": "<string>",
    "subgraph": {
      "sdl": "<string>"
    },
    "supergraph": {
      "disable_query_batching": true,
      "global_headers": {},
      "merged_sdl": "<string>",
      "subgraphs": [
        {
          "api_id": "<string>",
          "headers": {},
          "name": "<string>",
          "sdl": "<string>",
          "subscription_type": "<string>",
          "url": "<string>"
        }
      ],
      "updated_at": "2023-11-07T05:31:56Z"
    },
    "type_field_configurations": [
      {
        "data_source": {
          "data_source_config": "<unknown>",
          "kind": "<string>"
        },
        "field_name": "<string>",
        "mapping": {
          "disabled": true,
          "path": "<string>"
        },
        "type_name": "<string>"
      }
    ],
    "version": "1"
  },
  "hmac_allowed_algorithms": [
    "<string>"
  ],
  "hmac_allowed_clock_skew": 123,
  "id": "<string>",
  "idp_client_id_mapping_disabled": true,
  "internal": true,
  "is_oas": true,
  "jwt_client_base_field": "<string>",
  "jwt_default_policies": [
    "<string>"
  ],
  "jwt_expires_at_validation_skew": 1,
  "jwt_identity_base_field": "<string>",
  "jwt_issued_at_validation_skew": 1,
  "jwt_not_before_validation_skew": 1,
  "jwt_policy_field_name": "<string>",
  "jwt_scope_claim_name": "<string>",
  "jwt_scope_to_policy_mapping": {},
  "jwt_signing_method": "<string>",
  "jwt_skip_kid": true,
  "jwt_source": "<string>",
  "listen_port": 123,
  "name": "<string>",
  "notifications": {
    "oauth_on_keychange_url": "<string>",
    "shared_secret": "<string>"
  },
  "oauth_meta": {
    "allowed_access_types": [
      "<string>"
    ],
    "allowed_authorize_types": [
      "<string>"
    ],
    "auth_login_redirect": "<string>"
  },
  "openid_options": {
    "providers": [
      {
        "client_ids": {},
        "issuer": "<string>"
      }
    ],
    "segregate_by_client": true
  },
  "org_id": "<string>",
  "pinned_public_keys": {},
  "protocol": "<string>",
  "proxy": {
    "check_host_against_uptime_tests": true,
    "disable_strip_slash": true,
    "enable_load_balancing": true,
    "listen_path": "/relative-path-examples/",
    "preserve_host_header": true,
    "service_discovery": {
      "cache_disabled": true,
      "cache_timeout": 123,
      "data_path": "<string>",
      "endpoint_returns_list": true,
      "parent_data_path": "<string>",
      "port_data_path": "<string>",
      "query_endpoint": "<string>",
      "target_path": "<string>",
      "use_discovery_service": true,
      "use_nested_query": true,
      "use_target_list": true
    },
    "strip_listen_path": true,
    "target_list": [
      "<string>"
    ],
    "target_url": "https://httpbin.org/",
    "transport": {
      "proxy_url": "<string>",
      "ssl_ciphers": [
        "<string>"
      ],
      "ssl_force_common_name_check": true,
      "ssl_insecure_skip_verify": true,
      "ssl_max_version": 1,
      "ssl_min_version": 1
    }
  },
  "request_signing": {
    "algorithm": "<string>",
    "certificate_id": "<string>",
    "header_list": [
      "<string>"
    ],
    "is_enabled": true,
    "key_id": "<string>",
    "secret": "<string>",
    "signature_header": "<string>"
  },
  "response_processors": [
    {
      "name": "<string>",
      "options": "<unknown>"
    }
  ],
  "scopes": {
    "jwt": {
      "scope_claim_name": "<string>",
      "scope_to_policy": {}
    },
    "oidc": {
      "scope_claim_name": "<string>",
      "scope_to_policy": {}
    }
  },
  "session_lifetime": 123,
  "session_lifetime_respects_key_expiration": true,
  "session_provider": {
    "meta": {},
    "name": "<string>",
    "storage_engine": "<string>"
  },
  "slug": "<string>",
  "strip_auth_data": true,
  "tag_headers": [
    "<string>"
  ],
  "tags": [
    "Default",
    "v1"
  ],
  "tags_disabled": true,
  "upstream_certificates": {},
  "upstream_certificates_disabled": true,
  "uptime_tests": {
    "check_list": [
      {
        "body": "<string>",
        "commands": [
          {
            "message": "<string>",
            "name": "<string>"
          }
        ],
        "enable_proxy_protocol": true,
        "headers": {},
        "method": "<string>",
        "protocol": "<string>",
        "timeout": 123,
        "url": "<string>"
      }
    ],
    "config": {
      "expire_utime_after": 123,
      "recheck_wait": 123,
      "service_discovery": {
        "cache_disabled": true,
        "cache_timeout": 123,
        "data_path": "<string>",
        "endpoint_returns_list": true,
        "parent_data_path": "<string>",
        "port_data_path": "<string>",
        "query_endpoint": "<string>",
        "target_path": "<string>",
        "use_discovery_service": true,
        "use_nested_query": true,
        "use_target_list": true
      }
    }
  },
  "use_basic_auth": true,
  "use_go_plugin_auth": true,
  "use_keyless": true,
  "use_mutual_tls_auth": true,
  "use_oauth2": true,
  "use_openid": true,
  "use_standard_auth": true,
  "version_data": {
    "default_version": "<string>",
    "not_versioned": true,
    "versions": {}
  }
}
'
{
  "action": "modified",
  "key": "b13d928b9972bd18",
  "key_hash": "<string>",
  "status": "ok"
}

Authorizations

X-Tyk-Authorization
string
header
required

Api key

Path Parameters

apiID
string
required

The API ID.

Body

application/json
CORS
object
active
boolean
allowed_ips
string[] | null
analytics_plugin
object
api_id
string
auth
object
auth_configs
object
auth_provider
object
base_identity_provided_by
string
basic_auth
object
blacklisted_ips
string[] | null
cache_options
object
certificate_pinning_disabled
boolean
certificates
string[] | null
client_certificates
string[] | null
config_data
object
config_data_disabled
boolean
custom_middleware
object
custom_middleware_bundle
string
custom_middleware_bundle_disabled
boolean
custom_plugin_auth_enabled
boolean
definition
object
detailed_tracing
boolean
disable_quota
boolean
disable_rate_limit
boolean
do_not_track
boolean
domain
string
domain_disabled
boolean
dont_set_quota_on_create
boolean
enable_batch_request_support
boolean
enable_context_vars
boolean
enable_coprocess_auth
boolean
enable_detailed_recording
boolean
enable_ip_blacklisting
boolean
enable_ip_whitelisting
boolean
enable_jwt
boolean
enable_proxy_protocol
boolean
enable_signature_checking
boolean
event_handlers
object
expiration
string
expire_analytics_after
integer
external_oauth
object
global_rate_limit
object
graphql
object
hmac_allowed_algorithms
string[] | null
hmac_allowed_clock_skew
number
id
string
idp_client_id_mapping_disabled
boolean
internal
boolean
is_oas
boolean
jwt_client_base_field
string
jwt_default_policies
string[] | null
jwt_expires_at_validation_skew
integer
Required range: x >= 0
jwt_identity_base_field
string
jwt_issued_at_validation_skew
integer
Required range: x >= 0
jwt_not_before_validation_skew
integer
Required range: x >= 0
jwt_policy_field_name
string
jwt_scope_claim_name
string
jwt_scope_to_policy_mapping
object
jwt_signing_method
string
jwt_skip_kid
boolean
jwt_source
string
listen_port
integer
name
string
notifications
object
oauth_meta
object
openid_options
object
org_id
string
pinned_public_keys
object
protocol
string
proxy
object
request_signing
object
response_processors
object[] | null
scopes
object
session_lifetime
integer
session_lifetime_respects_key_expiration
boolean
session_provider
object
slug
string
strip_auth_data
boolean
tag_headers
string[] | null
tags
string[] | null
Example:
["Default", "v1"]
tags_disabled
boolean
upstream_certificates
object
upstream_certificates_disabled
boolean
uptime_tests
object
use_basic_auth
boolean
use_go_plugin_auth
boolean
use_keyless
boolean
use_mutual_tls_auth
boolean
use_oauth2
boolean
use_openid
boolean
use_standard_auth
boolean
version_data
object

Response

API updated.

action
string
Example:

"modified"

key
string
Example:

"b13d928b9972bd18"

key_hash
string
status
string
Example:

"ok"