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 pre-release 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. Three routes answer anyone: GET /api/meta, sign-in and sign-out (Anyone below). Every other route needs a session (Signed in): 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. There are no roles: a session can 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).
  • 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, or a failed Host or Origin check.
not-found404No such site, entry, file, job, conversation or route.
conflict409The file changed since it was read (baseHash), or a name is taken.
busy409 (429 for sign-in)Something is already running — a reply, a publish, too many sign-in attempts.
git, preview, internal500A git command, the preview, or something unexpected failed.
ai502The model or image provider failed.
sh
$ 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.

Two addresses outside /api have their own rules: /mcp (the MCP endpoint, Bearer only) and /f/:siteId (form submissions from the site's own pages — Forms for developers).

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.—MetaInfoAnyone
POST /api/auth/loginHosted mode: sign in with the shared password; sets the session cookie. Rate-limited.{ password }OkAnyone
POST /api/auth/logoutClear and revoke the session.—OkAnyone
GET /api/eventsThe live event stream (below).—a streamSigned in

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).—SettingsSigned in
PATCH /api/settingsChange any of those.SettingsPatchSettingsSigned in
PUT /api/secrets/:nameSave a shared key — anthropic, openai, google, cloudflare or vercel; null removes it. Returns its status only.{ value }SecretStatusSigned in
GET /api/usageWhat the assistant and image generation cost at list prices: today, 7 and 30 days, all time, per model.—UsageSummarySigned in

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[]Signed in
POST /api/sites/openAdd and open a folder (an absolute path). In hosted mode, only inside the sites folder.OpenSiteRequestSiteDetailSigned in
POST /api/sites/cloneClone a repository into the sites folder, as a job.CloneSiteRequestJobSigned in
POST /api/sites/createCreate a site from a starter, as a job.CreateSiteRequestJobSigned in
GET /api/startersThe starters and their looks.—StarterInfo[]Signed in
GET /api/starters/:starterId/previewA starter's preview image, or one of its looks' (look) — only images its starter.json declares.?look?a fileSigned in
GET /api/jobs/:jobIdA job's state, progress and result.—JobSigned in
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 }Signed in
GET /api/fs/listFolders on the server's disk, for the folder picker; marks the ones that look like sites. Confined to the sites folder in hosted mode.?path?{ path, parent, entries }Signed in
GET /api/sites/:siteIdThe site, with its full model (detection merged with the config file).—SiteDetailSigned in
DELETE /api/sites/:siteIdForget the site, its own keys and author. Its files stay on disk.—OkSigned in
POST /api/sites/:siteId/refreshRun detection again.—SiteModelSigned in
GET /api/sites/:siteId/configThe site's galley.config.json (or null) and the model detection found before it.—{ config, detected }Signed in
PUT /api/sites/:siteId/configReplace galley.config.json. Validated; refused when invalid.{ config }SiteModelSigned in

Link to this section: Content

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

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.FormIntrospectRequestFormIntrospectResultSigned in
GET /api/sites/:siteId/formsEvery form of the site with what the forms list shows: definition, status, the pages that use it.—{ forms }Signed in
GET /api/sites/:siteId/kitWhat the site has of the site kit, and what "Set it up for me" would do.—SiteKitStatusSigned in
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.—JobSigned in
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).—JobSigned in
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.—SiteKitStatusSigned in

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 }Signed in
GET /api/sites/:siteId/inbox/:formIdOne form's submissions, newest first.?filter?&q?&offset?&limit?SubmissionListSigned in
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 fileSigned in
GET /api/sites/:siteId/inbox/:formId/:submissionIdOne submission in full.—FormSubmissionSigned in
PATCH /api/sites/:siteId/inbox/:formIdMark read/unread and spam/not spam.{ ids, read?, spam? }{ items }Signed in
POST /api/sites/:siteId/inbox/:formId/deleteDelete for good; the removed submissions come back so Undo can restore them.{ ids }{ deleted }Signed in
POST /api/sites/:siteId/inbox/:formId/restoreUndo a delete.{ submissions }{ restored }Signed in
POST /api/sites/:siteId/inbox/:formId/:submissionId/retrySend again to one server-side destination (its index), or the e-mail notification.{ destination }FormSubmissionSigned in
GET /api/sites/:siteId/captureThe site's capture settings: e-mail alerts, forwarding, spam rules, whether a capture key is set.—CaptureSettingsSigned in
PATCH /api/sites/:siteId/captureChange the capture settings.CaptureSettingsPatchCaptureSettingsSigned in
POST /api/sites/:siteId/capture/keyMake a new capture key (shown once, in key) or remove it.{ action }{ settings, key }Signed in

