POST
/
api
/
apis
Create API Definition
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"
}

Authorizations

Authorization
string
header
required

The Tyk Dashboard API Access Credentials

Query Parameters

base_api_id
string

The base API which the new version will be linked to.

base_api_version_name
string

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.

new_version_name
string

The version name of the created version.

set_default
boolean

If true, the new version is set as default version.

Body

application/json
api_definition
object
api_model
object
categories
string[]
created_at
string<date-time> | null
hook_references
object[] | null
is_site
boolean
oas
object | null
sort_by
integer
updated_at
string<date-time> | null
user_group_owners
string[] | null
user_owners
string[] | null

Response

API created

ID
string
Message
string
Meta
any
Status
string