Skip to content

Page.publish

Puts one page live at its path and submits its URL to Google and Bing in the same call.

Action class
None
Approval
Runs on its own
Emits
Page.published
Price
Free
POST https://api.sb/{your-domain}/pages/publish

Inputs

NameTypeDefaultMeaning
pagePageRequiredThe draft page to put live, as Page.create made it.
submit('google-search' | 'bing' | 'indexnow')[]['google-search', 'indexnow']Where to submit the URL. indexnow reaches Bing and every engine that shares its feed in one request; Google needs your Search Console connected.
sitemapbooleantrueAdd the URL to the Site’s sitemap and ping it.
atdatetimenowWhen it goes live. A later time holds the page as scheduled until then.

Outputs

FieldTypeWhat null means
pagePageNever null: the page as published.
page.status'published' | 'scheduled'Never null.
page.urlstringNever null: the live URL, on your own domain.
page.publishedAtstring | null, in ISO 8601In try mode, and on a scheduled page until it goes live.
submitted{ venue: VenueId; status: 'accepted' | 'skipped'; reason: string | null }[]Never null: one row per engine in submit; skipped names why, such as an unconnected Search Console.

Effects

Action class

None: no approval rule names it, so it runs within its seat’s Permissions and Limits

Modes
  • try: Runs every check the publish meets and returns the page as it would go live; nothing is published or submitted.
  • send: Returns a pending Action at once; Page.published fires when the URL serves and the submissions are back.
  • do: Waits until the URL serves and returns the page with each submission’s answer.
Idempotency

Only with a key: the same Idempotency-Key and input return the first Action, and the same key with other input returns 409. A page already live at its path is never published twice: a repeat returns it as it stands and submits nothing.

Saved or shared

The page’s status, URL and publish time, and each submission’s answer. Page.checkIndex reads the result over the next days.

Emits

Page.published with { page, url, submitted }

Performed by

Content lead

Price

Free on your own account: the platform charges nothing for the call.

On each Venue

It acts on your own records and reaches no Venue, so every account answers the same way.

What try does

Runs every check the call meets and returns the record as it would be; nothing is stored, sent or posted.

Refuses when

CheckErrorFixThen call
A reference page that fails its Evaluatorscontent-evalsFix the lines the Evaluator lists, then publish again.Content.draft
A page that matches another in its cell by wording, meaning or factsduplicate-pageMerge it into the page that owns the intent.Content.draft
A sentence that no approved page and none of the Person’s own words backapproved-pagesCut the sentence, or publish the page that says it.Site.publish
The content-evals payload
JSON
{
  "type": "https://startupbuilder.dev/errors/content-evals",
  "title": "Page failed its checks",
  "status": 422,
  "detail": "A reference Page that fails its Evaluators.",
  "fix": "Fix the lines the Evaluator lists, then publish again.",
  "next": {
    "verb": "Content.draft",
    "input": {}
  },
  "instance": "https://api.sb/leaseline.app/actions/action_1"
}

When it waits

In send mode it returns a pending Action, reason: 'awaitingTime' when at is later, then running until the URL serves, and Page.published delivers the result.

TypeScript
await $.Watch.create({
  selector: 'Page.published',
  url: 'https://leaseline.app/hooks/sb'
})

Example

A refusal: its wording matches a live page, so the publish refuses before the URL serves.

You, to your agent
Put the rent ledger template page live and tell Google and Bing about
it, for `page_test_duplicate`.
Response, in try mode
{
  "type": "https://startupbuilder.dev/errors/duplicate-page",
  "title": "Page matches another Page",
  "status": 422,
  "detail": "A Page that matches another in its cell by wording, meaning or facts.",
  "fix": "Merge it into the Page that owns the intent.",
  "next": {
    "verb": "Content.draft",
    "input": {}
  },
  "instance": "https://api.sb/leaseline.app/actions/action_1"
}

To retry, send the same Idempotency-Key: the retry returns the first answer for $0. A new key reads again.

Test values

A sk_test_ key answers these the same way every time, at $0 (every test value).

Test valueAlways returnsWhat it is for
page_test_published{"page":{"status":"published","url":"https://test.leaseline.app/rent-ledger-template"}}Goes live on a test host that no engine reads, so the next step can run on a known URL.
page_test_duplicateRefuses with duplicate-pageIts wording matches a live page, so the publish refuses before the URL serves.

Used by

None.