Link to this section: Files (the source view)

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

Link to this section: Media

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/mediaThe media library.—{ items }Signed in
POST /api/sites/:siteId/mediaUpload a file as a data: URL, 25 MB at most.{ filename, directory?, data }MediaItemSigned in
DELETE /api/sites/:siteId/mediaDelete a media file.?pathOkSigned in
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 fileSigned in

Link to this section: Image generation

RouteDoesTakesReturnsWho
GET /api/images/providersThe image generators and whether each is ready.—{ providers }Signed in
POST /api/sites/:siteId/images/generateMake candidate images from a description.ImageGenRequest{ candidates }Signed in
GET /api/images/candidates/:candidateIdA candidate image's bytes.—a fileSigned in
POST /api/sites/:siteId/images/saveSave a candidate into the site's media.ImageSaveRequestMediaItemSigned in
DELETE /api/images/candidates/:candidateIdThrow a candidate image away.—OkSigned in

Link to this section: Video generation

RouteDoesTakesReturnsWho
GET /api/videos/providersThe video generators, their models, prices and whether each is ready.—{ providers }Signed in
POST /api/sites/:siteId/videos/generateStart making a video; progress arrives as job events.VideoGenRequestJobSigned in
GET /api/videos/jobs/:jobIdA video generation's state and its candidates.—VideoJobStatusSigned in
GET /api/videos/candidates/:candidateIdA candidate video's bytes.—a fileSigned in
POST /api/sites/:siteId/videos/saveSave a candidate video into the site's media.VideoSaveRequestMediaItemSigned in
DELETE /api/videos/candidates/:candidateIdThrow a candidate video away.—OkSigned in

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).—PluginListSigned in
GET /api/sites/:siteId/pluginsThe same, plus the plugins this site's configuration names.—PluginListSigned in
POST /api/plugins/enabledTurn a plugin on or off (kept across restarts).{ name, enabled, siteId? }PluginInfoSigned in
PUT /api/plugins/settingsSave some of a plugin's settings; null removes a value.{ name, values, siteId? }PluginInfoSigned in
GET /api/catalogEvery catalogue, merged from the enabled plugins.—PluginCatalogSigned in
GET /api/sites/:siteId/catalogThe same, with this site's own plugins included.—PluginCatalogSigned in
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?DataSourceAnswerSigned in

Link to this section: Proof and publish

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/changesEverything pending, per file, with field-level changes (example).—ChangeSetSigned in
GET /api/sites/:siteId/diffOne file's before and after, with hunks.?pathFileDiffSigned in
POST /api/sites/:siteId/discardDiscard these files' changes, or everything pending.{ paths? }ChangeSetSigned in
POST /api/sites/:siteId/publishPublish: commit (and push), or a branch and pull request (Publishing).PublishRequestPublishResultSigned in
GET /api/sites/:siteId/historyPublished versions, newest first.?limit?{ items }Signed in
POST /api/sites/:siteId/revertUndo a publish with a new version that reverses it.{ commit }PublishResultSigned in
POST /api/sites/:siteId/sendSend versions published on this computer that have not reached the remote yet.—PublishResultSigned in
GET /api/sites/:siteId/gitBranch, remote, ahead and behind.—GitStatusSigned in
POST /api/sites/:siteId/pullBring the site up to date (git pull --ff-only).—GitStatusSigned in
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 }Signed in
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? }PublishCheckSigned in

