Other Root Objects

Last updated: 4 minutes read.

  • id: This is only used in the MongoDB context and bears no actual relation to the identity of the API.

  • name: Human readable name of the API. It is used for identification purposes but does not act as an index.

  • slug: The URL segment that will map to this API, e.g. if set to widgets then the full API URL will be https://your-organisation.cloud.tyk.io/widgets.

  • api_id: The identifier for the API This should be unique, but can actually be any kind of string. For single-instance setups this can probably be set to 1. It is recommended to make this a UUID. The api_id is used when querying the Tyk REST API for configuration details.

  • org_id: This is an identifier that can be set to indicate ownership of an API key or of an individual API. If the Org ID is set (recommended), it is prepended to any keys generated by Tyk - this enables lookups by prefixes from Redis of keys that are in the system.

  • active: When used in conjunction with the dashboard, if set to false means that on start, restart or reload, the API will be ignored and all paths and routes for that API will cease to be proxied. Any keys assigned to it will still exist, though they will not be let through for that particular API.

  • session_lifetime: The session lifetime will override the expiry date if it has been set on a key (in seconds). for example, if a key has been created that never expires, then it will remain in the session cache forever unless manually deleted. If a re-auth needs to be forced or a default expiry needs to be applied to all keys, then use this feature to set the session expiry for an entire API.

  • session_lifetime_respects_key_expiration: If this is set to true and the key expiration date is less than the session_lifetime, the key expiration value will be set to session_lifetime. Don’t forget that the key expiration is set in unix timestamp but session_lifetime is set in seconds. Also, session_lifetime_respects_key_expiration exists in the global config too. When the global one is set to true, the one set at the API level will be ignored.

  • domain: The domain to bind this API to. Multiple APIs can share the same domain, so long as their listen paths are unique. This domain will affect your API only. To set up the portal domain for your organisation, please register it in the main Tyk Dashboard settings file. Your Tyk Gateway can listen on multiple domains/subdomains through the use of regular expressions, more precisely the RE2 Syntax. They are defined using the format {name} or {name:pattern}.

    • www.example.com Matches only if domain is www.example.com
    • {subdomain:[a-z]+}.example.com Matches dynamic subdomain
    • {subdomain:foo|bar}.example.com will listen on foo.example.com and bar.example.com"
  • do_not_track: Set this value to true to have traffic for this API completely ignored.

  • enable_context_vars: Context variables are extracted from the request at the start of the middleware chain, and must be explicitly enabled in order for them to be made available to your transforms. These values can be very useful for later transformation of request data, for example, in converting a Form-based POST into a JSON-based PUT or to capture an IP address as a header. See Context Variables for more details.

  • config_data: You can use the config_data field in your API definition to pass custom attributes to middleware via a virtual endpoint. See Virtual Endpoints for more details.

  • tag_headers: This specifies a string array of HTTP headers values which turned into tags. For example, if you include the X-Request-ID header to tag_headers, for each incoming request it will include an x-request-id-<header_value> tag to request an analytic record. This functionality can be useful if you need analytics for request headers without the body content (Enabling detailed logging is another option, but it records the full request and response objects and consumes a lot more space). Check the page custom Analytics Tags using HTTP Headers for more important information.

  • ignore_endpoint_case: New for v2.9.4. If set to true the case of a call to endpoints for this API will be ignored. So for an endpoint called getuser all the following calls will be allowed:

    • getuser
    • getUser
    • GetUser

If set to true, this will override ignoring the case for a particular endpoint with the Ignore, Blocklist and Allowlist plugins. This setting can be overriden at a “global” Tyk level by setting ignore_endpoint_case to true in your tyk.conf file. See ignore_endpoint_case for details.