OpenAPI spec versions
Track changes to your OpenAPI documents by versioning them.
Keep a history of your OpenAPI specs, enabling you to compare different versions, revert, or maintain multiple concurrent versions for testing or documentation.
The object type, which is always "openapi-spec-version"
Unique identifier
Date of creation
URL where the specification is accessible.
The OpenAPISpecVersion object
{
"object": "openapi-spec-version",
"id": "text",
"createdAt": "2025-06-21T02:26:33.754Z",
"url": "https://example.com",
"urls": {
"location": "https://example.com"
}
}
The unique id of the organization
Slug of the OpenAPI specification
Identifier of the page results to fetch.
The number of results per page
GET /v1/orgs/{organizationId}/openapi/{specSlug}/versions HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"object": "openapi-spec-version",
"id": "text",
"createdAt": "2025-06-21T02:26:33.754Z",
"url": "https://example.com",
"urls": {
"location": "https://example.com"
}
}
]
}
The unique id of the organization
Slug of the OpenAPI specification
GET /v1/orgs/{organizationId}/openapi/{specSlug}/versions/latest HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "openapi-spec-version",
"id": "text",
"createdAt": "2025-06-21T02:26:33.754Z",
"url": "https://example.com",
"urls": {
"location": "https://example.com"
}
}
The unique id of the organization
Slug of the OpenAPI specification
GET /v1/orgs/{organizationId}/openapi/{specSlug}/versions/latest/content HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"filesystem": {},
"url": "https://example.com"
}
The unique id of the organization
Slug of the OpenAPI specification
The unique ID of the OpenAPI specification version
GET /v1/orgs/{organizationId}/openapi/{specSlug}/versions/{versionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "openapi-spec-version",
"id": "text",
"createdAt": "2025-06-21T02:26:33.754Z",
"url": "https://example.com",
"urls": {
"location": "https://example.com"
}
}
The unique id of the organization
Slug of the OpenAPI specification
The unique ID of the OpenAPI specification version
GET /v1/orgs/{organizationId}/openapi/{specSlug}/versions/{versionId}/content HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"filesystem": {},
"url": "https://example.com"
}
Was this helpful?