Requirements
Version gating is available on paid plans where the product version module is enabled. Enable it for your product in the KeyPort dashboard.Sending a version in the validate request
To use version gating, include aversion field in your POST /api/v1/validate request body:
The version of your software making the validation request (e.g.
"2.1.0"). If omitted, KeyPort falls back to the product’s current version.Version response fields
When the version module is enabled, the validate response includes:The version that was evaluated. Returns
null if the version module is disabled.Whether the evaluated version is valid for this license. Returns
null if the version module is disabled.Version gating flow
The product version timeline and license pinning rules work together. Product-level version state decides whether a release is globally allowed, while license-level pinning can narrow that down further for a specific customer.- App sends version
POST /api/v1/validateExample payload:
Then
- KeyPort checks product version state
| Version | Platform state | Result |
|---|---|---|
2.0.x | Allowed | Can continue |
2.1.x | Allowed | Can continue |
2.2.x | Deprecated | Still valid |
2.3.x | Latest | Valid |
2.4.x | Blocked or missing | version_valid: false |
Then
- License pinning applies for this customer
Example license rule:
>=2.1 <2.4That means this customer can use
2.1.x, 2.2.x, and 2.3.x, but not 2.0.x or anything at 2.4.x and above.Then
- Validate response
version_valid is only true when the version is allowed by the product and also allowed by the license rule for that customer.How to read this flow
- Step 1 is the input from your app. Your software sends the version it is currently running.
- Step 2 is the product-wide rule. KeyPort checks whether that release is allowed, deprecated, latest, blocked, or missing from your configured version list.
- Step 3 is the customer-specific rule. A license can be pinned to one exact version or to a range such as
>=2.1 <2.4. - Step 4 is the final result returned by the API.
version_validis onlytruewhen both the product-level rule and the license-level rule allow the same version.
What each state means
| State | Meaning |
|---|---|
Allowed | The version is approved at the product level and can continue to license pinning checks. |
Deprecated | The version is old but still accepted. Validation can still succeed. |
Latest | The current recommended release for the product. |
Blocked or missing | The version is not allowed, or it does not exist in the version records. version_valid becomes false. |
Simple example
If your product allows2.0.x to 2.3.x, but one customer’s license is pinned to >=2.1 <2.4:
2.0.5fails for that customer even though the product still allows it2.2.0passes because both checks allow it2.4.0fails because the product blocks or does not recognize it
How version validation works
KeyPort determinesversion_valid based on the version record and any pinning rules configured on the license:
- If the version module is disabled, both
versionandversion_validarenull. - If you don’t send a version, KeyPort falls back to the product’s current version.
- If the referenced version record is missing or blocked,
version_validisfalse. - License version pinning applies on top of the product’s version state. Use
version_pin_modeandversion_rangeon a license to allow only exact or ranged versions for that specific customer.
License-level pinning is more restrictive than product-level version state. A version that is valid at the product level can still be rejected if it falls outside a license’s pinned range.
When to use version gating
Use version gating when you need to:- Prevent customers from running deprecated or unsupported versions
- Restrict specific licenses to a particular version or version range
- Roll out new versions gradually by controlling which licenses permit them
