Skip to content

POST /api/publish

Summary

Publishes documentation for a repository and returns the published site URL and timestamp.

Intent

Allows authenticated customers to trigger a documentation publish event for a linked repository, returning the associated GitHub Pages URL and the time of publication.

Parameters

NameTypeRequiredDescription
repoIdstringYesThe identifier of the repository whose documentation site should be published.
commitShastringNoThe commit SHA associated with this publish event.
llmsTxtstringNoLLMs.txt content to publish alongside the documentation.
openApiJsonunknownNoOpenAPI JSON specification to publish.
llmsFullTxtstringNoFull LLMs text content to publish alongside the documentation.
mcpJsonunknownNoMCP JSON content to publish alongside the documentation.

Request example

Terminal window
curl -X POST https://maps.google.com/api/publish \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"repoId": "repo-abc123",
"commitSha": "a1b2c3d4e5f6",
"llmsTxt": "# My API\nThis API does X.",
"llmsFullTxt": "# My API\nExtended description.",
"openApiJson": {"openapi": "3.0.0"},
"mcpJson": {}
}'

Response example

{
"ok": true,
"pagesUrl": "https://acme.github.io/my-api-docs",
"publishedAt": "2024-06-15T12:34:56.789Z"
}

Error cases

  • 400 — repoId is missing from the request body
  • 404 — No DocSite exists for the given repoId, or the DocSite belongs to a different customer

Gotchas

  • repoId is the only required field — the request will be rejected with a 400 if it is omitted.
  • The endpoint enforces customer scoping: even if a repoId exists, a 404 is returned if the DocSite does not belong to the authenticated customer. This prevents cross-customer data access but also means you cannot distinguish ‘repo not found’ from ‘repo belongs to someone else’.
  • publishedAt is generated server-side at the moment the request is received; any client-supplied timestamp is ignored.
  • The response reflects the pagesUrl already stored on the DocSite record — this endpoint does not create or update the DocSite, it only records a publish event against an existing one.