curl --request POST \
--url https://{tenant}/api/apis/oas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"components": {
"securitySchemes": {
"bearerAuth": {
"description": "The API Access Credentials",
"scheme": "bearer",
"type": "http"
}
}
},
"info": {
"description": "This is a sample OpenAPI description.",
"title": "Sample OpenAPI description",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/api/sample/users": {
"get": {
"operationId": "getUsersSample",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"properties": {
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"description": "fetched users"
}
},
"summary": "Get users",
"tags": [
"users"
]
}
}
},
"security": [
{
"bearerAuth": []
}
],
"servers": [
{
"url": "https://localhost:8080"
}
],
"x-tyk-api-gateway": {
"info": {
"name": "user",
"state": {
"active": true
}
},
"server": {
"listenPath": {
"strip": true,
"value": "/user-test-one/"
}
},
"upstream": {
"url": "https://localhost:8080"
}
}
}
'{
"ID": "4c1c0d8fc885401053ddac4e39ef676b",
"Message": "API created",
"Meta": "665597e0b646b300011acb69",
"Status": "OK"
}Create an API Definition in Tyk OAS API format.
Note that the response includes the newly created Tyk OAS API Definition containing the unique identifier for the API (ID). You can provide a value for ID in the request body, otherwise Tyk will automatically generate a value.
curl --request POST \
--url https://{tenant}/api/apis/oas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"components": {
"securitySchemes": {
"bearerAuth": {
"description": "The API Access Credentials",
"scheme": "bearer",
"type": "http"
}
}
},
"info": {
"description": "This is a sample OpenAPI description.",
"title": "Sample OpenAPI description",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/api/sample/users": {
"get": {
"operationId": "getUsersSample",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"properties": {
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"description": "fetched users"
}
},
"summary": "Get users",
"tags": [
"users"
]
}
}
},
"security": [
{
"bearerAuth": []
}
],
"servers": [
{
"url": "https://localhost:8080"
}
],
"x-tyk-api-gateway": {
"info": {
"name": "user",
"state": {
"active": true
}
},
"server": {
"listenPath": {
"strip": true,
"value": "/user-test-one/"
}
},
"upstream": {
"url": "https://localhost:8080"
}
}
}
'{
"ID": "4c1c0d8fc885401053ddac4e39ef676b",
"Message": "API created",
"Meta": "665597e0b646b300011acb69",
"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.
The Asset ID of template applied while creating or importing an OAS API.
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
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?