Create an API
Changed onCreate 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.
Request
- Base URLhttps://localhost:8080
- URLhttps://localhost:8080/tyk/apis
- AuthAPI key in header X-Tyk-Authorization
Query parameters
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.
Request body
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.
Example response
{
"action": "modified",
"key": "b13d928b9972bd18",
"status": "ok"
}Changes
- info
added the new optional request property
- info
added the new optional request property
- info
- breaking
removed the enum value
'of the request property/ - info
added the new
enum value to the request property/ - info
added the new
enum value to the request property/
- breaking