POST
/
tyk
/
apis
Creat an API
curl --request POST \
  --url https://{tenant}/tyk/apis \
  --header 'Content-Type: application/json' \
  --header 'X-Tyk-Authorization: <api-key>' \
  --data '{
  "api_id": "b84fe1a04e5648927971c0557971565c",
  "auth": {
    "auth_header_name": "authorization"
  },
  "definition": {
    "key": "version",
    "location": "header"
  },
  "name": "Tyk Test API",
  "org_id": "664a14650619d40001f1f00f",
  "proxy": {
    "listen_path": "/tyk-api-test/",
    "strip_listen_path": true,
    "target_url": "https://httpbin.org"
  },
  "use_oauth2": true,
  "version_data": {
    "not_versioned": true,
    "versions": {
      "Default": {
        "name": "Default"
      }
    }
  }
}'
{
  "action": "added",
  "key": "b84fe1a04e5648927971c0557971565c",
  "status": "ok"
}

Authorizations

X-Tyk-Authorization
string
header
required

Api key

Query Parameters

base_api_id
string

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

base_api_version_name
string

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_name
string

The version name of the created version.

set_default
boolean

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

Body

application/json
CORS
object
active
boolean
allowed_ips
string[] | null
analytics_plugin
object
api_id
string
auth
object
auth_configs
object | null
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 | null
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 | null
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 | null
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 | null
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 created.

action
string
Example:

"modified"

key
string
Example:

"b13d928b9972bd18"

key_hash
string
status
string
Example:

"ok"