curl --request POST \
--url https://{tenant}/api/apis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_definition": {
"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-one/",
"strip_listen_path": true,
"target_url": "https://httpbin.org"
},
"use_oauth2": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default"
}
}
}
}
}
'{
"ID": "284acad18f44f3d4e9a0832ccf5fd1",
"Message": "API created",
"Meta": "663cd8615715ec1405aafbea",
"Status": "OK"
}Create an API Definition in Tyk Classic API format.
Note that the response includes the newly created Tyk Classic API Definition containing the unique identifier for the APIs (api_id). You can provide a value for the api_id in the request body, otherwise Tyk will automatically generate a value for you.
The ID field within the Tyk Classic API Definition is a proprietary field used by Tyk to identify the API within the database and cannot be chosen or modified by the user.
curl --request POST \
--url https://{tenant}/api/apis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_definition": {
"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-one/",
"strip_listen_path": true,
"target_url": "https://httpbin.org"
},
"use_oauth2": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default"
}
}
}
}
}
'{
"ID": "284acad18f44f3d4e9a0832ccf5fd1",
"Message": "API created",
"Meta": "663cd8615715ec1405aafbea",
"Status": "OK"
}The Tyk Dashboard API Access Credentials
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
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
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
x >= 0x >= 0x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
x >= 0x >= 0x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
x >= 0x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
"30s"
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
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
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
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"POST"
"https://httpbin.org/expired-keys"
0
"664b613f5715ec4c96cbef3e"
"Expired Keys webhook"
"5e9d9544a1dcd60001d0ed20"
"templates/default_webhook.json"
"1f78e319202b430e92286cff3ca759e3"
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
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
Show child attributes
Was this page helpful?