Link to this section: Preview and build

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

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 }Signed in
POST /api/deploy/targets/:targetId/connectCheck an access key works; the accounts (Cloudflare) or teams (Vercel) it can use.{ key? }{ accounts }Signed in
POST /api/sites/:siteId/deploy/checkWhether a project name can be used in that account.{ target, account, project }DeployProjectCheckSigned in
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.—DeployStatusSigned in
PUT /api/sites/:siteId/deployChange the site's deploy settings (galley.config.json deploy).Partial<DeployConfig>DeployStatusSigned in
POST /api/sites/:siteId/deploy/live-addressUse the live address as the site's urls.production (what Proof compares against).—DeployStatusSigned in
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? }JobSigned in
GET /api/sites/:siteId/deploymentsDeployments made from this computer, newest first.?limit?{ items }Signed in

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.—RedirectsOverviewSigned in
PUT /api/sites/:siteId/redirectsReplace the list (inline edits, add one, delete, Undo).{ redirects, baseHash? }RedirectsOverviewSigned in
POST /api/sites/:siteId/redirects/review"Add many": what a pasted list (or a file in the site, path) would do.RedirectImportBodyImportReviewSigned in
POST /api/sites/:siteId/redirects/importAdd what review showed, as one pending change.RedirectImportBody & { baseHash? }{ overview, review }Signed in
POST /api/sites/:siteId/redirects/try"Try an address": where a visitor ends up, through which rules.{ address }RedirectTraceSigned in
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? }RedirectsOverviewSigned in
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.—RedirectsOverviewSigned in
POST /api/sites/:siteId/redirects/leftover/removeRemove a redirect file this app wrote for a host the site no longer uses.{ path }RedirectsOverviewSigned in
GET /api/sites/:siteId/redirects/exportThe list in a host's format, as a download.?format&hostname?a fileSigned in
GET /api/sites/:siteId/redirects/healthRedirects that lead nowhere now, and old addresses the site's own pages still link to.—RedirectHealthSigned in
POST /api/sites/:siteId/redirects/cloudflare/planWhat setting them on Cloudflare would add, change and remove.—CloudflarePlanSigned in
POST /api/sites/:siteId/redirects/cloudflare/applyApply a plan (refused when anything moved since).{ planId }JobSigned in
POST /api/sites/:siteId/redirects/cloudflare/checkCheck Cloudflare's copy matches the list.—CloudflareCheckSigned in
POST /api/sites/:siteId/redirects/cloudflare/removeTake this app's list and rule off Cloudflare (nothing else there is touched).—RedirectsOverviewSigned in

Link to this section: Assistant

RouteDoesTakesReturnsWho
GET /api/sites/:siteId/threadsThe site's assistant conversations.—{ threads }Signed in
POST /api/sites/:siteId/threadsStart a conversation.{ title?, mode? }ChatThreadSigned in
GET /api/sites/:siteId/threads/:threadIdOne conversation, with its messages.—ChatThreadSigned in
PATCH /api/sites/:siteId/threads/:threadIdRename a conversation.{ title }ChatThreadSummarySigned in
DELETE /api/sites/:siteId/threads/:threadIdDelete a conversation.—OkSigned in
POST /api/sites/:siteId/threads/:threadId/messagesSend a message (text, pictures, mode, page context). The reply streams over /api/events.SendMessageRequest{ turnId }Signed in
POST /api/sites/:siteId/threads/:threadId/cancelStop the reply in progress.—OkSigned in
POST /api/sites/:siteId/threads/:threadId/undoUndo one assistant turn: the files it changed are put back.{ turnId }{ restored }Signed in

