curl --request PUT \
--url https://{tenant}/tyk/apis/{apiID} \
--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": "Update the API name sample",
"org_id": "664a14650619d40001f1f00f",
"proxy": {
"listen_path": "/update-listen-path",
"strip_listen_path": true,
"target_url": "https://tyk.io/api"
},
"use_oauth2": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default"
}
}
}
}
'{
"action": "modified",
"key": "1bd5c61b0e694082902cf15ddcc9e6a7",
"status": "ok"
}Updating an API definition uses the same signature and object as a POST, however it will first ensure that the API ID that is being updated is the same as the one in the object being PUT.
Updating will completely replace the file descriptor and will not change an API Definition that has already been loaded, the hot-reload endpoint will need to be called to push the new definition to live.
curl --request PUT \
--url https://{tenant}/tyk/apis/{apiID} \
--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": "Update the API name sample",
"org_id": "664a14650619d40001f1f00f",
"proxy": {
"listen_path": "/update-listen-path",
"strip_listen_path": true,
"target_url": "https://tyk.io/api"
},
"use_oauth2": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default"
}
}
}
}
'{
"action": "modified",
"key": "1bd5c61b0e694082902cf15ddcc9e6a7",
"status": "ok"
}Api key
The API ID.
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?