Documentation menu

Documentation › Reference

HTTP API

Every route the Galley server answers — what it does, what it takes and returns, who may call it — with authentication, the error shape and the live event stream. Generated from ApiRoutes.

This page is for developers integrating with Galley — scripts, CI jobs, other tools. The web app uses exactly this API and nothing else: its client is typed from the ApiRoutes map in packages/core/src/api.ts, where every request and response type named below is defined. This page is generated from that file (apps/site/scripts/reference-api.mjs), so it lists every route there is. The API is at version 0.1 and may change before 1.0.

Link to this section: Conventions

  • JSON in, JSON out. File and entry paths travel in the query string or the body, never as an address segment, relative to the site's folder with / separators: ?path=src/content/journal/why-we-make-forty.md.
  • Who may call. A few routes answer anyone (No sign-in below): GET /api/meta, sign-in, sign-out, and on a hosted install the three one-time-link routes, where the link's code is the proof. Every other route needs a session: the browser's session cookie, or Authorization: Bearer <token>. On your own computer the token is the one in the link Galley prints (set your own with GALLEY_TOKEN, 16 characters or more); in hosted mode set GALLEY_TOKEN on the server to allow Bearer access at all.
  • Roles, on a hosted install. Each person who signs in is an owner, an editor or a contributor, and the Who column is the level each route needs there, read from the one table the server enforces (packages/core/src/install/route-access.ts): Any signed-in person, Editors and owners, or Owners. Someone signed in below a route's level gets 403. First run routes take the one-time setup code as the Bearer token until the first owner exists, and need an owner after that. The operator's GALLEY_TOKEN reaches every route except those that need a person: your own account, people, backups, restores and opening the preview. The levels apply only on a hosted install: the app on your own computer has one person, who may call every route.
  • State-changing requests (POST, PUT, PATCH, DELETE) also need the Bearer token, or a same-origin Origin header. Request bodies are limited to 40 MB.
  • Site routes (/api/sites/:siteId/…) run with that site's own keys and author when it has them (Look after many sites).
  • Addresses under /api/x/ are not Galley's and are not on this page: they belong to whoever built the edition of the editor you are talking to (Embedding the editor).
  • Errors are { "error": { "code", "message", "detail"? } } with a matching status. message is written for a person; detail carries the technical cause when it is safe to show.
codeStatusMeans
invalid400Bad input, named: “url” isn't right: it must be an https or ssh address.
unconfigured400Something needs setting up first — a key, an image provider. A host refusing a key is also unconfigured, never 401.
unauthorized401No session, or a Bearer token that isn't valid.
forbidden403Not writable in this mode, outside the site, a failed Host or Origin check, or (on a hosted install) a role below the route's level.
not-found404No such site, entry, file, job, conversation or route.
conflict409The file changed since it was read (baseHash), or a name is taken.
busy409, or 429 for too many triesSomething is already running — a reply, a publish — or too many tries at signing in, a setup code or a one-time link.
git, preview, internal500A git command, the preview, or something unexpected failed.
ai502The model or image provider failed.
curl -s -H "Authorization: Bearer $GALLEY_TOKEN" http://127.0.0.1:4400/api/sites

In the tables, Takes is the query (?…) and body; Returns is the response type, both named as in api.ts. A response of a file or a stream isn't JSON.

