v51

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

Create an API

Create API. A single Tyk node can have its API Definitions queried, deleted and updated remotely. This functionality enables you to remotely update your Tyk definitions without having to manage the files manually.

post/tyk/apis

Query parameters

base_api_idstring

The base API which the new version will be linked to.

base_api_version_namestring

The version name of the base API while creating the first version. This doesn't have to be sent for the next versions but if it is set, it will override base API version name.

new_version_namestring

The version name of the created version.

set_defaultboolean

If true, the new version is set as default version.

Request body

activeboolean
allowed_ipsstring[] nullable
api_idstring
auth_configsobject nullable
base_identity_provided_bystring
blacklisted_ipsstring[] nullable
certificate_pinning_disabledboolean
certificatesstring[] nullable
client_certificatesstring[] nullable
config_dataobject nullable
config_data_disabledboolean
custom_middleware_bundlestring
custom_middleware_bundle_disabledboolean
custom_plugin_auth_enabledboolean
detailed_tracingboolean
disable_quotaboolean
disable_rate_limitboolean
do_not_trackboolean
domainstring
domain_disabledboolean
dont_set_quota_on_createboolean
enable_batch_request_supportboolean
enable_context_varsboolean
enable_coprocess_authboolean
enable_detailed_recordingboolean
enable_ip_blacklistingboolean
enable_ip_whitelistingboolean
enable_jwtboolean
enable_proxy_protocolboolean
enable_signature_checkingboolean
expirationstring
expire_analytics_afterinteger
hmac_allowed_algorithmsstring[] nullable
hmac_allowed_clock_skewnumber
idstring
idp_client_id_mapping_disabledboolean
internalboolean
is_oasboolean
jwt_client_base_fieldstring
jwt_default_policiesstring[] nullable
jwt_expires_at_validation_skewinteger
jwt_identity_base_fieldstring
jwt_issued_at_validation_skewinteger
jwt_not_before_validation_skewinteger
jwt_policy_field_namestring
jwt_scope_claim_namestring
jwt_scope_to_policy_mappingobject nullable
jwt_signing_methodstring
jwt_skip_kidboolean
jwt_sourcestring
listen_portinteger
namestring
org_idstring
pinned_public_keysobject nullable
protocolstring
session_lifetimeinteger
session_lifetime_respects_key_expirationboolean
slugstring
strip_auth_databoolean
tag_headersstring[] nullable
tagsstring[] nullable
tags_disabledboolean
upstream_certificatesobject nullable
upstream_certificates_disabledboolean
use_basic_authboolean
use_go_plugin_authboolean
use_keylessboolean
use_mutual_tls_authboolean
use_oauth2boolean
use_openidboolean
use_standard_authboolean
error_overridesobject nullable
error_overrides_disabledboolean

Example request

{
  "CORS": {
    "allowed_headers": [
      "Origin",
      "Accept",
      "Content-Type",
      "Authorization"
    ],
    "allowed_methods": [
      "GET",
      "HEAD",
      "POST"
    ],
    "allowed_origins": [
      "https://*.foo.com"
    ],
    "debug": true,
    "exposed_headers": [
      "Accept",
      "Content-Type"
    ],
    "max_age": 24
  },
  "auth": {
    "auth_header_name": "Authorization"
  },
  "cache_options": {
    "cache_timeout": 60,
    "enable_cache": true
  },
  "custom_middleware": {
    "auth_check": {
      "name": "PreMiddlewareFunction"
    },
    "post": [
      {
        "name": "PreMiddlewareFunction"
      }
    ],
    "post_key_auth": [
      {
        "name": "PreMiddlewareFunction"
      }
    ],
    "pre": [
      {
        "name": "PreMiddlewareFunction"
      }
    ],
    "response": [
      {
        "name": "PreMiddlewareFunction"
      }
    ]
  },
  "definition": {
    "key": "x-api-version",
    "location": "header"
  },
  "proxy": {
    "listen_path": "/relative-path-examples/",
    "strip_listen_path": true,
    "target_url": "https://httpbin.org/"
  },
  "tags": [
    "Default",
    "v1"
  ]
}

Response

API created.

actionstring
keystring
key_hashstring
statusstring

Example response

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