Explore how adaptive content transforms your docs into a dynamic, tailored experience for every user.
Read the docs
LogoLogo
ProductPricingLog inSign up
  • Documentation
  • Developers
  • Guides
  • Changelog
  • Help Center
  • Getting Started
    • Developer Documentation
    • Quickstart
    • Development
    • Publishing
  • Integrations
    • Introduction
    • Using the CLI
    • Configuration
    • ContentKit
      • Component reference
    • Integration runtime
  • Client library
  • Guides
    • Creating a custom unfurl action
    • Creating interactive blocks
    • Referencing your integration in Markdown
    • Working with HTTP requests
    • Using the CLI in CI/CD
  • GitBook API
    • Introduction
    • Authentication
    • API reference
      • Organizations
        • Organization members
        • Organization invites
        • Organization AI ask
      • Docs sites
        • Site share links
        • Site structure
        • Site auth
        • Site preview
        • Site customization
        • Site spaces
        • Site sections
        • Site section groups
        • Site redirects
        • Site MCP servers
        • Site ads
        • Site users
        • Site insights
        • Site AI ask
      • Collections
        • Collection users
        • Collection teams
      • Spaces
        • Space content
        • Space comments
        • Space embeds
        • Space users
        • Space teams
        • Space integrations
        • Git
      • Change requests
        • Change request content
        • Change request contributors
        • Change request reviewers
        • Change request comments
      • Translations
        • Glossary
      • Integrations
      • URLs
      • OpenAPI
        • OpenAPI spec versions
      • Conversations
      • Custom fonts
      • Subdomains
      • Users
      • Teams
        • Team members
      • SSO
      • Storage
      • Custom hostnames
      • System info
    • Rate limiting
    • Pagination
    • Errors
  • Marketplace
    • Overview
    • Submit your app for review
  • Resources
    • Concepts
    • Changelog
    • ContentKit playground
    • GitHub examples
Powered by GitBook
On this page
  1. GitBook API
  2. API reference
  3. OpenAPI

OpenAPI spec versions

Track changes to your OpenAPI documents by versioning them.

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK
  • The OpenAPISpecVersion object
  • GETList all OpenAPI spec versions
  • GETGet the latest OpenAPI spec version
  • GETGet the latest OpenAPI spec version content
  • GETGet an OpenAPI spec version by its ID
  • GETGet an OpenAPI spec version content by its ID

Was this helpful?

Keep a history of your OpenAPI specs, enabling you to compare different versions, revert, or maintain multiple concurrent versions for testing or documentation.

The OpenAPISpecVersion object

Attributes
objectstring · enumRequired

The object type, which is always "openapi-spec-version"

Possible values:
idstringRequired

Unique identifier

createdAtstring · date-timeOptional

Date of creation

urlstring · uri · max: 2048Required

URL where the specification is accessible.

The OpenAPISpecVersion object

{
  "object": "openapi-spec-version",
  "id": "text",
  "createdAt": "2025-08-26T23:21:56.168Z",
  "url": "https://example.com",
  "urls": {
    "location": "https://example.com"
  }
}

List all OpenAPI spec versions

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

specSlugstringRequired

Slug of the OpenAPI specification

Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

Responses
200

OK

application/json
Responseall of
404

No matching OpenAPI specification found

application/json
get
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-08-26T23:21:56.168Z",
      "url": "https://example.com",
      "urls": {
        "location": "https://example.com"
      }
    }
  ]
}

Get the latest OpenAPI spec version

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

specSlugstringRequired

Slug of the OpenAPI specification

Responses
200

OK

application/json
404

No matching OpenAPI specification version found

application/json
get
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-08-26T23:21:56.168Z",
  "url": "https://example.com",
  "urls": {
    "location": "https://example.com"
  }
}

Get the latest OpenAPI spec version content

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

specSlugstringRequired

Slug of the OpenAPI specification

Responses
200

OK

application/json
404

No matching OpenAPI specification version found

application/json
get
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"
}

Get an OpenAPI spec version by its ID

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

specSlugstringRequired

Slug of the OpenAPI specification

versionIdstringRequired

The unique ID of the OpenAPI specification version

Responses
200

OK

application/json
404

No matching OpenAPI specification version found

application/json
get
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-08-26T23:21:56.168Z",
  "url": "https://example.com",
  "urls": {
    "location": "https://example.com"
  }
}

Get an OpenAPI spec version content by its ID

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

specSlugstringRequired

Slug of the OpenAPI specification

versionIdstringRequired

The unique ID of the OpenAPI specification version

Responses
200

OK

application/json
404

No matching OpenAPI specification version found

application/json
get
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"
}