Link to this section: Multi-site

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

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?SiteAuditSigned in
GET /api/sites/:siteId/visibility/entryOne entry: its result preview (an approximation) and findings, judged against the whole site.?path&render?EntryAuditSigned in
POST /api/sites/:siteId/visibility/fixApply the deterministic fixes of these findings (ids from the last audit) as ordinary edits.{ ids }FixResultSigned in
POST /api/sites/:siteId/visibility/undoPut back every file one batch of fixes changed.{ undoId }{ restored }Signed in
GET /api/sites/:siteId/visibility/crawlersEach documented AI crawler and whether the site allows it.—CrawlerReportSigned in
PUT /api/sites/:siteId/visibility/crawlersAllow or block documented AI crawlers by robots.txt token; only a marked block of robots.txt changes.{ choices }CrawlerReportSigned in
GET /api/sites/:siteId/visibility/agent-viewWhat an AI agent receives for one page: its markdown version, else its text with scripts off.?urlAgentViewSigned in
POST /api/sites/:siteId/visibility/write/planWhat an assistant-written batch would do: the pages, and one model request per page.{ kind, paths? }WritePlanSigned in
POST /api/sites/:siteId/visibility/writeStart the batch as a job; results land in Proof.{ kind, paths?, limit? }WriteBatchStatusSigned in
GET /api/sites/:siteId/visibility/write/:jobIdAn assistant-written batch's progress.—WriteBatchStatusSigned in
POST /api/sites/:siteId/visibility/write/:jobId/cancelStop the batch; what is written stays in Proof.—OkSigned in
POST /api/sites/:siteId/visibility/external-linksCheck links to other sites — only when asked: a few at a time, capped.{ limit? }{ checked, total, findings }Signed in
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 }Signed in
POST /api/sites/:siteId/import/inspectThe quick look: is it WordPress, can its content be read, how much is there.{ source }ImportInspectionSigned in
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? }ImportPlanViewSigned in
POST /api/sites/:siteId/import/runStart bringing it over: a Job (kind "import").{ source, answers? }ImportRunStatusSigned in
GET /api/sites/:siteId/import/runs/:runIdAn import's progress.—ImportRunStatusSigned in
POST /api/sites/:siteId/import/runs/:runId/cancelStop part-way: what already arrived is kept as pending changes.—ImportRunStatusSigned in
GET /api/sites/:siteId/import/reportThe last import's report for this site, or null.—{ report }Signed in
POST /api/sites/:siteId/import/rebuildOpen the assistant (build mode) on one page-builder page, with its prepared rebuild brief.{ path }{ threadId, turnId }Signed in
GET /api/sites/:siteId/import/rebuild-allWhat "Rebuild all" would do, and its estimated cost.—ImportRebuildPlanSigned in
POST /api/sites/:siteId/import/rebuild-allRebuild the pages one after another, each its own conversation; a Job (kind "import").{ paths? }ImportRebuildStatusSigned in
GET /api/sites/:siteId/import/rebuild-all/:jobIdA Rebuild all run's progress.—ImportRebuildStatusSigned in
POST /api/sites/:siteId/import/rebuild-all/:jobId/cancelStop Rebuild all after the page in hand.—ImportRebuildStatusSigned in

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.—SiteBrandStateSigned in
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? }JobSigned in
POST /api/sites/:siteId/brand/cancelStop reading the brand.—OkSigned in
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 }Signed in
POST /api/sites/:siteId/brand/websiteRead a website's address as material (public https addresses only).{ url }BrandSourceSigned in
PATCH /api/sites/:siteId/brand/sources/:sourceIdChange a piece of material's note, or leave it out of the reading.{ note?, ignored? }BrandSourceSigned in
DELETE /api/sites/:siteId/brand/sources/:sourceIdRemove a piece of material.—OkSigned in
GET /api/sites/:siteId/brand/sources/:sourceId/fileThe file (kind=original) or the picture the model saw (kind=picture).?kind?a fileSigned in
PUT /api/sites/:siteId/brand/proposalChange the proposal (an edited brand) and answer its questions (question id → option value).{ brand?, answers? }BrandProposalSigned in
DELETE /api/sites/:siteId/brand/proposalThrow the proposal away.—OkSigned in
POST /api/sites/:siteId/brand/askChange the proposal in words; contrast is measured again afterwards.{ text }{ proposal, reply }Signed in
POST /api/sites/:siteId/brand/saveSave the proposal as the brand's files: pending changes, shown in Proof.—{ paths }Signed in
GET /api/sites/:siteId/brand/applyWhat "Apply to the site" would change in the tokens file.—ApplyPlanSigned in
POST /api/sites/:siteId/brand/applyWrite the brand's values into the site's tokens file, as pending changes.—{ plan, paths }Signed in
POST /api/sites/:siteId/brand/checkThe pending changes against the brand: suggestions, never a block.{ paths? }{ items }Signed in
POST /api/sites/:siteId/brand/driftThe site re-measured against the brand.{ measurements }DriftReportSigned in
GET /api/sites/:siteId/brand/exportDownload: format=brand (the bundle) or format=tokens (W3C design tokens).?format?a fileSigned in
POST /api/sites/:siteId/brand/importA bundle exported from another site, as a proposal to review.{ bundle }BrandProposalSigned in
GET /api/sites/:siteId/brand/fonts/:fontIdOne of the site's own web fonts, for the specimen.—a fileSigned in

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, sites.updated, job, plugins.updated, forms.submission. Their shapes are ServerEvent in packages/core/src/types.ts. changes.updated carries its origin: user, agent, external, publish, discard or undo.

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

Link to this section: Next