Adding API definition via Gateway REST api

Hello everyone. I’m running Tyk CE. I’m trying to add a API definition directly through the Gateway REST API.

I’m posting a JSON object that looks like this
{
“name”: “test”,
“use_keyless”: true,
“active”: true,
“custom_middleware_bundle”: “bundle.zip”,
“enable_coprocess_auth”: true,
“proxy”: {
“listen_path”: “/”,
“target_url”: “http://test.myhost.internal:80
}
}

I get the following response

{
“action”: “added”,
“key”: “”,
“status”: “ok”
}

But when I then list all API defs it’s not there so it seems that it is never added for some reason.
I tried to post without the bundle and coprocess as well without success. Anyone know why it isn’t added?

Can you please try an api def from our docs https://tyk.io/docs/with-tyk-community-edition/tutorials/create-api/#step-2-create-an-api or in this forum and post it?

I just tried it, it states that it has been added, but when I do a GET request to “/tyk/api” it’s not there.

Hi @kristoffer_johansson, I have this exactly problem today. I couldn’t find anywhere in the documentation, but after that you just need to call /tyk/reload/groups in order to make Tyk reload all the files, thus, also load your new API definition.

1 Like