Authorization
header that must be added to each request that is made. The Tyk Dashboard API Access Credentials Authorization
key can be found within the Dashboard UI at the bottom of the Edit User section for a user.
Dashboard Admin API
The Tyk Dashboard Admin API is secured using a shared secret that is set in the tyk_analytics.conf
file. Calls to the Admin API require the admin-auth
header to be provided, to differentiate the call from a regular Dashboard API call.
p
which starts at 1
. At the default page size, this returns items 1-10. Setting p
to 2
returns items 11-20 and so on. Alternatively, passing 0
or lower as a parameter will return all items.
The default page size is 10. You can overwrite the default page size in your tyk_analytics.conf
using the page_size
key. It’s suggested you do not modify it as it will affect the performance of the Dashboard.
Sample Request:
Property | Description |
---|---|
Resource URL | /api/apis/ |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/search |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/{id} |
Method | GET |
Type | None |
Body | None |
Param | None |
{id}
can either be the internal or public ID ( see api_id
in the sample response )api_definition
field and event handlers, such as webhooks are not embedded in the main api_defintion
object (though they can be), webhooks are instead appended as references into the hook_references
field, the API will embed the correct webhook data into the event handler interface.
Please note that ID’s (both id
and api_id
) are auto-generated by Tyk and cannot be set by the user. In Self-Managed installations api_id
can be overwritten with a call to the Update API Definition endpoint, but this is currently not possible when the Dashboard resides in Tyk Cloud.
Property | Description |
---|---|
Resource URL | /api/apis/ |
Method | POST |
Type | None |
Body | Advanced API Definition |
Param | None |
ignored
array. Subpaths of a route are matched automatically and so should be placed above parent routes if they need to be matched individually.
api_id
can be updated for Self-Managed installations, this is currently not possible when the Dashboard resides in Tyk Cloud. Updates to api_id
in Tyk Cloud will be ignored.
Property | Description |
---|---|
Resource URL | /api/apis/{internal_or_external_id} |
Method | PUT |
Type | None |
Body | Advanced API Definition |
Param | None |
/api/data-graphs/
has only one endpoint called /data-sources
with only a POST
HTTP method.
The Dashboard exposes the /api/data-graphs/data-sources/import
endpoint which allows you to import an AsyncAPI or OpenAPI document.
Property | Description |
---|---|
Resource URL | /api/data-graphs/data-sources/import |
Method | POST |
Content-Type | application/json |
Body | { "url": "resource URL" } |
Property | Description |
---|---|
Resource URL | /api/data-graphs/data-sources/import |
Method | POST |
Content-Type | application/vnd.tyk.udg.v2.openapi |
Body | <OpenAPI Document> |
Property | Description |
---|---|
Resource URL | /api/data-graphs/data-sources/import |
Method | POST |
Content-Type | application/vnd.tyk.udg.v2.asyncapi |
Body | <AsyncAPI Document> |
Property | Description |
---|---|
Status | Error or OK |
Message | Verbal explanation |
Meta | API ID for success and null with error (not in use) |
Property | Description |
---|---|
Resource URL | /api/activity/keys/endpoint/{keyHash}/{startDay}/{startMonth}/{startYear}/{EndDay}/{EndMonth}/{EndYear} |
Method | GET |
Type | None |
Body | None |
Param | None |
7f3c3ca87376cabe
between October 13th 2020 and October 14th 2020, make the following call:
Property | Description |
---|---|
Resource URL | /api/activity/oauthid/endpoint/{OAuthClientID}/{startDay}/{startMonth}/{startYear}/{EndDay}/{EndMonth}/{EndYear} |
Method | GET |
Type | None |
Body | None |
Param | None |
27b35a9ed46e429eb2361e440cc4005c
between October 13th 2020 and October 14th 2020, make the following call:
USER_ID
is a placeholder for your User ID value.Property | Description |
---|---|
Resource URL | /api/users |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/users/{USER_ID} |
Method | GET |
Type | None |
Body | None |
Param | None |
password
field. You then use Set User Password request to add a password.users
Permission object set to write to use Add User.
If you do set a password, you need to keep a record of it, to enable the password to be reset in the future.
Property | Description |
---|---|
Resource URL | /api/users |
Method | POST |
Type | None |
Body | User Object |
Param | None |
current_password
field is not required. To change an current password, you need to know the existing password set in Add User.
You need to have the users
Permission object set to read to use Set User Password.
Property | Description |
---|---|
Resource URL | /api/users/{USER_ID}/actions/reset |
Method | POST |
Type | None |
Body | Password Object |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/users/{USER_ID}/actions/allow_reset_passwords |
Method | PUT |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/users/{USER_ID}/actions/disallow_reset_passwords |
Method | PUT |
Type | None |
Body | None |
Param | None |
users
Permission object set to write to use Update User.
Property | Description |
---|---|
Resource URL | /api/users/{USER_ID} |
Method | PUT |
Type | None |
Body | User Object |
Param | None |
users
Permission object set to write to use this call.
Property | Description |
---|---|
Resource URL | /api/users/{USER_ID}/actions/key/reset |
Method | PUT |
Type | None |
Body | {"userId":"{USER_ID}"} |
Param | None |
Property | Description |
---|---|
Resource URL | /api/users/{USER_ID} |
Method | DELETE |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/usergroups |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/usergroups/{user_group-id} |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/usergroups |
Method | POST |
Type | None |
Body | User Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/usergroups/{user_group-id} |
Method | PUT |
Type | None |
Body | User Group Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/usergroups/{user_group-id} |
Method | DELETE |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/org/permissions |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/org/permission |
Method | PUT |
Type | None |
Body | Permissions Object |
Param | None |
api_developer
and api_manager
. In order to add a new permission to this list, just send
an updated list of permissions by appending the values you want. In this example we will add a custom_permission
permission.
{api-id}
can either be the internal or external API id.Property | Description |
---|---|
Resource URL | /api/apis/{api-id}/keys |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/{api-id}/keys/{key-id} |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/keys/{custom-key-id} |
Method | POST |
Type | None |
Body | Session Object |
Param | None |
access_rights
is necessary, as we are adding a security policy and inheriting the access rights from there. That’s because of legacy functionality. We need to add any APIs api_id
to the key of the access_rights map, as well as the api_id
value of that key. This will all get overwritten by the policy, but we need to add it.
Sample Response:
my-custom-key
as a key to access the API. Furthermore, you can use it to lookup the key in the Dashboard as well as the generated key_hash
in the response.
Let’s try curling it:
Property | Description |
---|---|
Resource URL | /api/keys |
Method | POST |
Type | None |
Body | Session Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/{api-id}/keys/{keyId} |
Method | PUT |
Type | None |
Body | Session Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/{api-id}/keys/{keyId} |
Method | DELETE |
Type | None |
Body | None |
Param | None |
Method | URL | Description |
---|---|---|
POST | /graphql | GraphQL query endpoint |
GET | /playground | Dashboard Graphql Playground - where you could see docs and run queries |
Property | Description |
---|---|
Resource URL | /api/apis/keys/basic/{username} |
Method | POST |
Type | None |
Body | Session Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{{api-id}} |
Method | POST |
Type | JSON |
Body | Client Object |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{{api-id}} |
Method | GET |
Type | JSON |
Body | NONE |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{{api-id}}/{{client_id}} |
Method | GET |
Type | JSON |
Body | NONE |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{{api-id}}/{{client_id}} |
Method | DELETE |
Type | JSON |
Body | NONE |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{apiID}/{oauthClientId}/tokens |
Method | GET |
Type | |
Body | NONE |
oauth_token_expired_retain_period
which specifies retain period for expired tokens stored in Redis. By default expired token not get removed. See here for more details.
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{oauthClientId}/revoke |
Method | POST |
Type | JSON |
Body | Client Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{oauthClientId}/revoke_all |
Method | POST |
Type | JSON |
Body | Client Object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/apis/oauth/{{api_id}}/authorize-client/ |
Method | POST |
Type | Form-Encoded |
Body | Fields (see below) |
api_id
: Unlike the other requests on this page, this must be the api_id
value and NOT the API’s id
value.response_type
: Should be provided by requesting client as part of authorization request, this should be either code
or token
depending on the methods you have specified for the API.client_id
: Should be provided by requesting client as part of authorization request. The Client ID that is making the request.redirect_uri
: Should be provided by requesting client as part of authorization request. Must match with the record stored with Tyk.key_rules
: 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.policy_id
isn’t included in the request as these are optional. OAuth2.0 Flow also supports callbacks which can be added to the key_rules
in the payload in requests that don’t include the policy_id
.
Sample Request
/api/sso
Dashboard API which allows you to generate a temporary authentication token, valid for 60 seconds.
You should provide JSON payload with the following data:
ForSection
- scope with possible values of "dashboard"
or "portal"
only.OrgID
- organization idEmailAddress
- user emailGroupID
- user group id ( it is the mongo id and you can can find it in the url when opening a user group via Tyk- Dashboard UI or if you call Tyk-Dashboard REST API /api/usergroups
)Property | Description |
---|---|
Resource URL | /api/sso |
Method | POST |
Body | {"ForSection":"<scope>", "OrgID": "<org-id>", "EmailAddress": "<email-address>", "GroupID": "<user-group-id>"} |
Property | Description |
---|---|
Resource URL | /api/hooks |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/hooks/{hook-id} |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/hooks |
Method | POST |
Type | None |
Body | Hook object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/hooks/{hook-id} |
Method | PUT |
Type | None |
Body | Hook object |
Param | None |
Property | Description |
---|---|
Resource URL | /api/hooks/{hook-id} |
Method | DELETE |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /api/org/opa |
Method | GET |
Type | None |
Body | None |
Param | None |
enabled
) via a PUT request to the permissions
endpoint.Property | Description |
---|---|
Resource URL | /api/org/permission |
Method | PUT |
Type | None |
Body | Permissions Object |
Param | None |
/organisations
as shown throughout this page uses British spelling (with an ‘s’ not ‘z’).
In all other instances, such as when describing or referring to this object in the documentation, we will use the
American spelling “organization” with a ‘z’.admin_Secret
in thetyk_analytics.conf
file. Admin APIs use this value for authentication, and you should set it in the admin-auth
header while sending the request.Property | Description |
---|---|
Resource URL | /admin/organisations/{org-id} |
Method | GET |
Type | None |
Body | Organization Object |
Param | None |
Property | Description |
---|---|
Resource URL | `/admin/organisations/‘ |
Method | GET |
Type | None |
Body | Organization Object |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/organisations/ |
Method | POST |
Type | None |
Body | Organization Object |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/organisations/{id} |
Method | PUT |
Type | None |
Body | Organization Object |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/organisations/{id} |
Method | DELETE |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/users/{USER_ID} |
Method | GET |
Type | None |
Body | None |
Param | None |
user-id
created.
Property | Description |
---|---|
Resource URL | /admin/users |
Method | POST |
Type | None |
Body | User Object |
Param | None |
org_id
. This will create a “Super User”, who has global access to all APIs, Policies, etc, for all organizations created within Tyk.users
Permission object set to write to use Update User.
Property | Description |
---|---|
Resource URL | /admin/users/{USER_ID} |
Method | PUT |
Type | None |
Body | User Object |
Param | None |
/admin/sso
Admin API which allows you to generate a temporary authentication token, valid for 60 seconds.
You should provide JSON payload with the following data:
ForSection
- scope with possible values of "dashboard"
or "portal"
OrgID
- with your organization id.GroupID
- the group idEmailAddress
- user emailProperty | Description |
---|---|
Resource URL | /admin/sso |
Method | POST |
Body | {"ForSection":"<scope>", "OrgID": "<org-id>", "GroupID": "<group-id>"} |
Property | Description |
---|---|
Resource URL | /admin/system/reload |
Method | GET |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | /admin/organisations/{ORG-ID} |
Method | GET |
Type | None |
Body | None |
Param | None |
GET APIS
endpoint and GET POLICIES
list endpoints. The output from these endpoints can be used by the Import API.
Property | Description |
---|---|
Resource URL | admin/organisations/import |
Method | POST |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | admin/apis/import |
Method | POST |
Type | None |
Body | None |
Param | None |
Property | Description |
---|---|
Resource URL | admin/policies/import |
Method | POST |
Type | None |
Body | None |
Param | None |
00000000
is an empty token, or an open-request. If you have an API that is open, or a request generates an error before we can identify the API key, then it will be automatically assigned this nil value.
If you select a key, you can get a drill down view of the activity of that key, and the errors and codes that the token has generated:
track_all_paths
which will ensure that all analytics records generated by the Tyk Gateway will be included in the aggregated statistics on the Endpoint Popularity screen. Set this to true
to capture all endpoints in the aggregated data and subsequently on the Dashboard page.
You can alternatively select only a subset of the endpoints to include in the aggregated data by setting track_all_paths
to false
and identifying specific endpoints to be “tracked”. These are identified by the TrackPath
flag being set to true
in the record. In this configuration, the Pump will only include transaction records from “tracked” endpoints in the aggregated data.
Tyk Gateway will set TrackPath
to true
in transaction records generated for endpoints that have the track endpoint middleware enabled.
operationId
defined in the OpenAPI Document that declares both the path and method for which the middleware should be added. The path
can contain wildcards in the form of any string bracketed by curly braces, for example {user_id}
. These wildcards are so they are human readable and do not translate to variable names. Under the hood, a wildcard translates to the “match everything” regex of: (.*)
.
The track endpoint middleware (trackEndpoint
) can be added to the operations
section of the Tyk OAS Extension (x-tyk-api-gateway
) in your Tyk OAS API Definition for the appropriate operationId
(as configured in the paths
section of your OpenAPI Document).
The trackEndpoint
object has the following configuration:
enabled
: enable the middleware for the endpointGET /anything
endpoint. These requests will appear in the Endpoint Popularity analytics screen, located within the API Usage section of Tyk Dashboard.
The configuration above is a complete and valid Tyk OAS API Definition that you can import into Tyk to try out the track endpoint middleware.
track_endpoints
object to the extended_paths
section of your API definition.
The track_endpoints
object has the following configuration:
path
: the endpoint pathmethod
: the endpoint HTTP methodGET
requests to the /anything
endpoint. These requests will appear in the Endpoint Popularity analytics screen, located within the API Usage section of Tyk Dashboard.
name
field in the API definition using a #
qualifier. For example, let’s say you have an API with this (partial) API definition:
global
and staging
categories by updating the API definition to:
#
qualifier to identify a category prevents the use of #
in your API names; this is not an issue when working with Tyk OAS APIs.x
or deleting the category from the box.
x
or deleting the category from the box.
Method | Endpoint path | Action |
---|---|---|
PUT | /api/apis/oas/{apiID}/categories | Assign a list of categories to the specified API |
GET | /api/apis/oas/{apiID}/categories | Retrieve the list of categories assigned to the specified API |
name
field in the API definition and then updating the API in Tyk with that using these endpoints:
Method | Endpoint | Action |
---|---|---|
PUT | /api/apis/{apiID} | Update the API definition for the specified API - CRUD category tags in the name field |
GET | /api/apis/{apiID} | Retrieve the API definition for the specified API - category tags in name field |
Method | Endpoint path | Action |
---|---|---|
GET | /api/apis/categories | Retrieve a list of all categories defined in the system and the number of APIs in each |
GET | /api/apis?category={category_name} | Retrieve a list of all APIs assigned to the specified category |
x-tyk-api-gateway
) that you require for your externally published API portfolio. Creating an API on Tyk is as simple as importing the OpenAPI document and selecting the correct template. Tyk will combine the OpenAPI description with the template to produce a valid Tyk OAS API.
id
: a unique string type identifier for the templatekind
: the asset type, which is set to oas-template
name
: human-readable name for the templatedescription
: a short description of the template, that could be used for example to indicate the configuration held within the templatedata
: a Tyk OAS API definition, the content of which will be used for templating APIs_id
: a unique identifier assigned by Tyk when the template is registered in the Dashboard databasedata
will be pre-set in your new API. You are able to modify these during and after creation of the template. No link is created between the API and the template, so changes made to the API will not impact the template.
x-tyk-api-gateway
extension exists in the template, it will be applied to the newly created API.
Where there are clashes between configuration in the OpenAPI description and the template:
paths
and components
, new keys will be added alongside any existing ones from the template
servers
and tags
, values in the OpenAPI description will replace those in the templateid
that can be used to access the template from the Tyk Dashboard API:
/anything
endpoint and API-level cache configuration, all of which will be configured within the template.
id
that can be used to access the template from the Tyk Dashboard API.
/xml
and /anything
endpoints defined, with API-level caching configured. You can see the API definition here.
id
: a unique string type identifier for the templatekind
: the asset type, which is set to oas-template
name
: human-readable name for the templatedescription
: a short description of the template, that could be used for example to indicate the configuration held within the templatedata
: a Tyk OAS API definition, the content of which will be used for templating APIs_id
: a unique identifier assigned by Tyk when the template is registered in the Dashboard databasePOST
request to the dashboard’s /api/assets
endpoint.
For example, if you send this command to the endpoint:
HTTP 201 Created
and will provide this payload in response:
Meta
contains the database ID (where the asset has been registered in the persistent storage) and ID
contains the unique identifier for the template. This unique identifier will be automatically generated by Tyk if none was provided in the id
of the template asset provided in the curl
request.
/apis/oas/import
endpoint to import the OpenAPI description and apply it to your API.
If you have a template registered with your Dashboard, you can use this as the starting point for your new API. Tyk will combine the OpenAPI document with the template, automating the configuration of any element in the Tyk OAS API definition as defined in your chosen template.
You’ll need to identify the template to be used during the import. You can use either its unique id
or the database ID that was assigned when the template was registered with Tyk Dashboard. You provide either the id
or _id
in the templateID
query parameter in the call to /oapis/oas/import
.
For example:
HTTP 200 OK
and will provide this payload in response:
Meta
contains the database ID (where the API has been registered in the persistent storage) and ID
contains the unique identifier for the API. This unique identifier will be automatically generated by Tyk as none was provided in the id
field of the x-tyk-api-gateway.info
field provided in the curl
request.
The new Tyk OAS API will have this definition, combining the OpenAPI description provided in the body of the curl
request with the template with Id my-unique-template-id
:
GET /xml
endpoint from the OpenAPI description and the POST /anything
endpoint from the template (complete with requestSizeLimit
middleware) have both been defined in the API definition. API-level caching has been enabled, as configured in the template. Tyk has included the server
entry from the OpenAPI description (which points to the upstream server) and added the API URL on Tyk Gateway (as explained here).
x-tyk-api-gateway
), you can use the /apis/oas
endpoint to import the API defintiion.
If you have a template registered with your Dashboard, you can use this as the starting point for your new API. Tyk will combine the API definition with the template, automating the configuration of any element defined in your chosen template.
You’ll need to identify the template to be used during the import. You can use either its unique id
or the database ID that was assigned when the template was registered with Tyk Dashboard. You provide either the id
or _id
in the templateID
query parameter in the call to /apis/oas
.
For example:
HTTP 200 OK
and will provide this payload in response:
Meta
contains the database ID (where the API has been registered in the persistent storage) and ID
contains the unique identifier for the API. This unique identifier will be automatically generated by Tyk as none was provided in the id
field of the x-tyk-api-gateway.info
field provided in the curl
request.
The new Tyk OAS API will have this definition, combining the Tyk OAS API definition provided in the body of the curl
request with the template with Id my-unique-template-id
:
GET /json
endpoint from the OpenAPI description and the POST /anything
endpoint from the template (complete with requestSizeLimit
middleware) have both been defined in the API definition. API-level caching has been enabled, as configured in the template.
tyk_analytics.conf
file.
You can then control OPA functionality on a global level via your tyk_analytics.conf
file, or at an organization level using either the OPA API or the Dashboard.
Key | Type | Description | Example |
---|---|---|---|
security.open_policy.enabled | boolean | Toggle support for OPA | false |
security.open_policy.debug | boolean | Enable debugging mode, prints a lot of information to the console | false |
security.open_policy.enable_api | boolean | Enable access to the OPA API, even for users with Admin role | false |
security.additional_permissions | string map | Add custom user/user_group permissions. You can use them in your rules, and they will be displayed in the Dashboard | {"key": "human name"} |
deny
rules, you can also modify the requests using patch_request
.
You should respond with a JSON merge patch format https://tools.ietf.org/html/rfc7396
For example:
TykAPIGet
function, which essentially just does a GET call to the Tyk Dashboard API.
Example:
TykDiff
function, combined with a TykAPIGet
call to get the original object.
Example:
TykAPIGet
and TykDiff
functions, you can mock them in your tests.
In order to understand how the Dashboard evaluates the rules, you can enable debugging mode by setting the security.open_policy.debug
option, and in the Dashboard logs, you will see the detailed output with input and output of the rule engine. It can be useful to copy-paste the Dashboard log output to the Rego playground, fix the issue, and validate it on the Dashboard.
When you modify the dashboard.opa
file, you will need to restart your tyk Dashboard.
CMD+SHIFT+D
(or CTRL+SHIFT+D
for PC), you can open the Developer Tools panel on any page in the Dashboard and configure the permissions. Updates are applied in real-time.
API Editor
role from creating new APIs, but allow them to edit or update existing APIs.
API Editor
role with additional permissions, send a PUT Request to the Dashboard Additional Permissions API endpoint /api/org/permissions
Sample Request
In order to add the new role/permissions use the following payload.
authorization
header to your Tyk Dashboard API Access Credentials secret, obtained from your user profile on the Dashboard UI.This assumes no other additional permissions already exist. If you’re adding to existing permissions you’ll want to send a GET to /api/org/permissions
first, and then add the new permission to the existing list.Add User
button. Create a user that has API Write
access and the newly created API Editor
permission, e.g.
API Editor
user and try to create a new API. You should see an Access Denied
error message. Now try to update an existing API. This should be successful!!
/api
route. These audit logs can be stored either in files (in JSON or text format) or in the database, providing flexible options for log management and retrieval.
Subsequently, if hosting Tyk Dashboard within a Kubernetes cluster, please ensure that the configured log file path is valid and writeable.
The Tyk Dashboard config section contains an audit section for configuring audit logging behavior. An example is listed below.
Parameter | Description | Default |
---|---|---|
enabled | Enable audit logging. Setting security.audit_log_path also enables audit logging | true |
format | Specifies audit log file format. Valid values are json and text | text |
path | Path to the audit log. Overwrites security.audit_log_path if it was set | |
detailed_recording | Enable detailed records in the audit log. If set to true then audit log records will contain the http-request (without body) and full http-response including the body | false |
store_type | Specifies the storage in which audit logs will be written, valid values are file and db . | file |
json
format:
Field | Description |
---|---|
req_id | Unique request ID |
org_id | Organization ID |
date | Date in RFC1123 format |
timestamp | UNIX timestamp |
ip | IP address the request originated from |
user | Dashboard user who performed the request |
action | Description of the action performed (e.g. Update User) |
method | HTTP request method |
url | URL of the request |
status | HTTP response status of the request |
diff | Provides a diff of changed fields (available only for PUT requests) |
request_dump | HTTP request copy (available if detailed_recording is set to true ) |
response_dump | HTTP response copy (available if detailed_recording is set to true ) |
text
format outputs all fields as plain text separated with a new line and provided in the same order as json
format.
audit.store_type
to db
:
store_type
is set to db
, audit logs will be stored in the main database storage instead of a file.
mongo-go
driver).mongo-go
driver has been available since Tyk 5.0.2 and is the default from Tyk 5.3.0.
mgo
driver which supported MongoDB 3.x to 4.4.x, but we no longer test MongoDB versions prior to 5.0 since they are EOL.z_tyk_analyticz_aggregate_{ORG ID}
, where ORG_ID corresponds to the ID of your organization assigned by Tyk.
The following environment variables can be used as a minimum to manage this configuration: