Publishing

the site, its pages, domains, settings and structured data

sitev1.0.0

the published site: read, operate, enable visitor sign-up

A published site: its source handed back as a Next.js project, and the dispatch its page code calls under the site's own key, which is public by construction and so authenticates the site, never a person.

GET/v1/design/site/export/nextjsSessionTeam

Download the site as Next.js

The project's Design lens site as one zip: the Next.js static-export scaffold filled with every route's rendered page and components.

The zip builds on its own: `npm install && npm run build` writes the static site to `out/`. The theme lands as `app/theme.css`, each route as `app/<route>/page.tsx` beside its CSS module, and every section and shared component under `components/`, styled through CSS modules bound to the theme's variables.

Answers `application/zip` with a `Content-Disposition` naming `<site>-nextjs.zip` — the site's claimed subdomain, else its id. The project is named by the `X-Project-Id` header.

Request · curl
curl -X GET "https://runlogai.com/runlogapi/design/site/export/nextjs" \
  -H "Authorization: Bearer $RUNLOG_SESSION_TOKEN" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "contentType": "application/zip",
  "filename": "acme-nextjs.zip"
}

Errors

StatuserrorWhen
400This site has no pages yet, so there is nothing to export.The project holds no Design lens site, or its site has no routes landed.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
POST/v1/public/sites/actionsSite keyTeam

Dispatch a published action

Run one action the PFW's owner published, against the PFW's own project.

The site key is the credential and it travels in the body, not the `Authorization` header — the caller is page code, not a server holding a secret. Treat it as public: it grants only what the owner published, and rotating it re-keys the site.

The published set is floored at reads. A write action reaches a PFW only when the owner publishes it explicitly, and no publishing raises a visitor to the admin tier.

60 requests per minute per PFW, not per visitor — a busy site shares one bucket.

The generated `Runlog` client on a published page wraps this route; calling it directly is the same contract.

A visitor signed in on the site's own identity tenant sends their ID token as `Authorization: Bearer`; the dispatch then attributes to them. A token on any other tenant — a Runlog session included — is refused exactly as an unresolvable site is.

Body

FieldTypeRequiredDescription
projectIdstringrequiredThe project the PFW belongs to.
keystringrequiredThe PFW's site key, as embedded in its page code.
actionstringrequiredThe catalogued action id to run.
inputobjectoptionalThe action's input, as documented in the action catalog.
sessionIdstringoptionalThe page's own handle for one visitor. Uploads land in that session's own child project rather than the PFW's, so one visitor never reads another's.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/public/sites/actions" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "code_context_pack",
  "input": {
    "task": "what does this product do?"
  },
  "key": "site_9Qd2Xm",
  "projectId": "p7Kd2mQx"
}'
Response · 200
{
  "action": "code_context_pack",
  "result": {
    "pack": "…"
  }
}

Errors

StatuserrorWhen
404not foundThe request did not resolve to a published PFW (bad or revoked key, unknown origin), the action was not published on this PFW, or it is outside the lane's consequence floor. One status for all of them — the edge never confirms which; the distinction is recorded server-side in the security-event audit.
404unknown actionNo such action in the catalog.
429rate limit exceededThe PFW passed 60 requests/minute. The bucket is per site, so every visitor shares it.
400invalid request bodyThe body is not JSON, or exceeds the 1 MB request-body cap.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
project-write

Operate the site

site_operate: Change the project's own site, from the thread: generate its pages from the corpus (optionally under a directive), refine one page from a prompt, apply a batch of node edits to one page, take the project's media in as site assets, publish the draft as the next served version, restore a published version into the draft, set the theme's variables, propose a contrast-corrected theme without writing it, or optimize the stored theme at WCAG AA contrast. Each is the same call the Design tab's own controls make; what the site currently holds is read with site_read. Publish and restore are admin-only; publish changes what visitors see, so perform it only on an explicit ask.Teamruns on a thread, stream it

