{"files":{"SKILL.md":"---\nname: gateway-rest-api\ndescription: \"Gateway REST API skill. Use when working with Gateway REST for tyk. Covers 18 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Gateway REST API\nAPI version: 1.9\n\n## Auth\nApiKey keyId in path\n\n## Base URL\nNot specified.\n\n## Setup\n1. Set your API key in the appropriate header\n2. GET /tyk/keys/ -- gets a list of *key* ids (will only work with non-hashed installations)\n3. POST /tyk/keys/create -- create first create\n\n## Endpoints\n18 endpoints across 1 group. See references/api-spec.lap for full details.\n\n### Tyk\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /tyk/keys/ | Gets a list of *key* IDs (will only work with non-hashed installations) |\n| POST | /tyk/keys/create | Create a new *API token* with the *session object* defined in the body |\n| PUT | /tyk/keys/{keyId} | Update an *API token* with the *session object* defined in the body, this operatin overwrites the existing object |\n| POST | /tyk/keys/{keyId} | Add a pre-specified *API token* with the *session object* defined in the body, this operatin creates a custom token that dsoes not use the gateway naming convention for tokens |\n| DELETE | /tyk/keys/{keyId} | Remove this *API token* from the gateway, this will completely destroy the token and metadata associated with the token and instantly stop access from being granted |\n| GET | /tyk/apis/ | Gets a list of *API Definition* objects that are currently live on the gateway |\n| POST | /tyk/apis/ | Create an *API Definition* object |\n| GET | /tyk/apis/{apiID} | Gets an *API Definition* object, if it exists |\n| DELETE | /tyk/apis/{apiID} | Deletes an *API Definition* object, if it exists |\n| PUT | /tyk/apis/{apiID} | Updates an *API Definition* object, if it exists |\n| GET | /tyk/health/ | Gets the health check values for an API if it is being recorded |\n| GET | /tyk/reload/ | Will reload the targetted gateway |\n| GET | /tyk/reload/group | Will reload the cluster via the targeted gateway |\n| POST | /tyk/oauth/clients/create | Create a new OAuth client |\n| DELETE | /tyk/oauth/clients/{apiId}/{clientId} | Delete the OAuth client |\n| GET | /tyk/oauth/clients/{apiId} | Get a list of OAuth clients bound to this back end |\n| POST | /tyk/oauth/authorize-client/ | The final request from an authorising party for a redirect URI during the Tyk OAuth flow |\n| DELETE | /tyk/oauth/refresh/{keyId} | Invalidate a refresh token |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all keys?\" -> GET /tyk/keys/\n- \"Create a create?\" -> POST /tyk/keys/create\n- \"Update a key?\" -> PUT /tyk/keys/{keyId}\n- \"Delete a key?\" -> DELETE /tyk/keys/{keyId}\n- \"List all apis?\" -> GET /tyk/apis/\n- \"Create a apis?\" -> POST /tyk/apis/\n- \"Get apis details?\" -> GET /tyk/apis/{apiID}\n- \"Delete a apis?\" -> DELETE /tyk/apis/{apiID}\n- \"Update a apis?\" -> PUT /tyk/apis/{apiID}\n- \"List all health?\" -> GET /tyk/health/\n- \"List all reload?\" -> GET /tyk/reload/\n- \"List all group?\" -> GET /tyk/reload/group\n- \"Delete a client?\" -> DELETE /tyk/oauth/clients/{apiId}/{clientId}\n- \"Get client details?\" -> GET /tyk/oauth/clients/{apiId}\n- \"Create a authorize-client?\" -> POST /tyk/oauth/authorize-client/\n- \"Delete a refresh?\" -> DELETE /tyk/oauth/refresh/{keyId}\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Gateway REST API\n@version 1.9\n@auth ApiKey keyId in path\n@endpoints 18\n@toc tyk(18)\n\n@endpoint GET /tyk/keys/\n@desc Gets a list of *key* IDs (will only work with non-hashed installations)\n@required {api_id: any # Back-end to target, x-tyk-authorization: any # tyk gateway shared secret}\n@returns(200) Successful response\n\n@endpoint POST /tyk/keys/create\n@desc Create a new *API token* with the *session object* defined in the body\n@required {x-tyk-authorization: any # tyk gateway shared secret}\n@optional {suppress_reset: any # Adding the `suppress_reset` parameter and setting it to `1`, will cause Tyk to not reset the quota limit that is in the current live quota manager. By default Tyk will reset the quota in the live quota manager (initialising it) when ADDing a key. Adding the `suppress_reset` flag to the URL parameters will avoid this behaviour., session_object: map}\n@returns(200) Key Created Response\n\n@endpoint PUT /tyk/keys/{keyId}\n@desc Update an *API token* with the *session object* defined in the body, this operatin overwrites the existing object\n@required {x-tyk-authorization: any # tyk gateway shared secret, keyId: any # Access Token, api_id: any # Back-end to target}\n@optional {suppress_reset: any # Adding the `suppress_reset` parameter and setting it to `1`, will cause Tyk to not reset the quota limit that is in the current live quota manager. By default Tyk will reset the quota in the live quota manager (initialising it) when ADDing a key. Adding the `suppress_reset` flag to the URL parameters will avoid this behaviour., session_object: map}\n@returns(200) Key Updated Response\n\n@endpoint POST /tyk/keys/{keyId}\n@desc Add a pre-specified *API token* with the *session object* defined in the body, this operatin creates a custom token that dsoes not use the gateway naming convention for tokens\n@required {x-tyk-authorization: any # tyk gateway shared secret, keyId: any # Access Token}\n@optional {session_object: map}\n@returns(200) Key Added Response\n\n@endpoint DELETE /tyk/keys/{keyId}\n@desc Remove this *API token* from the gateway, this will completely destroy the token and metadata associated with the token and instantly stop access from being granted\n@required {x-tyk-authorization: any # tyk gateway shared secret, keyId: any # Access Token, api_id: any # Back-end to target}\n@returns(200) Key Deleted Response\n\n@endpoint GET /tyk/apis/\n@desc Gets a list of *API Definition* objects that are currently live on the gateway\n@required {x-tyk-authorization: any # tyk gateway shared secret}\n@returns(200) Succesful list response\n\n@endpoint POST /tyk/apis/\n@desc Create an *API Definition* object\n@optional {api_definition: map}\n@returns(200) Succesful API Deletion\n\n@endpoint GET /tyk/apis/{apiID}\n@desc Gets an *API Definition* object, if it exists\n@required {x-tyk-authorization: any # tyk gateway shared secret, apiID: any # API ID}\n@returns(200) Succesful API response\n\n@endpoint DELETE /tyk/apis/{apiID}\n@desc Deletes an *API Definition* object, if it exists\n@required {x-tyk-authorization: any # tyk gateway shared secret, apiID: any # API ID}\n@returns(200) Succesful API Deletion\n\n@endpoint PUT /tyk/apis/{apiID}\n@desc Updates an *API Definition* object, if it exists\n@required {x-tyk-authorization: any # tyk gateway shared secret, apiID: any # API ID}\n@optional {api_definition: map}\n@returns(200) Succesful API Deletion\n\n@endpoint GET /tyk/health/\n@desc Gets the health check values for an API if it is being recorded\n@required {x-tyk-authorization: any # tyk gateway shared secret, api_id: any # API ID to query}\n@returns(200) Succesful healthcheck response\n\n@endpoint GET /tyk/reload/\n@desc Will reload the targetted gateway\n@required {x-tyk-authorization: any # tyk gateway shared secret}\n@returns(200) Succesful reload response\n\n@endpoint GET /tyk/reload/group\n@desc Will reload the cluster via the targeted gateway\n@required {x-tyk-authorization: any # tyk gateway shared secret}\n@returns(200) Succesful reload response\n\n@endpoint POST /tyk/oauth/clients/create\n@desc Create a new OAuth client\n@required {x-tyk-authorization: any # tyk gateway shared secret}\n@optional {oauth_client: map}\n@returns(200) Succesful create response\n\n@endpoint DELETE /tyk/oauth/clients/{apiId}/{clientId}\n@desc Delete the OAuth client\n@required {x-tyk-authorization: any # tyk gateway shared secret, apiId: any # API ID that owns this client (back end), clientId: any # OAuth Client ID to delete}\n@returns(200) Succesful OAuth client deletion\n\n@endpoint GET /tyk/oauth/clients/{apiId}\n@desc Get a list of OAuth clients bound to this back end\n@required {x-tyk-authorization: any # tyk gateway shared secret, apiId: any # API ID that owns this client (back end)}\n@returns(200) Succesful listy response\n\n@endpoint POST /tyk/oauth/authorize-client/\n@desc The final request from an authorising party for a redirect URI during the Tyk OAuth flow\n@required {x-tyk-authorization: any # tyk gateway shared secret, response_type: any # Should be provided by requesting client as part of authorisation request, this should be either `code` or `token` depending on the methods you have specified for the API, client_id: any # Should be provided by requesting client as part of authorisation request. The Client ID that is making the request, redirect_uri: any # Should be provided by requesting client as part of authorisation request. Must match with the record stored with Tyk, key_rules: any # A string representation of a *Session Object (form-encoded)*. This should be provided by your application in order to apply any quotas or rules to the key}\n@returns(200) Succesful token response\n\n@endpoint DELETE /tyk/oauth/refresh/{keyId}\n@desc Invalidate a refresh token\n@required {x-tyk-authorization: any # tyk gateway shared secret, keyId: any # Access Token, apiID: any # API ID}\n@returns(200) Succesful token revoked\n\n@end\n"}}