HMCTS Common Platform follows an API versioning strategy based on GitHub's approach, where media type versioning is handled through the HTTP Accept header. This method allows us to evolve our APIs while maintaining backwards compatibility and keeping URLs clean.
We use Semantic Versioning (SemVer) to express the version number:
MAJOR.MINOR.PATCH
Learn more at semver.org.
Versioning is embedded in the Accept header — not in the URL path.
Clients should specify the MAJOR version only in the Accept header:
curl -H "Accept: application/vnd.hmcts.cp.v1+json" https://api.hmcts.service.gov.uk/casesThis tells the server:
- The client is requesting the latest compatible version within v1.
- The response should be in JSON format.
- The request is for a resource defined by the HMCTS Common Platform API.
HTTP/1.1 200 OK
Content-Type: application/vnd.hmcts.cp.v1.4.2+json
{
"case_id": "ABC123",
"status": "submitted"
}We use a vendor-specific media type with semantic versioning:
application/vnd.hmcts.cp.v<MAJOR>[.<MINOR>[.<PATCH>]]+json
application/vnd.hmcts.cp: Indicates the HMCTS Common Platform API.v<MAJOR>[.<MINOR>[.<PATCH>]]: A Semantic Version indicating the version requested.+json: The response format (currently JSON).
Example:
application/vnd.hmcts.cp.v2.3.1+json
- If a client specifies only
v1, the server returns the latest compatiblev1.x.xversion. - All changes within a MAJOR version are guaranteed to be non-breaking.
- Minor and patch changes may introduce new optional fields, improvements, or bug fixes.
If the Accept header is missing or does not include a version, the API will respond with the latest stable MAJOR version.
# Without version
curl -H "Accept: application/json" https://api.hmcts.service.gov.uk/cases
⚠️ Clients relying on the default version may be affected by future MAJOR version changes.
Advanced clients can choose to specify more precise versions:
| Accept Header | Behaviour |
|---|---|
application/vnd.hmcts.cp.v1+json |
Latest version within v1.x.x |
application/vnd.hmcts.cp.v1.2+json |
Latest patch version within v1.2.x |
application/vnd.hmcts.cp.v1.2.3+json |
Specific version v1.2.3 |
We recommend using only the MAJOR version unless strict version control is required.
As new versions are introduced:
- PATCH updates include backwards-compatible bug fixes.
- MINOR updates add backwards-compatible features.
- MAJOR updates introduce breaking changes.
Clients will only be affected by breaking changes if they upgrade to a new MAJOR version.
API responses include the following header:
Vary: AcceptThis ensures intermediaries (like CDNs or proxies) treat different Accept headers as distinct cache entries.
- GitHub API Media Types
- Semantic Versioning
- RFC 6838 – Media Type Naming
- RFC 7231 – HTTP Content Negotiation
For questions or implementation help, please contact the HMCTS API Platform team.