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"
}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.
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"
}Api key
The base API which the new version will be linked to.
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.
The version name of the created version.
If true, the new version is set as default version.
Show child attributes
false
[
"Origin",
"Accept",
"Content-Type",
"Authorization"
]["GET", "HEAD", "POST"]["https://*.foo.com"]true
false
["Accept", "Content-Type"]24
false
Show child attributes
"Authorization"
Show child attributes
Show child attributes
"Authorization"
Show child attributes
Show child attributes
false
60
true
false
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"x-api-version"
"header"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
x >= 0x >= 0x >= 0Show child attributes
Show child attributes
Show child attributes
proxyOnly, executionEngine, subgraph, supergraph, Show child attributes
Show child attributes
Show child attributes
Show child attributes
1, 2, x >= 0x >= 0x >= 0Show child attributes
"/relative-path-examples/"
Show child attributes
true
"https://httpbin.org/"
Show child attributes
Show child attributes
["Default", "v1"]Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
no_action, reply Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
no_action, reply Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
json, xml blob, file Show child attributes
Show child attributes
Show child attributes
json, xml blob, file Show child attributes
Show child attributes
Show child attributes
all, any Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
blob, file Show child attributes
Show child attributes
Show child attributes
no_action, reply true
Was this page helpful?