FieldTypeRequiredDescription
operationstringrequiredone of generate | refine | apply_ops | import_assets | publish | restore | set_theme | propose_theme | optimize_theme
routestringoptionalapply_ops only: the route whose frame the ops edit. Required for apply_ops.
baseVersionnumberoptionalapply_ops only: the doc version the ops were built on, as site_read's page subject answers it. Required for apply_ops.
opsobject[]optionalapply_ops only: the CanvasOp list, each naming a node id from site_read's page tree (op, nodeId, key, value, parentId, index, node); a SET_TEXT value is the element's new inner HTML. Required for apply_ops.
directivestringoptionalgenerate only: the owner's brief for the site, e.g. the pages wanted or the tone. Omit to generate from the corpus alone.
promptstringoptionalrefine only: the one change to make; the lens picks the page it targets. Required for refine.
tokensobjectoptionalset_theme only: a map of theme variable name (without the -- prefix, e.g. color-brand) to its new value. Names not in the map keep their value. Required for set_theme.
versionnumberoptionalrestore only: the published version number to re-seed the draft from (read them with site_read). Required for restore.

Contract generate drafts every page fresh from the corpus and REPLACES the current draft pages; on a site that already has pages, confirm the owner means regenerate rather than refine.

Contract On the tool surface generate and refine are queued, not awaited: each answers {action: "queued", taskId, lands} and the pages are in the draft once that task completes; every other operation answers its result.

Contract refine takes ONE change; the page it lands on is chosen from the change, so name the page in the prompt when the owner did.

Contract set_theme restyles every page with no page rewritten and reports how many render with it — the restyle path that costs no generation; a value that could escape its declaration is refused by the server.

Contract propose_theme writes nothing: it answers the contrast pass over the tokens supplied, or over the stored theme when none are, so the owner reads the correction before it lands. optimize_theme is the same pass committed.

Contract apply_ops lands the batch whole or not at all: a batch built on a version the page has left, or naming a node off that route, is refused rather than merged. In a thread a page's content changes through the update node instead.

Contract publish is irreversible for visitors until the next publish: never publish to show a change — the draft preview already shows it.

Contract restore rewrites the DRAFT from a published version and publishes nothing; the owner reviews it in Edit Page and ships it as the next version — the live site never points backwards.

read

Read the site

site_read: Read what the project's own site currently holds, changing nothing: its pages and their routes, one page's frame as a tree of node ids, its theme variables, the routes one variable reaches, the versions published so far, its standing configuration (delegated actions, the attributed uid, upload routing, subdomain, custom domains, whether a site key is held), whether visitor sign-up is on, or every answer-engine rule's verdict over every page.Teamruns on a thread, stream it

FieldTypeRequiredDescription
subjectstringoptionalone of pages | page | theme | token_reach | versions | config | visitor_signup | audit; 'pages' by default
routestringoptionalpage only: the route whose frame is read as a tree under its node ids, with the doc version an apply_ops batch is built on
tokenstringoptionaltoken_reach only: the theme variable name, without the -- prefix

Contract It writes nothing and calls no model: every subject is a read of what the site already stores, so it is safe to run before proposing any change.

Contract config never answers the site key's secret — only whether one is held. A key is read, rotated and revoked by a person on the Design tab.

Contract audit answers one verdict per answer-engine rule per route, pass or fail, each citing the line it was read from, every failure carrying its smallest fix and a schema gap carrying the JSON-LD block to paste. Report the passes too — a report showing only failures cannot be told from one that missed them.

project-write

Enable visitor sign-up

site_visitor_signup_enable: Switch visitor accounts on for the published site. Visitors then sign up on the site's own identity tenant — an account held apart from every Runlog account — and a signed-in visitor's submissions are attributed to them. The tenant is provisioned on the first enable; the site needs an address first.Teamruns on a thread, stream it

FieldTypeRequiredDescription

Contract Staged as a pending write the owner confirms on the run; the tool answers that it was staged, never that visitors can already sign up.

Contract Refused on a site with no address — claim the label with configure_site_delegation first.

pagev1.0.0

a web page made, or a public page looked at

project-write

Make a page

page_generate: Write one of your standard pages, citing what the project has read.Teamruns on a thread, stream it

FieldTypeRequiredDescription
schemaIdstringrequiredthe schema the page is generated under
titlestringoptionalthe page's title; the schema's own title when omitted

Contract Generates a page from an existing schema in the project's reach; it never authors a schema.

read

Look at a web page

page_look: Open one public page in a browser, take a screenshot of its whole height, compare it with the project's last look at the same address, and answer a question about what the page shows: whether a site edit landed, how a page reads, what a competitor's page holds.Teamruns on a thread, stream it

FieldTypeRequiredDescription
urlstringrequiredthe page's public https address
questionstringoptionalwhat to read off the screenshot; omit for what the page shows

Contract Only a public address the fetch guard admits is opened; the page is never clicked, typed into or signed in to.

Contract The screenshot replaces the project's last look at that address, the one thing kept; the answer names the share of the page that changed since it.

domainv1.0.0

custom domains: list, claim, verify, release

read

List custom domains

domain_list: List the verified custom domains the project's published site serves at.Teamanswers inline

FieldTypeRequiredDescription

Contract Owner-only: anyone else reads the project as having none.

project-write

Claim a custom domain

domain_claim: Claim a domain for the project's published site under a verification token the domain's DNS then carries.Teamanswers inline

FieldTypeRequiredDescription
hoststringrequiredthe domain, such as shop.example.com
tokenstringrequiredthe verification token the TXT record will carry

Contract Owner-only, and a domain another project claimed is refused.

Contract The DNS record is the person's to add at their registrar; a claim serves nothing until domain_verify finds it.

project-write

Verify a custom domain

domain_verify: Check the claimed domain's _runlog-verify TXT record and, when it carries the token, serve the site there.Teamanswers inline

FieldTypeRequiredDescription
hoststringrequiredthe domain, such as shop.example.com
tokenstringrequiredthe token the claim was made under

Contract Owner-only. A record not yet visible is refused with the reason, and the claim stands for the next check.

project-write

Release a custom domain

domain_release: Release a domain the project claimed; the site stops answering there.Teamanswers inline

FieldTypeRequiredDescription
hoststringrequiredthe domain, such as shop.example.com

Contract Owner-only; a domain the project does not hold is refused and nothing changes.

configurev1.0.0

what a published site may do and where its uploads land

project-write

Configure site delegation

configure_site_delegation: Set what a published site may do on a visitor's behalf and where its uploads land — the owner's standing configuration of the site, reached from the Design thread. Enable delegated actions (e.g. document_ingest so visitors can upload), name the uid visitor activity is attributed to, state the folder an upload component routes to, claim the site's subdomain, and set what the site sells. Perform only the parts the owner stated; ask a bounded question for each part they left open rather than deciding it.Teamruns on a thread, stream it

FieldTypeRequiredDescription
actionsstring[]optionaldelegated action ids to enable for site visitors (e.g. ["document_ingest"]). Omit to leave the set unchanged. The change is staged for the owner's confirmation before it applies.
designated_uidstringoptionaluid visitor uploads and activity are attributed to — the @user token the owner typed resolves to this. Omit to leave unchanged.
upload_component_idstringoptionalthe site component id whose uploads route to upload_folder. Pair with upload_folder; omit both to leave routing unchanged.
upload_folderstringoptionalfolder an upload component's files land in; resolved server-side, so a visitor cannot forge the destination. Pair with upload_component_id.
subdomainstringoptionalthe subdomain label to claim for the published site (www and atlas are reserved). Omit to leave unchanged.
offersobject[]optionalwhat the site sells, replacing the whole list: each {name, summary, amountCents, currency: "usd", deliveryDays}, with only the name and price the owner stated. An empty list stops selling. Omit to leave unchanged. Staged for the owner's confirmation; confirmed offers let visitors check out.
statement_descriptorstringoptionalthe 1-22 character suffix a buyer's card statement carries, naming the site (letters required, none of < > \ ' " *). Required with offers.
site_namestringoptionalthe business name a buyer sees on the payment page, as the owner stated it. Required with offers until the site has one; omit to keep the name it has.

Contract Enable only what the owner named: pass actions to widen the delegation, designated_uid to attribute, upload_component_id + upload_folder to route one component, subdomain to claim the label — each is independent.

Contract A change to actions is a standing grant to anonymous visitors, so it is staged as a pending write the owner confirms on the run; the tool answers that it was staged, never that it applied.

Contract Offers and the statement descriptor are staged together as one pending write; confirming it sets what the site sells and grants visitors checkout, and an empty offer list takes the grant away.

Contract The designated_uid is an attribution, never a credential: it is what a visitor's writes are stamped with, and it must be a real project member resolved from the @user token the owner typed — never a name the owner typed in prose.

stagev1.0.0

stage a site's missing structured data

project-write

Stage a site's missing structured data

stage_schema_blocks: Write the JSON-LD blocks an audited site's pages are missing into one artifact the owner can paste from.Teamruns on a thread, stream it

FieldTypeRequiredDescription
domainstringrequiredthe domain the blocks are for

Contract Blocks are copied verbatim from the audit, never composed — a re-typed block is an invalid one.

Contract A site whose pages all declare structured data stages nothing.