LitPage API quickstart
Make your first LitPage API request with curl. Read a public page without a key, then discover your site and list CMS content with a Workspace Key.
Start in a terminal with curl. For the public example you can use the LitPage homepage immediately. To use your own site, create a section-based page in Builder, publish it, and confirm its URL loads in a signed-out window. Note the registered hostname and page path.
1. Read a published page
curl --fail-with-body --get \
'https://build.lit.page/api/delivery/v1/pages/by-path' \
--data-urlencode 'domain=lit.page' \
--data-urlencode 'path=/' \
--header 'Accept: application/json'
This request needs no key. Expect HTTP 200, schemaVersion: 1, kind: "page", and a non-empty content.sections array for the homepage. Read page.path to confirm the page and seo.canonicalUrl to locate its public URL. For a moved path, inspect kind: "redirect" and redirect.location.
If you get a 404, check the hostname, path, publication status, and language. A 422 means the lookup reached a collection entrypoint. The page lookup reference describes every input. See delivery errors for the response body and retry behavior.
2. Find your site for an authorized request
For CMS reads, have a workspace owner or admin create a Read only Workspace Key and load it as LITPAGE_WORKSPACE_KEY in your shell from your secret store. Use a key in the workspace that owns your site.
curl --fail-with-body 'https://build.lit.page/api/v2/sites' \
--header "Authorization: ApiKey ${LITPAGE_WORKSPACE_KEY}"
Look for "success": true and a site in the data array. Match the site's subdomain or customDomain to the site you intend to use, then copy its siteId. If the list is empty or the site is absent, check which workspace issued the key.
3. List CMS documents on that site
SITE_ID='replace-with-data-siteId'
curl --fail-with-body --get \
"https://build.lit.page/api/v2/sites/${SITE_ID}/contents" \
--header "Authorization: ApiKey ${LITPAGE_WORKSPACE_KEY}" \
--data-urlencode 'type=DOC' \
--data-urlencode 'limit=1'
Expect HTTP 200 and a data array with at most one item. An empty array is valid when the site has no matching documents. If an item exists, compare its currentRevisionId with published.revisionId when published is present. They can differ when a document has pending edits. Check pagination.total for the number of matching documents.
A 401 means the key is absent, malformed, expired, revoked, or unrecognized. A 403 indicates access or permission trouble. See the management reference for response fields and the revision checks used when publishing.