Addresses outside /api have their own rules: /mcp (the MCP endpoint, Bearer only), /f/:siteId (form submissions from the site's own pages — Forms for developers), and on a hosted install /healthz and /readyz, which answer anyone and say nothing about the install (Run a hosted install).

Link to this section: Meta and sign-in

RouteDoesTakesReturnsWho
GET /api/metaVersion, brand, mode (local or hosted), whether the caller is signed in, whether the desktop app is the host. Answers without a session, with less detail.—MetaInfoNo sign-in
POST /api/auth/loginHosted install: sign in with an e-mail and password (the password alone for an owner from before accounts, who has no e-mail yet); sets the session cookie. Rate-limited.{ password, email? }OkNo sign-in
POST /api/auth/logoutClear and revoke the session.—OkNo sign-in
GET /api/eventsThe live event stream (below).—a streamAny signed-in person

Link to this section: Settings

RouteDoesTakesReturnsWho
GET /api/settingsModel and effort, image and video choices, author, theme, previews, and each key's status (never its value).—SettingsAny signed-in person
PATCH /api/settingsChange any of those.SettingsPatchSettingsOwners
PUT /api/secrets/:nameSave a shared key — anthropic, openai, google, cloudflare or vercel; null removes it. Returns its status only.{ value }SecretStatusOwners
GET /api/usageWhat the assistant and image generation cost at list prices: today, 7 and 30 days, all time, per model.—UsageSummaryOwners

Link to this section: Themes for the app (docs/themes.md)

RouteDoesTakesReturnsWho
GET /api/themesThe themes saved for everyone here, the ones plugins add, and the install's default.—ThemesInfoAny signed-in person
PUT /api/themes/:themeIdSave a theme for everyone here (adding or replacing).{ theme }SavedThemeOwners
DELETE /api/themes/:themeIdDelete a theme saved for everyone here.—OkOwners

Link to this section: Sites

RouteDoesTakesReturnsWho
GET /api/sitesThe sites in this app's list, with their group, note and what each is waiting on.—SiteSummary[]Any signed-in person
POST /api/sites/openAdd and open a folder (an absolute path). A hosted install refuses it (403): it looks after one site.OpenSiteRequestSiteDetailOwners
POST /api/sites/cloneClone a repository into the sites folder, as a job. Refused on a hosted install.CloneSiteRequestJobOwners
POST /api/sites/createCreate a site from a starter, as a job. Refused on a hosted install.CreateSiteRequestJobOwners
GET /api/startersThe starters and their looks.—StarterInfo[]Any signed-in person
GET /api/starters/:starterId/previewA starter's preview image, or one of its looks' (look) — only images its starter.json declares.?look?a fileAny signed-in person
GET /api/jobs/:jobIdA job's state, progress and result.—JobAny signed-in person
GET /api/openA deep link from the site's own dev toolbar (/open?root=&url=): the site whose folder is root, and the entry behind url.?root&url?{ state, siteId, entry } or { state, name, root }Owners
GET /api/fs/listFolders on this computer's disk, for the folder picker; marks the ones that look like sites. Refused on a hosted install.?path?{ path, parent, entries }Owners
GET /api/sites/:siteIdThe site, with its full model (detection merged with the config file).—SiteDetailAny signed-in person
DELETE /api/sites/:siteIdForget the site, its own keys and author. Its files stay on disk. Refused on a hosted install.—OkOwners
POST /api/sites/:siteId/refreshRun detection again.—SiteModelAny signed-in person
GET /api/sites/:siteId/configThe site's galley.config.json (or null) and the model detection found before it.—{ config, detected, hash }Any signed-in person
PUT /api/sites/:siteId/configReplace galley.config.json. Validated; refused when invalid.{ config, baseHash? }SiteModelOwners

Link to this section: Content

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/entriesOne collection's entries: collection plus search, status, sort, order, offset, limit.?collection } & EntryQuery optionsEntryListAny signed-in person
GET /api/sites/:siteId/entryOne entry: parsed data, body, raw text, hash, fields and validation issues.?pathEntryAny signed-in person
PATCH /api/sites/:siteId/entryEdit an entry with surgical operations; baseHash refuses a stale edit.?path { ops, baseHash? }EditResultAny signed-in person
POST /api/sites/:siteId/entriesCreate an entry (optionally from a template).CreateEntryInputEntryAny signed-in person
DELETE /api/sites/:siteId/entryDelete an entry.?pathOkAny signed-in person
GET /api/sites/:siteId/searchSearch every editable string.?q&collection?&limit?SearchHit[]Any signed-in person
POST /api/sites/:siteId/resolveClick to edit: which field holds this text on this page — unique, ambiguous or none (Never guess).ResolveRequestResolveResultAny signed-in person
GET /api/sites/:siteId/routeThe entry behind a page address.?url{ entry }Any signed-in person
POST /api/sites/:siteId/validateValidate these files, or everything pending.{ paths? }{ issues }Any signed-in person

Link to this section: Forms

RouteDoesTakesReturnsWho
POST /api/sites/:siteId/forms/introspectRead the field list of an existing form on a provider's side (HubSpot, Marketo — those whose catalogue entry says canImportFields), so the form builder can add matching fields and their mapping in one go.FormIntrospectRequestFormIntrospectResultAny signed-in person
GET /api/sites/:siteId/formsEvery form of the site with what the forms list shows: definition, status, the pages that use it.—{ forms }Any signed-in person
GET /api/sites/:siteId/kitWhat the site has of the site kit, and what "Set it up for me" would do.—SiteKitStatusAny signed-in person
POST /api/sites/:siteId/kit/setup"Set it up for me": starts a job (kind "kit-setup") that adds the kit and wires what is unambiguous, as pending changes.—JobAny signed-in person
POST /api/sites/:siteId/kit/visibilityOnly the step that publishes the version AI assistants can read: the kit's build step in astro.config and src/data/visibility.json (updating the kit's files when they predate it).—JobAny signed-in person
POST /api/sites/:siteId/kit/endpointPoints the live site's forms at this app's inbox: writes the capture address into the kit's settings as a pending change.—SiteKitStatusAny signed-in person

