Skip to Content

Publish an API Document

Publishing releases a version of your API documentation from one commit. The version includes:

  • the OpenAPI specs, AsyncAPI documents and GraphQL schemas at that commit
  • the Markdown documents at that commit
  • the navigation and theme from that commit’s apigit.json

A version is a name pointing at a commit, so a publish is instant and shows exactly what was committed. Publish as many versions as your plan allows. Versions are identified by name, so any number of them can point at one commit.

Version names llms.txt, llms-full.txt, skill.md and mcp are reserved for agent addresses and cannot be used for a new version or a rename.

Preview before you publish

A publish shows exactly what was committed, so it helps to see the result first. In the editor, the Preview tab renders the file you are working on. In a clone of the repository, the command line shows the whole site, with its navigation and theme, as the published page will draw it:

apigit preview

It serves your working copy on your own machine and reloads as you edit; see Preview the site on your machine.

Where to publish

From a branch

Open the repository, switch to the branch, click Publish, and choose Publish API & Doc. Only a publish from a branch can follow that branch.

Publish API Document from a branch

From a specific commit

Open the commit list and publish from any commit in the history. This is useful for documenting an earlier release. A publish from a commit is always pinned.

Publish API Document from a commit

While editing

In editing mode, click Publish and choose a commit, without leaving the editor.

Publish API Document while editing

The publish dialog

Publish API Document dialog

OptionWhat it sets
Publish TargetThe branch and commit being published
Update StrategyPin to commit, the default, or Follow branch (paid plans)
Publish ModeShown when the repository already has a version: Overwrite an existing document publish or New document publish
VersionThe version’s name, such as 2.1 or next. It is part of the URL and unique within the repository.
DescriptionA note shown in the version list
Try It OutLets readers send requests from OpenAPI operations, on every plan
Access ControlWho can read this version. See Share API Documents.

Pin or follow a branch

Pin to commitFollow branch
ShowsThe commit it was published fromThe head of the branch
UpdatesWhen you publish it againAutomatically, at every update of the branch
Good forReleased versions that must not changeA next or preview version
PlansEvery planTeam and Enterprise

Pinning is the default. A following version moves within seconds of a push, a merged pull request, a file saved in the APIGit editor, or a pull-mirror sync. Its URL, access control, external viewers and shared links stay the same. If an update is ever missed, the version catches up within about 10 minutes.

To change the strategy later, open the version and use Update Strategy. Pin to commit it serves now keeps the current commit. Follow branch moves the version to the head of the chosen branch at once.

Update Strategy on a published document

⚠️

A following version shows the branch as it is, and nothing is checked first. Follow a branch that only takes reviewed changes, and use branch protection if readers outside your team can see the version.

If the branch is deleted, or the publisher’s account moves to the Free plan, the version stays on its last commit and its page shows why. Follow another branch or pin it.

Overwrite a version

To move a version to a new commit, choose Overwrite an existing document publish and pick the version. An overwrite keeps its URL, access control, external viewers and shared links. Other versions at the old commit do not move, and deleting a version removes only that version.

View published documents

Open the repository’s Publish Center for all its versions, with each one’s commit, access and link:

Published versions of a repository

Open a version to see whether it is pinned or following, and to manage it:

A published version's page

To see the documents of all your repositories, click Publishes Center in the top navigation.

All published documents

Last updated on