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
Inputs
| Name | Type | Default | Meaning |
|---|---|---|---|
page | Page | Required | The draft page to put live, as Page.create made it. |
submit | ('google-search' | 'bing' | 'indexnow')[] | ['google-search', | Where to submit the URL. indexnow reaches Bing and every engine that shares its feed in one request; Google needs your Search Console connected. |
sitemap | boolean | true | Add the URL to the Site’s sitemap and ping it. |
at | datetime | now | When it goes live. A later time holds the page as scheduled until then. |
Outputs
| Field | Type | What null means |
|---|---|---|
page | Page | Never null: the page as published. |
page.status | 'published' | 'scheduled' | Never null. |
page.url | string | Never null: the live URL, on your own domain. |
page.publishedAt | string | null, in ISO 8601 | In try mode, and on a scheduled page until it goes live. |
submitted | { venue: | 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.publishedfires 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-Keyand input return the first Action, and the same key with other input returns409. 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.checkIndexreads the result over the next days.- Emits
Page.publishedwith{ page,url, submitted } - Performed by
- 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
| Check | Error | Fix | Then call |
|---|---|---|---|
| A reference page that fails its Evaluators | content-evals | Fix the lines the Evaluator lists, then publish again. | Content.draft |
| A page that matches another in its cell by wording, meaning or facts | duplicate-page | Merge it into the page that owns the intent. | Content.draft |
| A sentence that no approved page and none of the Person’s own words back | approved-pages | Cut the sentence, or publish the page that says it. | Site.publish |
The content-evals payload
{
"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: when at is later, then running until the URL serves, and Page.published delivers the result.
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.
Put the rent ledger template page live and tell Google and Bing about
it, for `page_test_duplicate`. {
"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 value | Always returns | What it is for |
|---|---|---|
page_test_published | {"page": | Goes live on a test host that no engine reads, so the next step can run on a known URL. |
page_test_duplicate | Refuses with duplicate-page | Its wording matches a live page, so the publish refuses before the URL serves. |
Used by
None.