API Fragments in Tyk 5.16: Defined once, governed everywhere

Every API team ends up with the same rate limits, auth settings, or CORS rules duplicated across dozens of APIs. The moment one of them needs to change, that’s dozens of APIs to find and update by hand, with no guarantee you catch them all. While API Templates provide the facility to share configuration when creating APIs, you still need a manual process per API when you change that config. Until now. Tyk 5.16 introduces API Fragments. With API Fragments, you can change that shared configuration in one go across the whole estate.

How do we know it went everywhere?

A platform team at a healthcare company runs five standard pieces of configuration across almost every API they own: token validation, a common error envelope, CORS rules, logging, and quota. During onboarding, they asked the question every platform team asks sooner or later: when we change the error envelope, how do we know it went everywhere?

Now picture an insurer that runs 60 of these shared flows across its estate. Writing a standard is the easy part. Proving it holds across 40, 200, or 1,000 APIs — today and after every change that follows — is the job. Tyk 5.16 is built so the answer to that question is yes, with the evidence to back it.

Change it once, and it changes everywhere

An API Fragment, managed as a first-class asset in the Dashboard, holds configuration shared by a group of APIs. Each API references the Fragment, so a single edit updates all of them. Teams who live in OpenAPI will recognize the pattern straight away, as it follows the specification’s own external reference model. A Fragment can be as small as a single rate limit or as large as a whole middleware section. The platform team decides what is shared, and how much.

The Dashboard keeps it easy to work with:

  • A home of their own. Fragments sit in a new Assets area alongside API Templates, with tags for search and a list of every API that uses each one.
  • Visible in context. In the API Designer, every field a Fragment sets is highlighted, labelled with its source, and linked through.
  • Built into Templates. Reference Fragments from an API Template and every new API inherits the shared pieces on the day it’s created.

Safe to change at scale

A change that updates 200 APIs needs to be as safe as a change that updates one. So before a Fragment change lands, the Dashboard validates every API that uses it. Anything that would produce an invalid API definition stops the save, with the affected APIs listed by name. Fragments in use are protected from deletion.

Fragments resolve in the control plane and the gateway receives a complete API definition exactly as it does today. Your data planes need no upgrade, so a central team can start using Fragments this week while federated gateways on older versions keep running as they are.

In practice: a platform team keeps a standard-security Fragment holding the auth method, CORS policy and security headers every public API must carry. The API Template references it, so new APIs start compliant, and the existing estate references it, ensuring older APIs match. When the security team tightens a header, the platform team edits the Fragment once, the Dashboard checks every dependent API, and the change is live across the portfolio in a single action.

The governance loop, closed

Tyk 5.15 introduced API governance: Spectral-compatible rulesets that check service definitions against your design, security, documentation, and operational standards. They run in the Dashboard when a service is saved and in CI/CD before a definition is imported, with compliance tracked per service and per ruleset. Rulesets tell you whether an API meets the standard. Fragments make meeting it the default, because the configuration each rule checks for is defined once and referenced everywhere. With 5.16 adding the metric that ties the two together, the loop looks like this:

  1. Define the standard (5.15). Write or import the rules that describe a compliant API in your organisation, such as required security schemes, headers, naming, and documentation, and attach them to the API categories they govern.
  2. Apply it with Fragments and Templates (5.16). Put the configuration that satisfies those rules into Fragments, and reference them from Templates so every new API is compliant by construction and existing APIs follow.
  3. Verify where change happens (5.15). Deployment warnings in the Dashboard and ruleset checks in the pipeline catch any API built outside the Template before it reaches production.
  4. Watch it as a metric (5.16). Control plane observability exports compliant, non-compliant, and unassessed API counts over OpenTelemetry. Set a threshold and compliance appears on the same dashboards your on-call team already watches.

When something drifts, the fix happens once, in the Fragment, for every API at the same time.

The same idea, applied to access

5.16 brings the same thinking to access control. Access rights on keys and policies can now carry conditions beyond path and method. A query parameter, header, path segment, request body field, session metadata value, or request context value can be required to match a pattern, to differ from it, or to be absent. Any-of and all-of groups combine, rules evaluate in order, and the first match decides.

Financial services teams will recognize the case that prompted it. One endpoint returns the caller’s own records. Add a user ID to the query string and it returns someone else’s. Same path, same method, and only admin applications should be able to make the second call. With conditional access, a public key gets its own records and an admin key gets everyone’s.

Towards a composable API definition

Step back and a clear direction runs through recent Tyk releases. The OpenAPI document became the source of truth, with its own external references. In 5.16, Kubernetes Gateway API support in Tyk Operator lets platform teams own the gateway while application teams own the HTTPRoute, with Tyk configuration attached alongside. Fragments give shared configuration a home of its own. Custom plugins are faster courtesy of a new JavaScript engine, which makes them a viable, easier alternative to Go plugins.

The result is an API definition assembled from parts, each owned by the team best placed to own it and each changed in one place. That’s how a platform team’s standards scale at the same pace as its API estate.

Good to know: API Fragments are an Enterprise feature. Tyk Sync supports them today and Operator support is planned for a later release. Validation guarantees every dependent API definition stays valid; behavioral testing stays with your pipeline, where the governance rulesets in CI make it easier.

Yes, it went everywhere

Back to the healthcare team’s question. When the error envelope changes, how do you know it went everywhere? With 5.16, the Dashboard checks every dependent API before the change lands, shows you every API it reached, and the governance metric flags anything still outside the standard.

A standard written in a wiki describes how your APIs should look. A standard defined once, validated on every save, and measured continuously tells you how they look right now.

Tyk 5.16 is available now. API Fragments require Tyk Dashboard 5.16.0 and an Enterprise license. You will find the details and the governance ruleset reference in the Tyk documentation.

Share the Post:

Related Posts