Skip to content

Commit 573cdfa

Browse files
jencarlucciCopilotheiskrjc-clark
authored
Add API version deprecation policy, Deprecation/Sunset headers, and end of support information (#61005)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
1 parent de38e52 commit 573cdfa

4 files changed

Lines changed: 69 additions & 6 deletions

File tree

content/rest/about-the-rest-api/api-versions.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ curl {% data reusables.rest-api.version-header %} https://api.github.com/zen
3636

3737
Requests without the `X-GitHub-Api-Version` header will default to use the `{{ defaultRestApiVersion }}` version.
3838

39-
If you specify an API version that is no longer supported, you will receive a `400` error.
39+
If you specify an API version that is no longer supported, you will receive a `410 Gone` response.
4040

4141
## Upgrading to a new API version
4242

@@ -46,12 +46,45 @@ When you update your integration to specify the new API version in the `X-GitHub
4646

4747
Once your integration is updated, test your integration to verify that it works with the new API version.
4848

49+
## API version {% data variables.release-phases.closing_down %}
50+
51+
API versions are supported for 24 months after a newer API version is released.
52+
53+
While a version is within its support window but approaching {% data variables.release-phases.closing_down %}, {% data variables.product.github %} includes the following headers in API responses to help you prepare for migration:
54+
55+
* `Deprecation` — The date when the API version will be {% data variables.release-phases.closing_down %}, formatted as an HTTP date per [RFC 7231](https://tools.ietf.org/html/rfc7231#section-7.1.1.1). For example: `Wed, 27 Nov 2019 14:34:29 GMT`. <!-- markdownlint-disable-line GHD046 -->
56+
* `Sunset` — The date when the API version will be completely removed ({% data variables.release-phases.retired %}), after which requests will return a `410 Gone` response. Follows [RFC 8594](https://tools.ietf.org/html/rfc8594). For example: `Fri, 27 Nov 2020 14:34:29 GMT`. <!-- markdownlint-disable-line GHD046 -->
57+
58+
After the support window ends:
59+
60+
* Requests that specify a {% data variables.release-phases.closing_down %} API version receive a `410 Gone` response.
61+
* Requests that do not specify an API version default to the next oldest supported version, not the {% data variables.release-phases.closing_down %} version. If you rely on unversioned requests, you may observe behavioral changes as older versions are removed from support.
62+
63+
For more information on migrating to a newer API version, see [AUTOTITLE](/rest/about-the-rest-api/breaking-changes).
64+
65+
## Exceptions to standard versioning
66+
67+
In rare cases, {% data variables.product.github %} may make changes outside the normal API versioning cadence. These are exceptional interventions that do not alter the standard versioning guarantees for most integrators.
68+
69+
### Security, availability, and reliability issues
70+
71+
Critical security vulnerabilities, data exposure risks, or severe reliability issues may require changes outside the normal release schedule. {% data variables.product.github %} may release an unscheduled API version, backport fixes to supported versions, or in rare cases, introduce a breaking change to an existing version to protect users and platform integrity.
72+
73+
{% data variables.product.github %} will communicate such changes through release notes, changelogs, and direct communication explaining what changed and why. Where feasible, advance notice will be provided. Immediate action may be taken without advance notice when required.
74+
75+
### Low-usage services
76+
77+
For certain services with very low usage, {% data variables.product.github %} may deprecate functionality outside the standard versioning process. In these cases, {% data variables.product.github %} will communicate the intent and reach out to affected integrators directly.
78+
4979
## Supported API versions
5080

51-
The following REST API versions are currently supported:
81+
The following REST API versions are currently supported.
5282

53-
{% for apiVersion in allVersions[currentVersion].apiVersions %}
54-
{{ apiVersion }}
55-
{% endfor %}
83+
| API version | End of support date |
84+
| --- | --- |
85+
{%- for apiVersion in allVersions[currentVersion].apiVersions %}
86+
{%- assign versionData = tables.rest-api-versions.versions[apiVersion] %}
87+
| `{{ apiVersion }}` | {{ versionData.end_of_support | default: "Not yet scheduled" }} |
88+
{%- endfor %}
5689

5790
You can also make an API request to get all of the supported API versions. For more information, see [AUTOTITLE](/rest/meta/meta#get-all-api-versions).

data/reusables/rest-api/about-api-versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The {% data variables.product.github %} REST API is versioned. The API version name is based on the date when the API version was released. For example, the API version `{{ initialRestVersioningReleaseDate }}` was released on {{ initialRestVersioningReleaseDateLong }}.
22

3-
Breaking changes are changes that can potentially break an integration. We will provide advance notice before releasing breaking changes. Breaking changes include:
3+
Breaking changes are changes that can potentially break an integration. Breaking changes will be released in a new API version. We will provide advance notice before releasing breaking changes. Breaking changes include:
44

55
* Removing an entire operation
66
* Removing or renaming a parameter

data/tables/rest-api-versions.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# REST API calendar date versions and their end of support dates.
2+
# Rendering code lives in content/rest/about-the-rest-api/api-versions.md
3+
4+
versions:
5+
'2022-11-28':
6+
end_of_support: 'March 10, 2028'
7+
'2026-03-10':
8+
end_of_support: ~
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This schema enforces the structure in data/tables/rest-api-versions.yml
2+
3+
export default {
4+
type: 'object',
5+
additionalProperties: false,
6+
required: ['versions'],
7+
properties: {
8+
versions: {
9+
type: 'object',
10+
additionalProperties: {
11+
type: 'object',
12+
additionalProperties: false,
13+
required: ['end_of_support'],
14+
properties: {
15+
end_of_support: {
16+
type: ['string', 'null'],
17+
},
18+
},
19+
},
20+
},
21+
},
22+
}

0 commit comments

Comments
 (0)