Skip to content

Hosted Dolt API v1 docs - #149

Merged
tbantle22 merged 5 commits into
devfrom
taylor/hosted-api-v1-docs
Aug 17, 2026
Merged

Hosted Dolt API v1 docs#149
tbantle22 merged 5 commits into
devfrom
taylor/hosted-api-v1-docs

Conversation

@tbantle22

Copy link
Copy Markdown
Collaborator

Documents the new public REST API for Hosted Dolt, under Products → Hosted Dolt → API → v1, mirroring the DoltHub API layout.

Spec vendored from ld at hosted-web/packages/hosted/openapi/v1.yaml (branch taylor/hosted-api-v1-list-instances), the same way specs/dolthub-v2.yaml is.

Shared generator

The DoltHub v2 generator was one 448-line script. Since the Hosted spec deliberately shares DoltHub v2's error model, success envelope, and pagination conventions, the rendering moved to scripts/lib/openapi-docs.mjs and both generators are now thin config:

  • scripts/generate-api-v2.mjs — DoltHub, keeps its Database sub-resource grouping (now an opt-in groups config rather than a hardcoded if (tag === "Database"))
  • scripts/generate-hosted-api-v1.mjs — Hosted (npm run generate-hosted-api-v1)

The refactor was byte-identical on the DoltHub output before any behavior changes.

Pages

Page Source
products/hosted/api/README.md hand-written
products/hosted/api/v1/README.md hand-written — endpoint table, envelope, errors, pagination, stability
products/hosted/api/v1/authentication.md hand-written
products/hosted/api/v1/{user,deployment,models}.md generated — don't hand-edit

Authentication facts (hsat.v1. prefix, /settings/tokens, show-once secret, 30/60/90/365-day expiry with no never-expires option, full user permissions) are verified against ld rather than invented — they live in the app, not the spec.

Two fixes that also touch DoltHub v2

Both were pre-existing generator defects, so fixing them in the shared lib changed the v2 pages too. This is most of the diff in products/dolthub/api/v2/.

Broken schema links in shipped docs. Generated pages linked to models#model-x. Those pages build to <page>/index.html and serve from <page>/, so the link resolved one level too deep — every schema link on the live v2 user/database/operations pages is currently dead, as were the sibling links in the hand-written authentication.md and migration.md. Now site-root-relative; the rehype base-path plugin prefixes /docs.

curl examples dropped required query params. getDeploymentOptions needs ?cloud=; DoltHub's SQL endpoints need ?ref=&q=. Both printed commands that would 400.

Verification

  • npm run build:dolt passes; frontmatter check passes (160 pages)
  • 249 content links across both API trees resolve against the built output, anchors included — previously ~20 were dead
  • New pages appear correctly in nav and llms.txt

One thing to confirm

cypress/fixtures/dolt-pages.ts doesn't list the new pages — but it doesn't list the DoltHub v2 pages either. It's a GitBook migration-parity fixture used by cy:run:live, so adding pages that exist only in the new site would break that run. Worth a call on whether the dead-link crawler should cover these some other way.

tbantle22 and others added 5 commits August 13, 2026 11:59
The DoltHub v2 generator was one 448-line script. Hosted's v1 API needs the
same rendering — its spec deliberately shares DoltHub v2's error model,
success envelope, and pagination conventions — so the rendering moves to
scripts/lib/openapi-docs.mjs and generate-api-v2.mjs becomes config.

The only DoltHub-specific behaviour left is the Database tag's sub-resource
grouping, now an opt-in `groups` config rather than `if (tag === "Database")`.

Two defects fixed along the way, which is why the v2 pages change:

Schema links resolved one level too deep. Pages build to <page>/index.html
and are served from <page>/, so a sibling-relative `models#model-user` from
the user page resolved to .../user/models — dead on every generated v2 page,
and in the hand-written authentication.md and migration.md too. Links are now
site-root-relative; the rehype base-path plugin prefixes the site base.

curl examples dropped required query parameters, so the command as printed
was a 400. The SQL endpoints need ?ref=&q=; they now carry the spec's own
example values.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Documents the new public REST API for the Hosted control plane, under
Products > Hosted Dolt > API > v1, mirroring the DoltHub API layout.

specs/hosted-v1.yaml is vendored from ld's
hosted-web/packages/hosted/openapi/v1.yaml, the same way the DoltHub v2 spec
is. user.md, deployment.md, and models.md are generated from it by
scripts/generate-hosted-api-v1.mjs (npm run generate-hosted-api-v1) — never
hand-edit them.

The two READMEs and authentication.md are hand-written. The authentication
page documents the hsat.v1. token prefix, the settings/tokens flow, the
show-once secret, and the fixed expiry options, all of which live in ld
rather than in the spec.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Re-vendors specs/hosted-v1.yaml from ld main (1c62599829e), replacing the copy
taken from the taylor/hosted-api-v1-list-instances branch, and regenerates
deployment.md and models.md from it.

The changes are all prose — no endpoints, schemas, or fields moved (still 6
operations and 17 schemas). Two are rewordings of the create-deployment 5xx
guidance and the pagination description. The third is a real contract detail:
next_page_token is now documented as absent on the last page rather than
"absent or empty", and `meta` is omitted entirely there.

That last one also invalidated a hand-written sentence in v1/README.md, which
told clients to treat an empty token as the end of results. Updated to match:
presence of the token is the only check needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The sections sit directly under API rather than behind a "v1" node — with one
version shipped, that layer was a click with nothing to choose. Every path
still carries /v1/, so adding a v2 later reintroduces the version layer without
moving any of these URLs.

The v1 overview page is kept in the tree as "Overview". It holds the endpoint
table, response envelope, error model, and stability policy, so dropping the
v1 node without it would have left that page reachable only by inbound link.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tbantle22
tbantle22 marked this pull request as ready for review August 17, 2026 18:07
@tbantle22
tbantle22 merged commit 7312c42 into dev Aug 17, 2026
7 checks passed
@tbantle22
tbantle22 deleted the taylor/hosted-api-v1-docs branch August 17, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant