POST
/
api
/
assets
Create an asset
curl --request POST \
  --url https://{tenant}/api/assets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "data": {
    "info": {
      "title": "Our Sample OAS",
      "version": "1.0.0"
    },
    "openapi": "3.0.3",
    "paths": {
      "/anything": {
        "post": {
          "operationId": "anythingpost",
          "responses": {
            "200": {
              "description": "post created"
            }
          }
        }
      }
    },
    "x-tyk-api-gateway": {
      "middleware": {
        "global": {
          "cache": {
            "cacheAllSafeRequests": true,
            "enabled": true,
            "timeout": 5
          }
        }
      }
    }
  },
  "description": "My first template",
  "id": "my-unique-template-id",
  "kind": "oas-template",
  "name": "my-template"
}'
{
  "ID": "my-unique-template-id",
  "Message": "asset created",
  "Meta": "664d86e35715ec0d370bbe11",
  "Status": "success"
}

Authorizations

Authorization
string
header
required

The Tyk Dashboard API Access Credentials

Body

application/json

Sample asset.

data
object
Example:
{
"info": {
"title": "Our Sample OAS",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/anything": {
"post": {
"operationId": "anythingpost",
"responses": { "200": { "description": "Post created" } }
}
}
},
"x-tyk-api-gateway": {
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": true,
"enabled": true,
"timeout": 5
}
},
"operations": {
"anythingpost": {
"requestSizeLimit": { "enabled": true, "value": 100 }
}
}
}
}
}
description
string
id
string
kind
string
name
string

Response

asset created

ID
string
Message
string
Meta
any
Status
string