Link to this section: Form inbox

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/inboxForms with their counts; unread is the total for the sidebar badge.—{ forms, unread }Editors and owners
GET /api/sites/:siteId/inbox/:formIdOne form's submissions, newest first.?filter?&q?&offset?&limit?SubmissionListEditors and owners
GET /api/sites/:siteId/inbox/:formId/exportThe submissions as a CSV file (UTF-8 with BOM, the form's field order, labels as headers).?filter?a fileEditors and owners
GET /api/sites/:siteId/inbox/:formId/:submissionIdOne submission in full.—FormSubmissionEditors and owners
PATCH /api/sites/:siteId/inbox/:formIdMark read/unread and spam/not spam.{ ids, read?, spam? }{ items }Editors and owners
POST /api/sites/:siteId/inbox/:formId/deleteDelete for good; the removed submissions come back so Undo can restore them.{ ids }{ deleted }Editors and owners
POST /api/sites/:siteId/inbox/:formId/restoreUndo a delete.{ submissions }{ restored }Editors and owners
POST /api/sites/:siteId/inbox/:formId/:submissionId/retrySend again to one server-side destination (its index), or the e-mail notification.{ destination }FormSubmissionEditors and owners
GET /api/sites/:siteId/captureThe site's capture settings: e-mail alerts, forwarding, spam rules, whether a capture key is set.—CaptureSettingsEditors and owners
PATCH /api/sites/:siteId/captureChange the capture settings.CaptureSettingsPatchCaptureSettingsOwners
POST /api/sites/:siteId/capture/keyMake a new capture key (shown once, in key) or remove it.{ action }{ settings, key }Owners

Link to this section: Files (the source view)

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/filesFiles matching a glob (ignored folders left out).?glob?&limit?{ files }Any signed-in person
GET /api/sites/:siteId/fileOne file's text and hash.?path{ path, content, hash, binary }Any signed-in person
PUT /api/sites/:siteId/fileWrite one file; mode defaults to content (Modes).?path { content, baseHash?, mode? }OkAny signed-in person

Link to this section: Media

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/mediaThe media library.—MediaLibraryAnswerAny signed-in person
POST /api/sites/:siteId/mediaUpload a file as a data: URL, 25 MB at most.{ filename, directory?, data }MediaItemAny signed-in person
DELETE /api/sites/:siteId/mediaDelete a media file.?pathOkAny signed-in person

Link to this section: Media storage: a bucket, and pictures in Cloudflare Images

RouteDoesTakesReturnsWho
GET /api/media-storage/connectorsThe kinds of bucket a site can keep its media in, with the steps on the provider's side.—{ connectors }Any signed-in person
GET /api/sites/:siteId/media/storageWhere the site keeps new media, whether its keys are set (never the keys), and how many files are where.—MediaStorageStatusAny signed-in person
POST /api/sites/:siteId/media/storage/checkRun the check — on the body's settings (nothing is saved), or on the saved ones.Partial<MediaConnectRequest>MediaCheckResultOwners
PUT /api/sites/:siteId/media/storageCheck, and only when that passes save the settings (galley.config.json media.storage) and any pasted keys.MediaConnectRequestMediaConnectResultOwners
DELETE /api/sites/:siteId/media/storageStop putting new media in the bucket.?forgetKeys?MediaStorageStatusOwners
POST /api/sites/:siteId/media/images/checkRun the Cloudflare Images check — on the body's settings (nothing is saved), or on the saved ones.Partial<MediaImagesConnectRequest>MediaCheckResultOwners
PUT /api/sites/:siteId/media/imagesCheck, and only when that passes keep pictures in Cloudflare Images (galley.config.json media.images).MediaImagesConnectRequestMediaImagesConnectResultOwners
DELETE /api/sites/:siteId/media/imagesPictures go where other files go again.?forgetKeys?MediaStorageStatusOwners
POST /api/sites/:siteId/media/storage/make-bucket"Make the bucket for me": an R2 bucket and its r2.dev address, with the site's Cloudflare key (it needs Workers R2 Storage › Edit).{ account, name }{ created, config }Owners
DELETE /api/sites/:siteId/media/storage/made-bucketRemove the bucket Galley made — only that one, once the site no longer uses it and it is empty.—MediaStorageStatusOwners
GET /api/sites/:siteId/media/usageWhere an address is used: pages of the working copy (with titles) and files of the published version.?urlMediaUsageAny signed-in person
POST /api/sites/:siteId/media/storage/deleteDelete files from the bucket or Cloudflare Images, for good (it can't be discarded).{ paths }MediaStoreDeleteResultEditors and owners
POST /api/sites/:siteId/media/storage/move/planWhat moving files (to the bucket and back) or changing the bucket's address would do.MediaMoveRequestMediaMovePlanOwners
POST /api/sites/:siteId/media/storage/moveDo it, as a Job (kind "media"): copy, rewrite the pages, remove what nothing reaches.MediaMoveRequestJobOwners
GET /api/sites/:siteId/rawA file's bytes from the working tree, or from the last version with rev=base, for thumbnails and before/after pictures.?path&rev?a fileAny signed-in person

Link to this section: Image generation

RouteDoesTakesReturnsWho
GET /api/images/providersThe image generators and whether each is ready.—{ providers }Any signed-in person
POST /api/sites/:siteId/images/generateMake candidate images from a description.ImageGenRequest{ candidates }Any signed-in person
GET /api/images/candidates/:candidateIdA candidate image's bytes.—a fileAny signed-in person
POST /api/sites/:siteId/images/saveSave a candidate into the site's media.ImageSaveRequestMediaItemAny signed-in person
DELETE /api/images/candidates/:candidateIdThrow a candidate image away.—OkAny signed-in person

Link to this section: Video generation

RouteDoesTakesReturnsWho
GET /api/videos/providersThe video generators, their models, prices and whether each is ready.—{ providers }Any signed-in person
POST /api/sites/:siteId/videos/generateStart making a video; progress arrives as job events.VideoGenRequestJobAny signed-in person
GET /api/videos/jobs/:jobIdA video generation's state and its candidates.—VideoJobStatusAny signed-in person
GET /api/videos/candidates/:candidateIdA candidate video's bytes.—a fileAny signed-in person
POST /api/sites/:siteId/videos/saveSave a candidate video into the site's media.VideoSaveRequestMediaItemAny signed-in person
DELETE /api/videos/candidates/:candidateIdThrow a candidate video away.—OkAny signed-in person

Link to this section: Plugins

RouteDoesTakesReturnsWho
GET /api/pluginsBuilt-in and installed plugins, with what each adds, its problems and its settings (secrets as status only).—PluginListAny signed-in person
GET /api/sites/:siteId/pluginsThe same, plus the plugins this site's configuration names.—PluginListAny signed-in person
POST /api/plugins/enabledTurn a plugin on or off (kept across restarts).{ name, enabled, siteId? }PluginInfoOwners
PUT /api/plugins/settingsSave some of a plugin's settings; null removes a value.{ name, values, siteId? }PluginInfoOwners
GET /api/catalogEvery catalogue, merged from the enabled plugins.—PluginCatalogAny signed-in person
GET /api/sites/:siteId/catalogThe same, with this site's own plugins included.—PluginCatalogAny signed-in person
GET /api/sites/:siteId/data-sources/:sourceIdA plugin's data source, for a field's picker: search it (q, up to limit — default 12, at most 50) or look up the value a file holds (value).?q?&value?&limit?DataSourceAnswerAny signed-in person

Link to this section: Proof and publish

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/changesEverything pending, per file, with field-level changes (example).—ChangeSetAny signed-in person
GET /api/sites/:siteId/diffOne file's before and after, with hunks.?pathFileDiffAny signed-in person
POST /api/sites/:siteId/discardDiscard these files' changes, or everything pending.{ paths? }ChangeSetAny signed-in person
POST /api/sites/:siteId/publishPublish: commit (and push), or a branch and pull request (Publishing).PublishRequestPublishResultEditors and owners
GET /api/sites/:siteId/historyPublished versions, newest first.?limit?{ items }Any signed-in person
POST /api/sites/:siteId/revertUndo a publish with a new version that reverses it.{ commit }PublishResultEditors and owners
POST /api/sites/:siteId/sendSend versions published on this computer that have not reached the remote yet.—PublishResultEditors and owners
GET /api/sites/:siteId/gitBranch, remote, ahead and behind, as of the last look at the code host (checkedAt).—GitStatusAny signed-in person
POST /api/sites/:siteId/git/checkAsk the code host what is new (a fetch), changing no file: the status as of now, or why it couldn't look (checkProblem).—GitStatusAny signed-in person
POST /api/sites/:siteId/pullBring the site up to date: fetch, then git merge --ff-only. A running preview is stopped first and started again on the new files.—GitStatusEditors and owners
POST /api/sites/:siteId/publish/messageSuggest a one-line note for Version history. Uses the assistant (one request) when a key is set.{ paths? }{ message }Editors and owners
POST /api/sites/:siteId/publish/checkWhat the plugins' publish checks say about publishing these changes (all pending when paths is absent): warnings to show first, and whether one would stop the publish.{ paths? }PublishCheckAny signed-in person

Link to this section: Preview and build

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/previewThe preview's state, addresses and log.—PreviewStatusAny signed-in person
POST /api/sites/:siteId/preview/startStart the preview (The preview).—PreviewStatusAny signed-in person
POST /api/sites/:siteId/preview/stopStop it.—PreviewStatusAny signed-in person
POST /api/sites/:siteId/preview/restartRestart it.—PreviewStatusAny signed-in person
POST /api/sites/:siteId/buildRun the site's build and return the end of its output.—BuildResultAny signed-in person

Link to this section: Putting the site online

RouteDoesTakesReturnsWho
GET /api/deploy/targetsThe hosts a site can be put online with, what setting each up needs, and whether its access key is present.—{ targets }Any signed-in person
POST /api/deploy/targets/:targetId/connectCheck an access key works; the accounts (Cloudflare) or teams (Vercel) it can use.{ key? }{ accounts }Owners
POST /api/sites/:siteId/deploy/checkWhether a project name can be used in that account.{ target, account, project }DeployProjectCheckEditors and owners
GET /api/sites/:siteId/deployThe site's deploy settings, latest deployments, the running (or last) deploy job, and how far behind the live site is.—DeployStatusAny signed-in person
PUT /api/sites/:siteId/deployChange the site's deploy settings (galley.config.json deploy).Partial<DeployConfig>DeployStatusOwners
POST /api/sites/:siteId/deploy/live-addressUse the live address as the site's urls.production (what Proof compares against).—DeployStatusOwners
POST /api/sites/:siteId/deployStart a deploy: "production" puts the published version live; "preview" puts the working tree, pending changes included, at an address of its own.{ kind, label? }JobEditors and owners
GET /api/sites/:siteId/deploymentsDeployments made from this computer, newest first.?limit?{ items }Any signed-in person
POST /api/sites/:siteId/deploy/domain/planWhat using this address as the site's own would do.{ hostname }DomainPlanOwners
POST /api/sites/:siteId/deploy/domainUse the address (after the person said yes to the plan): attach it and wait until it answers over HTTPS.{ hostname }JobOwners
POST /api/sites/:siteId/deploy/domain/checkLook again at an address that isn't answering yet.—JobOwners
DELETE /api/sites/:siteId/deploy/domainStop using the site's own address: detached only if Galley attached it; the host's address becomes the live one again.—DeployStatusOwners

Link to this section: Redirects

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/redirectsThe list, its checks, where it takes effect (the host and its file), what can be imported, and the Cloudflare state.—RedirectsOverviewAny signed-in person
PUT /api/sites/:siteId/redirectsReplace the list (inline edits, add one, delete, Undo).{ redirects, baseHash? }RedirectsOverviewAny signed-in person
POST /api/sites/:siteId/redirects/review"Add many": what a pasted list (or a file in the site, path) would do.RedirectImportBodyImportReviewAny signed-in person
POST /api/sites/:siteId/redirects/importAdd what review showed, as one pending change.RedirectImportBody & { baseHash? }{ overview, review }Any signed-in person
POST /api/sites/:siteId/redirects/try"Try an address": where a visitor ends up, through which rules.{ address }RedirectTraceAny signed-in person
PUT /api/sites/:siteId/redirects/settingsChoose the host (when the deploy settings don't say), the Cloudflare account and the site's own domains.{ host?, cloudflare? }RedirectsOverviewOwners
POST /api/sites/:siteId/redirects/derived/replaceReplace a host file that was edited by hand (or was the site's own) with one written from the list.—RedirectsOverviewAny signed-in person
POST /api/sites/:siteId/redirects/leftover/removeRemove a redirect file this app wrote for a host the site no longer uses.{ path }RedirectsOverviewAny signed-in person
GET /api/sites/:siteId/redirects/exportThe list in a host's format, as a download.?format&hostname?a fileAny signed-in person
GET /api/sites/:siteId/redirects/healthRedirects that lead nowhere now, and old addresses the site's own pages still link to.—RedirectHealthAny signed-in person
POST /api/sites/:siteId/redirects/cloudflare/planWhat setting them on Cloudflare would add, change and remove.—CloudflarePlanEditors and owners
POST /api/sites/:siteId/redirects/cloudflare/applyApply a plan (refused when anything moved since).{ planId }JobEditors and owners
POST /api/sites/:siteId/redirects/cloudflare/checkCheck Cloudflare's copy matches the list.—CloudflareCheckEditors and owners
POST /api/sites/:siteId/redirects/cloudflare/removeTake this app's list and rule off Cloudflare (nothing else there is touched).—RedirectsOverviewEditors and owners

Link to this section: Assistant

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/threadsThe site's assistant conversations.—{ threads }Any signed-in person
POST /api/sites/:siteId/threadsStart a conversation.{ title?, mode? }ChatThreadAny signed-in person
GET /api/sites/:siteId/threads/:threadIdOne conversation, with its messages.—ChatThreadAny signed-in person
PATCH /api/sites/:siteId/threads/:threadIdRename a conversation.{ title }ChatThreadSummaryAny signed-in person
DELETE /api/sites/:siteId/threads/:threadIdDelete a conversation.—OkAny signed-in person
POST /api/sites/:siteId/threads/:threadId/messagesSend a message (text, pictures, mode, page context). The reply streams over /api/events.SendMessageRequest{ turnId }Any signed-in person
POST /api/sites/:siteId/threads/:threadId/cancelStop the reply in progress.—OkAny signed-in person
POST /api/sites/:siteId/threads/:threadId/undoUndo one assistant turn: the files it changed are put back, except those changed again since, which are left as they are and listed in left.{ turnId }UndoResultAny signed-in person

Link to this section: Multi-site

RouteDoesTakesReturnsWho
GET /api/groupsGroups (clients) in the order the person arranged them.—SiteGroup[]Any signed-in person
POST /api/groupsMake a group.SiteGroupInputSiteGroupOwners
PATCH /api/groups/:groupIdRename, recolour or fold a group.SiteGroupInputSiteGroupOwners
DELETE /api/groups/:groupIdRemove a group. Its sites stay in the list, ungrouped.—OkOwners
PUT /api/groups/orderPut the groups in a new order (every group's id).{ ids }SiteGroup[]Owners
PATCH /api/sites/:siteId/listingFile a site: group, pin, note.SitePatchSiteSummaryOwners
POST /api/sites/scanLook for sites inside a folder (one or two levels down).ScanSitesRequestScanSitesResultOwners
POST /api/sites/scan/cancelStop a scan started with that id.{ id }OkOwners
POST /api/sites/addAdd several folders at once, each checked as POST /api/sites/open checks one.AddSitesRequestAddSitesResultOwners
GET /api/sites/:siteId/thumbnailThe site's own share image, for the list.?v?a fileAny signed-in person
POST /api/sites/:siteId/presenceAn editor is open on the site: its preview isn't stopped as unused.—OkAny signed-in person
GET /api/sites/:siteId/connectionsWhich key and author each connection uses for this site.—SiteConnectionsOwners
PUT /api/sites/:siteId/secrets/:nameThis site's own key; value: null removes it (the shared key is used again).{ value }SiteConnectionsOwners
PUT /api/sites/:siteId/authorThis site's own publishing author; null removes it.{ author }SiteConnectionsOwners
GET /api/sites/:siteId/usageThis site's assistant use.—UsageSummaryOwners
GET /api/usage/sitesEvery site's assistant use: the last 30 days and in all.—{ sites }Owners

Link to this section: Search and AI checks

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/visibilityRun the Search and AI checks. render=off checks the content files only; by default a running preview or an existing build is used, never started.?render?SiteAuditAny signed-in person
GET /api/sites/:siteId/visibility/entryOne entry: its result preview (an approximation) and findings, judged against the whole site.?path&render?EntryAuditAny signed-in person
POST /api/sites/:siteId/visibility/fixApply the deterministic fixes of these findings (ids from the last audit) as ordinary edits.{ ids }FixResultAny signed-in person
POST /api/sites/:siteId/visibility/undoPut back every file one batch of fixes changed, except those changed again since, which are left as they are and listed in left.{ undoId }UndoResultAny signed-in person
GET /api/sites/:siteId/visibility/crawlersEach documented AI crawler and whether the site allows it.—CrawlerReportAny signed-in person
PUT /api/sites/:siteId/visibility/crawlersAllow or block documented AI crawlers by robots.txt token; only a marked block of robots.txt changes.{ choices }CrawlerReportAny signed-in person
GET /api/sites/:siteId/visibility/agent-viewWhat an AI agent receives for one page: its markdown version, else its text with scripts off.?urlAgentViewAny signed-in person
POST /api/sites/:siteId/visibility/write/planWhat an assistant-written batch would do: the pages, and one model request per page.{ kind, paths? }WritePlanAny signed-in person
POST /api/sites/:siteId/visibility/writeStart the batch as a job; results land in Proof.{ kind, paths?, limit? }WriteBatchStatusAny signed-in person
GET /api/sites/:siteId/visibility/write/:jobIdAn assistant-written batch's progress.—WriteBatchStatusAny signed-in person
POST /api/sites/:siteId/visibility/write/:jobId/cancelStop the batch; what is written stays in Proof.—OkAny signed-in person
POST /api/sites/:siteId/visibility/external-linksCheck links to other sites — only when asked: a few at a time, capped.{ limit? }{ checked, total, findings }Any signed-in person
POST /api/sites/:siteId/import/uploadUpload an export file, one chunk at a time (base64, at most 8 MB each, 200 MB in all).{ uploadId?, name, total, offset, chunk }{ uploadId, received, upload }Any signed-in person
POST /api/sites/:siteId/import/inspectThe quick look: is it WordPress, can its content be read, how much is there.{ source }ImportInspectionAny signed-in person
POST /api/sites/:siteId/import/planWhat would come across and what wouldn't, with the questions that need a person (answered with their defaults until answered).{ source, answers? }ImportPlanViewAny signed-in person
POST /api/sites/:siteId/import/runStart bringing it over: a Job (kind "import").{ source, answers? }ImportRunStatusAny signed-in person
GET /api/sites/:siteId/import/runs/:runIdAn import's progress.—ImportRunStatusAny signed-in person
POST /api/sites/:siteId/import/runs/:runId/cancelStop part-way: what already arrived is kept as pending changes.—ImportRunStatusAny signed-in person
GET /api/sites/:siteId/import/reportThe last import's report for this site, or null.—{ report }Any signed-in person
POST /api/sites/:siteId/import/rebuildOpen the assistant (build mode) on one page-builder page, with its prepared rebuild brief.{ path }{ threadId, turnId }Any signed-in person
GET /api/sites/:siteId/import/rebuild-allWhat "Rebuild all" would do, and its estimated cost.—ImportRebuildPlanAny signed-in person
POST /api/sites/:siteId/import/rebuild-allRebuild the pages one after another, each its own conversation; a Job (kind "import").{ paths? }ImportRebuildStatusAny signed-in person
GET /api/sites/:siteId/import/rebuild-all/:jobIdA Rebuild all run's progress.—ImportRebuildStatusAny signed-in person
POST /api/sites/:siteId/import/rebuild-all/:jobId/cancelStop Rebuild all after the page in hand.—ImportRebuildStatusAny signed-in person

Link to this section: The site's brand

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/brandThe saved brand, the material, the proposal under review, the analysis in progress, and what the assistant receives.—SiteBrandStateAny signed-in person
POST /api/sites/:siteId/brand/analyseRead the brand: from the site (measurements are the overlay's measure answers for a few pages) or from the added material.{ from, measurements?, sources? }JobAny signed-in person
POST /api/sites/:siteId/brand/cancelStop reading the brand.—OkAny signed-in person
POST /api/sites/:siteId/brand/sourcesAdd material, one chunk at a time (base64, at most 8 MB each).{ uploadId?, name, note?, total, offset, chunk, preview? }{ uploadId, received, source }Any signed-in person
POST /api/sites/:siteId/brand/websiteRead a website's address as material (public https addresses only).{ url }BrandSourceAny signed-in person
PATCH /api/sites/:siteId/brand/sources/:sourceIdChange a piece of material's note, or leave it out of the reading.{ note?, ignored? }BrandSourceAny signed-in person
DELETE /api/sites/:siteId/brand/sources/:sourceIdRemove a piece of material.—OkAny signed-in person
GET /api/sites/:siteId/brand/sources/:sourceId/fileThe file (kind=original) or the picture the model saw (kind=picture).?kind?a fileAny signed-in person
PUT /api/sites/:siteId/brand/proposalChange the proposal (an edited brand) and answer its questions (question id → option value).{ brand?, answers? }BrandProposalAny signed-in person
DELETE /api/sites/:siteId/brand/proposalThrow the proposal away.—OkAny signed-in person
POST /api/sites/:siteId/brand/askChange the proposal in words; contrast is measured again afterwards.{ text }{ proposal, reply }Any signed-in person
POST /api/sites/:siteId/brand/saveSave the proposal as the brand's files: pending changes, shown in Proof.—{ paths }Any signed-in person
GET /api/sites/:siteId/brand/applyWhat "Apply to the site" would change in the tokens file.—ApplyPlanAny signed-in person
POST /api/sites/:siteId/brand/applyWrite the brand's values into the site's tokens file, as pending changes.—{ plan, paths }Any signed-in person
POST /api/sites/:siteId/brand/checkThe pending changes against the brand: suggestions, never a block.{ paths? }{ items }Any signed-in person
POST /api/sites/:siteId/brand/driftThe site re-measured against the brand.{ measurements }DriftReportAny signed-in person
GET /api/sites/:siteId/brand/exportDownload: format=brand (the bundle) or format=tokens (W3C design tokens).?format?a fileAny signed-in person
POST /api/sites/:siteId/brand/importA bundle exported from another site, as a proposal to review.{ bundle }BrandProposalAny signed-in person
GET /api/sites/:siteId/brand/fonts/:fontIdOne of the site's own web fonts, for the specimen.—a fileAny signed-in person
POST /api/sites/:siteId/preview/entryThe addresses to load the two preview frames from, right now.—{ preview, baseline }Any signed-in person

Link to this section: The hosted install: first run

RouteDoesTakesReturnsWho
GET /api/setupWhere first run is: the owner's account, site, details or done, with the site's state and what the operator fixed. Takes the setup code until an owner exists.—SetupStatusFirst run
POST /api/setup/passwordCreate the owner: their name, e-mail and password.{ password, name?, email? }SetupStatusFirst run
POST /api/setup/deploy-keyThe install's own deploy key: made on first use, replaced with rotate.{ rotate? }DeployKeyInfoFirst run
POST /api/setup/site/checkWhether the repository can be reached and written to.SiteConnectRequestSiteAccessCheckFirst run
POST /api/setup/siteConnect the install's one site: copy the repository, or send a starter to an empty one.SiteConnectRequestJobFirst run
PUT /api/setup/detailsSave the publishing name and e-mail and the live address during first run.{ author?, liveUrl? }SetupStatusFirst run
POST /api/setup/handoverEverything at once, from the app that created the install (the unattended half of first run).SetupHandoverSetupStatusFirst run
POST /api/setup/finishEnd first run once the owner's account exists and the site is connected. The setup link stops working.—SetupStatusFirst run

Link to this section: The hosted install: the Install page

RouteDoesTakesReturnsWho
GET /api/installThe Install page: address, version, the site's repository and how it is reached, the publishing name, what is stored where.—InstallInfoOwners
POST /api/install/passwordThe older name for POST /api/account/password: change your own password.{ current, next }OkAny signed-in person
POST /api/auth/logout-allSign yourself out everywhere, this browser included.—OkAny signed-in person
POST /api/install/backupDownload a backup of the install's state, sealed with the passphrase (application/octet-stream).{ passphrase }a fileOwners
POST /api/install/restore/uploadUpload a backup file as the raw request body (application/octet-stream).—RestoreUploadFirst run
POST /api/install/restorePut an uploaded backup back in place of the install's current state.{ upload, passphrase }JobFirst run

Link to this section: The hosted install: people

RouteDoesTakesReturnsWho
GET /api/accountThe signed-in person.—AccountSessionAny signed-in person
PATCH /api/accountChange your own name or e-mail.{ name?, email?, password? }AccountSessionAny signed-in person
POST /api/account/passwordChange your own password.{ current, next }OkAny signed-in person
GET /api/peopleEveryone with an account (role, switched off or not, when they last signed in), the open invitations, and whether this server e-mails links (it needs outgoing e-mail and its public address both set).—PeopleOwners
POST /api/people/invitationsInvite someone.{ email, role }{ invitation, link }Owners
DELETE /api/people/invitations/:invitationIdTake an invitation back: its link stops working.—OkOwners
PATCH /api/people/:accountIdChange someone's role or e-mail, or switch their account off or on.{ role?, disabled?, email? }AccountOwners
DELETE /api/people/:accountIdRemove an account.—OkOwners
POST /api/people/:accountId/password-linkA link for someone to choose a new password (they forgot it).—OneTimeLinkOwners
POST /api/people/:accountId/sign-outSign one person out of every browser.—OkOwners
POST /api/people/sign-outSign everyone out, this browser included.—OkOwners
POST /api/auth/link/checkWhat a one-time link is for.{ code }LinkPreviewNo sign-in
POST /api/auth/linkUse a one-time link: an invitation creates the account (name required), a new-password link sets the password and signs that person's other browsers out.{ code, password, name? }OkNo sign-in
POST /api/auth/forgot"I forgot my password." When the server e-mails links (outgoing e-mail and its public address both set) and the address has an account, a new-password link is e-mailed.{ email }{ ok, emailAvailable }No sign-in

Link to this section: Host the editor online

RouteDoesTakesReturnsWho
GET /api/editor-hostsThe places the editor can be hosted, each key's status (never its value), and the hosts that can't run it with the reason.—{ hosts, absent }Owners
POST /api/editor-hosts/:hostId/connectWith key: check it with the host and store it only when accepted.{ key?, secret? }EditorHostAccountOwners
GET /api/sites/:siteId/editorThe site's editor online: what its settings say, what this computer created, whether it answers, its version.—HostedEditorStatusOwners
POST /api/sites/:siteId/editor/planEverything that would be created, what it costs and what the install is handed.HostedEditorRequestHostedEditorPlanOwners
POST /api/sites/:siteId/editorCreate the install a plan described.{ plan, confirm }JobOwners
POST /api/sites/:siteId/editor/setup-linkThe first-run link of an install whose setup isn't finished.—{ url }Owners
POST /api/sites/:siteId/editor/checkown-server: the person says the files are running; check the address, hand the site over.—HostedEditorStatusOwners
POST /api/sites/:siteId/editor/upgradeMove the hosted editor to this version's image, keeping its disk, as a job.—JobOwners
POST /api/sites/:siteId/editor/backupCopy the hosted editor's disk on the host, or say where its backups are downloaded.—HostedEditorBackupOwners
GET /api/sites/:siteId/editor/removalWhat removing would delete.—HostedEditorRemovalOwners
DELETE /api/sites/:siteId/editorDelete exactly what was created for the hosted editor, as a job. confirm must be true.{ confirm }JobOwners

Link to this section: Events

GET /api/events is a Server-Sent Events stream: a hello event first, then every event as data: <json>, and a : heartbeat comment every 20 seconds. Event types: hello, chat.delta, chat.tool, chat.message, chat.done, chat.error, changes.updated, preview.status, site.updated, repository.checked, sites.updated, job, plugins.updated, themes.updated, stream.limit, extension, forms.submission. Their shapes are ServerEvent in packages/core/src/types.ts. extension is an event of a program that embeds the editor: none is sent by Galley as it ships. changes.updated carries its origin: user, agent, external, publish, discard or undo. On a hosted install one account (or the operator's token) may hold 16 streams open. One more is answered with a stream that carries a single stream.limit event (its message says so in words) and ends; at most once in 10 minutes it is let in instead and the account's other streams are ended, so ones nobody reads any more give up their place. A stream whose reader stops reading is ended once 1 MB is waiting for it: connect again and read what you need afresh.

curl -sN -H "Authorization: Bearer $GALLEY_TOKEN" http://127.0.0.1:4400/api/events

Link to this section: Next