Authoring pages

A Moseik page is freeform HTML + CSS. You write ordinary markup; the platform sanitizes it, wraps it in a document shell, and serves it under a strict security policy. There is no composition JSON, no fixed component vocabulary, and no utility-class allowlist — if you can express it in sanitized HTML and CSS, you can build it.

The page model

A page payload is a small JSON object:

{
  "html": "<header>…</header><main>…</main>",
  "css": ".hero{ padding: 4rem 2rem }"
}

Create a page with POST /v1/pages, edit it with PUT /v1/pages/:id/payload (send If-Match: <latestVersionId>). See the API reference.

What HTML you can write

The sanitizer runs on every write and rejects (never silently strips) a payload that steps outside the envelope, with a machine-readable reason. The envelope:

summary h1–h6 p span a strong em ul ol li table … img picture source video audio button label; form controls form input textarea select option optgroup datalist output fieldset legend progress meter (for client-side interactive UIs — see below); <dialog> for modals (see _Modals_ below); inline <svg> (a safe subset — see _Icons, images & embeds_); <iframe> for embeds (see below); and the platform placeholders <mk-component> and <mk-partial>. Global attributes class id title role hidden tabindex style, plus data-* and aria-*, are allowed everywhere; element-specific ones (href, src, alt, colspan`, …) where they belong.

- <script> and inline on* handlers, javascript: URLs → per-site JS ships as an island (PUT /v1/script), never inline. This applies to form controls too — wire input/change/submit in the island, not oninput=…. - Inline <style> → page CSS goes in the payload css field. - <object>/<embed> and SVG <foreignObject> → plugins/foreignObject can smuggle code. - A <form action> (or formaction) pointing off-site → declare forms as components; a form that submits to another system uses data-action with an allowlisted origin (see _Submitting to someone else's system_). - Off-site _asset_ URLs on src/srcset/poster and CSS url() must be first-party/relative — import media first (below). Two exceptions: an <iframe> src may be any https:// origin (that's what embeds are), and an <img> src/srcset (or a <picture> <source srcset>) may point at our own Cloudflare Images account, https://imagedelivery.net/fdADyrHW5AIzXwUyxun8dw/… — where Showroom headshots live. Any other imagedelivery.net account is refused. The served page's CSP still blocks third-party _scripts_ and _fetches_ unless the origin is on the site's allowlist (see _Calling an external origin directly_). - Dangerous URL schemes (javascript:, data:, …) on any attribute.

Styling

Six CSS layers cascade, in this order, into every page (the same order GET /v1/manifest reports as cssLayers):

  1. Custom @font-face — the self-hosted font faces (vendored + your uploaded fonts), emitted first so the families are available to everything below.
  2. Theme — :root custom properties (colors, fonts, the type scale, spacing, radius) compiled from the site's design tokens. Reference them as CSS variables: var(--color-primary), var(--font-heading), var(--font-mono), var(--type-scale-4), var(--space-4), etc.
  3. Base reset — a minimal reset + accessibility defaults. box-sizing, img { max-width: 100%; display: block; height: auto }, a { color: inherit }, a reduced-motion guard, and the two components the platform must ship looking operable (the lightbox and the consent banner). Everything here is zero- or single-specificity, so your CSS wins by default.
  4. Site stylesheet — your shared CSS (PUT /v1/stylesheet).
  5. Chrome CSS — the CSS attached to your header/footer/announcement.
  6. Page CSS — the payload's css, most specific, last to apply.

Links inherit their colour rather than falling back to browser blue. The platform emits anchors of its own — the listing card's link, the review author, the agent's phone number, a collection's call to action, the blog pager — and those class names are not in your repo, so styling only the anchors you wrote would leave the rest #0000EE. Set a { color: … } in your stylesheet and it wins outright; the underline is untouched either way.

There is no CSS framework shipped or required — write plain CSS. The convention (for your own maintenance, not enforced) is to lean on the theme's CSS variables and put anything shared in the site stylesheet. If you like utility-class authoring, define your own classes in the stylesheet.

A definite size on the axis you weren't thinking about silently wins over the rule you meant to be in charge:

If a box comes out a size you can't explain, ask which axis is definite before reaching for !important.

When nobody has chosen a look

Without direction from the owner, a brand guide or a clone source, don't reach for the patterns that mark a site as AI-built:

Design from the business instead: its trade, its town, its customers. These are defaults to avoid, not rules. When the owner, their brand or a clone source uses any of them, follow it.

Photos. Don't ask for photos up front; owners rarely have them to hand. Build with freely licensed stock photos chosen for this business, its trade and its town, never generic office or handshake shots. Where a photo belongs, use one, not an icon. At handoff, with the preview link, list the placeholder photos once and say real ones will make the site look like theirs: they can click any image in the dashboard to replace it, or send photos to you. Don't hold the build for them.

Site stylesheet — shared CSS, edited once

GET  /v1/stylesheet                 → { css, publishedVersionId, … }
PUT  /v1/stylesheet   { "css": "…" }   → publishes + re-renders every page
POST /v1/stylesheet/revert { "toVersionId": "ver_…" }

Publishing the stylesheet re-renders the whole site, so a shared rule changes everywhere at once.

Components — behavior, headless

Embed a platform behavior component as a custom element; the renderer resolves it server-side into functional markup with stable mk-* class hooks and no styling opinion — you style the hooks via CSS.

<mk-component name="contact-form" data-phone="true"></mk-component>

Every component, and where its attributes are documented. An unknown name is rejected at the gate; GET /v1/manifest → components lists the same set.

namewhat it renderssection
site-fieldone field of the business contact record, as bare text_Printing the contact record in a page_
formany form whose fields you declare → leads_Custom forms — the form component_
contact-formname / email / phone / message preset → leads_contact-form has four fields_
newsletter-formemail capture → leads_Forms_
listingsa grid of real-estate listings from the site's feed_Listings_
listing-detailone listing, on a /listings/:mls/:slug template_Listing detail pages_
listings-mapa Google map of the grid on the same page_A map of your listings_
listing-statsmarket statistics for a community_A community's market stats_
seller-comparablesa "what is my home worth" panel_A "what is my home worth" seller page_
agent-rostera brokerage's agents_The agent roster_
collectionrows of a collection (team, testimonials, …)_Collections — lists that outlive the page_
collection-detailone collection row, on a :slug template_A page per row_
page-listblog posts, news, case studies_Blog posts, news, case studies_
google-reviewsthe business's Google reviews_Google reviews_
neighborhood-statscensus facts for an area_Neighborhood stats_
market-trendsmonthly sales, sale price and days on market for an area_Market trends_
community-mapthe area's boundary on a map, as an image_Community map_
mapa branded Google map with your own pins_Google Maps — the map component_
language-switcherlinks to this page in each language the site serves_Translated pages_

Printing the contact record in a page

The business's phone, email, hours and address live in one place — the contact record, written with PUT /v1/site { "contact": … } — and site-field prints one of them wherever you need it:

<p>Call <mk-component name="site-field" data-field="phone"></mk-component> or drop in.</p>
<address><mk-component name="site-field" data-field="address"></mk-component></address>

Use this instead of typing the details into your markup. It is the same record the page shell builds Organization/LocalBusiness from, and writing it re-renders the whole site, so every referencing page updates with no page write of your own.

data-field takes one of these, and nothing else:

data-fieldrenders
namethe business display name
phonethe phone number as it was written
emailthe business's public email address
hoursopening hours, free text (Mon–Fri 9–5)
addressthe whole address on one line, no country
address.street12 Main St
address.cityRegina
address.regionSK
address.postalCodeS4P 3Y2
address.countryCA

Those are the record's own key names, exactly as GET /v1/site reports them under contact — so read the record and reference what you read. Anything outside that list is rejected at the gate, because there is nothing behind it: a tagline, a licence number, a second location or an individual agent's direct line are page content, not site config.

It emits bare text and no wrapper element. Every other component gives you a structure to style; this one gives you a value, so it has to be able to sit mid sentence or inside a heading. You own the element around it:

<a class="site-phone" href="tel:+13065550100">
  <mk-component name="site-field" data-field="phone"></mk-component>
</a>

Note the href there is written out. The component prints text, so it cannot fill an attribute — a tel: or mailto: href is a different problem and is not supported yet. Until it is, that one value is duplicated and you have to keep the two in step by hand.

A field with nothing on file renders as nothing, so the write gate warns (site_field.unset) with the fields that _are_ on file. Fill the record in or drop the reference.

Forms

Every form is a component: contact-form, newsletter-form, or form with the fields you declare. Submissions land as leads (see _Where leads go_), or go to another system with data-action.

contact-form has four fields, and that is all of them

data-fields on contact-form is a comma list drawn from a closed set: name, email, phone, message. Any other name is rejected at the gate. Its other attributes are data-phone, data-submit-label, data-consent-label, data-form-id and data-success-message, plus the routing ones in _Where leads go_. newsletter-form takes the same, without data-fields and data-phone.

Need any other field — first_name, company, budget, a dropdown? Use the form component, which renders exactly the schema you declare:

<!-- WRONG: first_name/last_name are not part of the preset -->
<mk-component name="contact-form" data-fields="first_name,last_name,email"></mk-component>

<!-- RIGHT: declare the fields you actually want -->
<mk-component
  name="form"
  data-fields='[{"name":"first_name","label":"First name","required":true},
               {"name":"last_name","label":"Last name"},
               {"name":"email","type":"email","label":"Email","required":true}]'
></mk-component>

The same rule holds for the other closed sets: data-featured is agent/office on listings (or bare true/mine for "this site's own") and true/false on collection — different vocabularies for the same attribute name — and data-property-category is residential/commercial/agriculture. data-property-type is the exception: its values come from your feed, so an unrecognised one is a warning rather than a rejection. Read the real values with GET /__data/listings/facets?fields=PropertySubType — data-property-type="Commercial" is a category, matches no subtype, and renders an empty grid.

A form renders <form>/<input> markup with hooks like .mk-form, .mk-form__field, .mk-form__label, .mk-form__input, .mk-form__submit — style them in your stylesheet. Submissions POST first-party and land as leads; you never wire the backend. Referencing a component name that doesn't exist is rejected at the gate.

Custom forms — the form component

When you need fields beyond the presets (first/last name, a dropdown, a date, choices…), use name="form" and declare the fields as a JSON array in data-fields. Delimit the attribute with single quotes so the JSON's double quotes are literal:

<mk-component name="form" data-form-id="apply" data-submit-label="Apply"
  data-fields='[
    {"name":"first","label":"First name","type":"text","required":true},
    {"name":"last","label":"Last name","type":"text","required":true},
    {"name":"email","label":"Email","type":"email","required":true},
    {"name":"role","label":"Role","type":"select","required":true,"options":["Engineering","Design","Ops"]},
    {"name":"start","label":"Available from","type":"date"},
    {"name":"message","label":"Anything else?","type":"textarea"}
  ]'></mk-component>

Each field object: name (required, [a-zA-Z0-9_-], unique, not consent, website or anything starting mk_), label (defaults to name), type, required (default false), options (for select/radio; on checkbox it makes a multi-select group), placeholder.

Escaping inside data-fields. label, placeholder, options and a hidden field's value are HTML-decoded, so &amp; and &#39; arrive as & and '. Write whichever is convenient — a raw & is not an entity and is left alone. A straight ' still cannot appear raw (it would close the attribute), so &#39; is the way to write one. name is not decoded: it admits no character an entity can produce, so an entity there is rejected rather than repaired.

A required select opens on an empty option, so required can actually fire — otherwise the first choice is preselected and the constraint is satisfied before the visitor touches the control. Give it a placeholder to label that row ("Choose a start time"); it defaults to —.

Field type is one of: text, email, tel, url, number, date, time, textarea, select, radio, checkbox, hidden, file. There is no range type; a from/to is two fields. A hidden field carries a constant nobody types ({"name":"hotelid","type":"hidden","value":"1315"}) and requires a value. The exceptions: "fill": "script" for a value your own island writes before submit, and "fill": "row" with rowField for a value taken from the bound detail row. Only declared fields reach the handler; an <input> your script injects is silently dropped. A consent checkbox and spam honeypot are added automatically (drop consent with data-consent="false"). A malformed schema is rejected at the gate (gate.form_schema) with the exact problem, and submissions are validated against the same schema before a lead is stored.

File uploads. {"name":"resume","label":"Résumé","type":"file","required":true,"accept":["pdf","doc","docx"]} takes a visitor's file. accept narrows the kinds (pdf, doc, docx, jpg, png, webp, heic; absent means all of them) and "multiple": true takes up to five. Limits are 10 MB a file and 25 MB a submission. The server checks each file's bytes, so a file renamed to .pdf is refused with a message the visitor sees beside the form. Files are stored privately with the lead and deleted after one year. The email, the webhook (files[]) and the dashboard link each file as https://<site>/__files/<token>. That link works for anyone holding it until the file is deleted. To end one early, ask Moseik to delete the file. A file field cannot go on a data-action form (gate.form_offsite_file), and a collection cannot declare one.

Declare forms as components — never hand-write <form>

Always use <mk-component name="contact-form|newsletter-form|form">. Writing your own <form> element does not work, and fails in the one way you cannot see from the authoring side: the submit URL is minted per form at render time, and only a declared component is registered to receive it. A hand-written <form> posts to a URL that 404s. The page will look perfect.

The platform adds five things to your form at render that are not in your source:

AddedWhy
actionthe first-party submit URL, unique to this form
data-mk-formidentifies the form to the platform
hidden website fieldspam honeypot
hidden mk_ft fieldsigned anti-bot token, proving the page was rendered by us
/__mk/forms.js script tagfills a hidden mk_fn per-load nonce in the browser

That script also submits the form and confirms it, without reloading the page — see [After a submit](#after-a-submit) below. You do not write a submit handler.

Four rules follow from that, and they are the whole story:

  1. Reserved field names: consent, website, and anything starting mk_. A collision makes every submission fail, so the gate rejects it at write time.
  2. Style by class, never by position. .mk-form__field--<name> targets one field; :nth-child / :first-child on form children will land on a hidden field you didn't write.
  3. Bot protection is automatic. Don't add a captcha, don't try to generate mk_ft or mk_fn, don't remove hidden fields, and don't strip the /__mk/forms.js script tag.
  4. Never paste rendered form HTML back into a payload. Re-declare the component instead; a copied token is stale markup and a copied nonce is expired.

If submissions start returning 403 (verification failed — please reload the page and retry), the visitor was served a page rendered before the current token, or before /__mk/forms.js existed. Ask the operator to re-render the site. Nothing you can change in the page payload fixes it — removing the hidden fields makes it worse.

Submitting to someone else's system

Some forms are not lead capture. A resort books through a reservation engine, a venue sells through a ticketing provider — the conversion path leaves the site by design, and posting it into the leads pipeline would be wrong.

data-action on <mk-component name="form"> submits to that system instead:

<mk-component
  name="form"
  data-form-id="booking"
  data-action="https://www.reseze.net/servlet/WebresShowAvailable"
  data-fields='[
    {"name":"hotelid","type":"hidden","value":"1315"},
    {"name":"arrival","label":"Arrival","type":"date","required":true},
    {"name":"departure","label":"Departure","type":"date","required":true},
    {"name":"adults","label":"Adults","type":"number"}
  ]'
  data-submit-label="Check availability"
></mk-component>

The origin must already be on this site's approved external-origin allowlist, or the write is rejected. It is not optional: the page CSP pins form-action, so an unapproved origin would be refused by the browser anyway — the gate just tells you at write time instead of letting you ship a form that silently cannot submit. Proposing and approving the origin is two calls you can make yourself, with the sign-off of the person you are working for on the second one.

It is a real <form>, so submit-on-Enter, required and browser validation all work with no JavaScript. Three things are deliberately dropped, because all of them are addressed to us and this submission is not: no lead is stored, no spam honeypot, no anti-bot token. data-method picks get (default) or post.

Constants must be hidden fields, not query strings. data-action="…?hotelid=1315" loses hotelid the moment it submits, because a GET form discards its own action's query string and rebuilds it from the fields. Use {"type":"hidden","value":"…"} — that is what the type is for.

Consent defaults off here (we store nothing, so there is nothing to consent to); add data-consent="true" if the receiving system expects it.

After a submit

The form posts in the background and is replaced in place by a confirmation — a checkmark and a message. The page does not reload. If the submission fails validation, the reason appears beside the form (.mk-form__error) with everything the visitor typed still there.

All of this is automatic. Do not write a submit handler, a thank-you page, or a ?submitted=1 check.

A page is one cached object served to every visitor, so GET /contact?submitted=1 returns the same bytes as GET /contact.

To change the words, put data-success-message on the component:

<mk-component
  name="contact-form"
  data-success-message="Thanks — we'll be in touch within one business day."
></mk-component>

To change the whole thing, author your own element and mark it data-mk-form-success. Put it beside the form, or anywhere on the page if you give it the form's key. Add hidden so it does not appear before submitting:

<mk-component name="contact-form" data-form-id="enquiry"></mk-component>

<div data-mk-form-success="enquiry" hidden class="thanks">
  <h3>Message received</h3>
  <p>We reply to every enquiry within one business day.</p>
  <a href="/case-studies">Read our case studies while you wait →</a>
</div>

Yours is used instead of the default, and it is styled entirely by you — this is freeform HTML/CSS like everything else, not a themeable widget.

Tracking a conversion? Do not use a thank-you URL — there is no navigation to count. A successful submit fires both of these:

// bubbles from the form
document.addEventListener("mk:form-success", (e) => {
  console.log(e.detail.formKey);
});
// and, if a dataLayer exists
window.dataLayer.push({ event: "mk_form_success", formKey: "…" });

Forms require JavaScript: the nonce is minted per page load rather than baked into the cached HTML, so a visitor with JavaScript off gets a 403. A browser without fetch falls back to a native POST and a redirect to ?submitted=1. The nonce is on for every site; only an operator can exempt one.

Two fields on one row

Add data-columns="2" (or "3") and style the hook with grid:

.mk-form--cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
/* Anything that should span the full width: */
.mk-form--cols-2 .mk-form__field--message,
.mk-form--cols-2 .mk-form__consent,
.mk-form--cols-2 .mk-form__submit {
  grid-column: 1 / -1;
}

Use grid rather than inline-block with calc() widths. Every field also carries .mk-form__field--<name>, so you can target one field (.mk-form__field--first_name) without changing the field order.

Verify a form end-to-end before calling it done: submit it, then check GET /v1/leads. A form can render perfectly and still not deliver — that failure happens on the visitor's POST, so no authoring call will ever report it.

Where leads go

Every submission is stored and readable via GET /v1/leads. By default each form's submissions also email the site-wide recipient (notifyEmail, set with PUT /v1/site). Any form (form, contact-form or newsletter-form) can override that with data-notify-email="dept@example.com"; an invalid address is rejected at the gate (gate.form_notify_email).

Before launch, email notifications go to a build inbox. While a site has no live custom domain, every lead email goes to Moseik on a site we build, or to the site's dashboard admins on a site its owner started. It ends by itself when the domain starts serving, so set the real client address from the start. GET /v1/site and GET /v1/forms report it at buildRouting. While buildRouting.active is true, a form test returning 200 does not prove the client receives anything; don't report it as delivering to them.

Several people. notifyEmail and data-notify-email take a comma-separated list of up to five addresses, each sent its own copy. Beyond five, use a distribution list on the client's own mail provider.

Reply reaches the person who enquired. The notification's Reply-To is the address the visitor submitted: the first email-type field on a declared schema, or the email field on contact-form / newsletter-form.

Copies, visible or silent. data-notify-cc puts an address in the headers where every recipient sees it; data-notify-bcc does not. Same list format and five-address cap; the site-wide equivalents are notifyCc / notifyBcc on PUT /v1/site.

Sending each lead to a different person

Everything above picks a recipient when the page is _rendered_. leadRouting picks one when the form is _submitted_, which is how a lead belongs to whoever brought the visitor:

PUT /v1/site
{
  "leadRouting": {
    "field": "attributedAgent",   // the SUBMITTED field carrying the recipient key
    "fallback": "inbox",          // or "round-robin" when nobody is named
    "overrides": { "1520210": { "exclude": true } },
    "listingAgent": true,         // a listing page's enquiry goes to the listing agent
    "noAgentForms": ["career-inquiry"]  // these forms never go to an agent
  }
}

The key is opaque (an agent id, a branch code, a territory) and must be an id, never a display name: a name match files a real lead with the wrong person and raises no error. Whatever writes the field (an island, a hidden constant on a branch page, a select) can change without touching this config.

An unknown key, an inactive one and an empty rotation pool all fall through to the inbox. round-robin shares leads out oldest-waited-first.

Before you trust it:

Forwarding leads to a CRM or webhook

Separately from the email, a site can forward submissions to a CRM or webhook. By default every form goes to every destination the site has. To send one form somewhere different, name the destination:

<mk-component name="form" data-form-id="auto-quote" data-lead-destination="underwriter">

The name is all that appears in the page — never a URL and never a secret — and comma-separating several sends to each. A form with no data-lead-destination keeps going to all of them; data-lead-destination="inbox" keeps its leads in the site inbox and forwards them nowhere. Read GET /v1/lead-webhooks for the names this site has; a name that is not one of them is rejected at the gate (gate.form_lead_destination), because a form routed at a destination that does not exist submits perfectly and forwards nothing. Configuring the destinations is in the API reference.

When the destination sends the email. data-notify="fallback" beside a named destination holds the site's own email until the forward answers, and sends it only if the forward failed or the receiver replied notified: false. Otherwise the lead's notification.status reads skipped. The gate refuses it without a destination, or with inbox (gate.form_notify_mode), since then nothing would email the lead.

Listings

Real-estate listings from the site's feed, server-rendered so crawlers see them: a grid (listings), one template for every detail page (listing-detail), and a map (listings-map). Read _Turning listings on_ first.

Turning listings on

listings renders an empty grid, and listing detail routes 404, until the site has a listings provider. No page markup works around it. GET /v1/site tells you where you stand:

"listings": { "enabled": true, "provider": "ddf", "market": { "province": "Saskatchewan" },
              "featured": { "available": true, "officeKey": "264739" } }

You turn it on yourself, on the site's own token:

The vertical decides which a site may have, and the plan must include listings.

Then tell your human one thing they must do themselves. On the MLS feed the agent or brokerage has to select Benchmetrics as their technology provider on CREA's DDF dashboard, or CREA can shut the feed off. Listings work in the meantime, and their own listings may already show; that does not make this site's use of the feed permitted. The PUT response carries this as tellYourHuman; pass it on rather than treating the site as finished. GET /v1/site → listings.techProvider.confirmed says whether they have. The guide to send them is moseik.ca/ddf-setup.

Leave city out of the market unless the site serves only that town: it floors every query, so an area page for the next town would render this town's listings under that town's heading.

What a grid shows: the whole market. Every listing in the site's province (and city or region, if one is set), not just the owner's own. The market is site config, applied after your attributes, so a page cannot show a different market; there is no data-province, and the detail route re-checks the market too.

Featured / "my listings" sections. data-featured="agent" (or "office") narrows a grid to the site's own listings, using keys held in the site config:

<!-- the whole market -->
<mk-component name="listings" data-limit="12"></mk-component>

<!-- just this agent's own listings -->
<mk-component name="listings" data-featured="agent" data-limit="6"></mk-component>

GET /v1/site → listings.featured.available says whether the site has a key to feature by; without one, data-featured falls back to the whole market. available: false is fixable: look the key up and set it with PUT /v1/listings/market. Never paste an office or agent id into markup; it goes stale the day the agent changes brokerage.

One named agent, on a brokerage site. data-agent-key="<MemberKey>" is the one exception, for an agent's own landing page inside a brokerage's site:

<mk-component name="listings" data-agent-key="1520210" data-limit="6"></mk-component>

Use the MemberKey that agent-roster renders, never a name. The platform pairs it with the site's office key, so a key belonging to somebody else, or to an agent who has moved, renders an empty grid rather than the wrong person's listings. Two states render perfectly and need checking: data-mk-agent-unscoped on the wrapper means the site has no office key, so the grid is the whole market under your heading; data-mk-agent-empty means the pairing matched nothing (an empty roster entry or a wrong key).

The site's own listings (data-featured, data-agent-key) are not limited to its province. They include confidential listings, usually businesses for sale, which CREA publishes with no address, city or province; a card shows "Address not disclosed".

If enabled is false, say so plainly to whoever asked for the site, build the rest of the page and leave the grid in place. Do not hard-code listing markup, paste sample listings or substitute images: the grid fills in once the provider is on, and fake listings on a real-estate page are a compliance problem. A site that shows listings through its own provider's embed doesn't need the feed; use an <iframe>.

Two feeds: MLS resale, or a builder's own lots

GET /v1/site → listings.provider says which one this site reads. ddf is the MLS feed described above. evrylist is a home builder's own new-construction inventory — same components, same detail route, different data.

On a builder's site:

Rentals beside MLS listings

A brokerage on the MLS feed can also show its own EvryList rentals (property management). PUT /v1/listings/scope { "orgIds": ["<org>"] } stores the EvryList org beside the MLS feed; GET /v1/site → listings.evrylist confirms it. A site owner who connects EvryList under Connected Products gets the same scope (and loses it on disconnect), so check GET /v1/site before writing one. Nothing changes until a page names it:

<mk-component name="listings" data-source="evrylist" data-kind="rental"></mk-component>

"fill": "row", "rowField": "detailId"}. The site inbox is notified as usual; add data-notify="fallback" when EvryList should send the email, and the site's own goes out only if the forward fails or EvryList reports it emailed nobody. Once EvryList is linked, a form naming no destination reaches EvryList too, so give the MLS forms their own data-lead-destination, or "inbox"` to forward them nowhere.

Resale and commercial listings

A brokerage's own EvryList listings use the same scope and template rules as rentals, with data-kind="resale" or data-kind="commercial" and meta.listingKind to match. data-kind="resale,commercial" shows several kinds in one grid; new-construction cannot share a grid. PATCH /v1/pages/:id sets or clears listingSource and listingKind on an existing template.

Styling the listings grid

Hooks: .mk-listings, .mk-listings__grid, .mk-listing, and per-card .mk-listing__photo, __price, __address, __facts, __mls, __brokerage, plus the collection's .mk-listings__attribution wrapper holding .mk-listings__realtor-logo and .mk-listings__trademark. Style it however the site's design calls for.

A card that is not simply for sale carries data-mk-status="pending" or data-mk-status="sold" on .mk-listing, plus a .mk-listing__status line inside it. An available one carries neither, so [data-mk-status] selects exactly the listings that need calling out — which matters most on builder inventory, where a sold lot stays in the grid.

The whole card is already a link, and you do not wire that up. .mk-listing__link is an empty anchor stretched over the card by the base layer, so clicking the photo, the address or anywhere else opens that listing's detail page — the photo and the address are not inside an anchor themselves.

Two consequences worth knowing:

z-index: 2` to lift it above the overlay.

The base layer also gives .mk-listings__grid an auto-filling responsive grid and strips the <ul> bullets. Replace it with whatever the design calls for — every rule is a single class, so your rule wins.

A card with no photo carries data-mk-no-photo, so you can size and fill the gap. Put the placeholder height on the card or a wrapper — not on .mk-listing__link, which is the click overlay and has no layout of its own:

.mk-listing[data-mk-no-photo] { min-height: 22rem; }

Don't put words such as "No photo yet" in that placeholder: new listings often reach the feed before their photos do, so the claim is usually wrong.

Some cards show no sale price: a listing for lease renders its lease figure ($4,248.75/month, or For lease: $20 when the feed states no period), and one with neither renders Contact for Price, roughly one listing in ten. Style .mk-listing__price so all three read well.

Cards carry no REALTOR.ca link. The logo appears once per grid, unlinked; the per-listing REALTOR.ca link is on the detail page, emitted by listing-detail. Don't add one to a card.

object-position: top left is already the default on .mk-listing__photo — you only need the sizing:

.mk-listing__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover; /* object-position: top left comes from the base layer */
}

Listing photos carry the REALTOR® watermark in the top-left corner, and displaying it is a licence condition; a centred object-fit: cover crop removes it. This applies to every listing image the platform emits, on cards and detail pages. If you override object-position, or a surface crops aggressively, give visitors a route to the full uncropped image (a lightbox on .mk-gallery, for instance).

Pair the grid with a map, on the same page. A property search with no map reads as unfinished next to any portal a client will compare the site against — see [_A map of your listings_](#a-map-of-your-listings--the-listings-map-component). It takes no attributes: drop <mk-component name="listings-map"></mk-component> beside the grid, give the hook a height, and it follows whatever the grid asked for. The gate warns (render.listings_no_map) on a filterable search page or a listing detail page that has none.

If the site you are cloning keeps its map on a separate page, put it beside the grid anyway and tell the client, or ask first.

Unless the client asks for something else, build it as a two-pane split: filters across the top, a sticky map beside a scrolling column of cards. That is the layout of every portal their buyers already use, and it is the shape listings-map was designed for — clicking a pin scrolls its card into view, which only does anything when the cards are in a scrollable column. The three rules that produce it are in [_A map of your listings_](#a-map-of-your-listings--the-listings-map-component).

Take the layout, not the look. Where the design work belongs — all of this is meant to differ from site to site:

What should not change without a reason from the client: that there is a map, that it sits beside the list rather than below it or on its own page, and that the filters sit above both.

Give it a mobile story or it ships broken. A 1fr 1fr split at 80vh is unusable on a phone, and squashing it is the most common way this layout goes out wrong. Stack it:

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    height: auto;
  }
  .split .mk-listings {
    height: auto;
    overflow: visible;
  }
  .mk-listings-map {
    height: 50vh;
    position: static;
  }
}

Keep the list as the phone's default view — a map above it, or behind a toggle. Cards are what a visitor scrolls; the map is how they orient.

What you can filter by

Every filter below works in three places, under the same names: as a data-* attribute on the listings component (server-rendered, so crawlers index the result), as a query param on /__data/listings (interactive), and — on a grid that opts in with data-url-filters — as a query param on the page's own URL, which is what makes a search shareable. Use the component for the page's default state, the URL for what the visitor searched, and the endpoint for repainting without a reload.

FilterComponent attributeQuery param
citydata-city (one, or a comma list)city
place match modedata-match (exact)match (or cityMatch)
neighbourhooddata-neighbourhoodneighbourhood
MLS® number—mls (exact, one result)
property classdata-property-categorypropertyCategory
property typedata-property-type (one, or a comma list)propertyType
dwelling typedata-structure-type (one, or a comma list)structureType
street addressdata-address (free text)address
map boxdata-bbox (south,west,north,east)bbox
pricedata-min-price / data-max-priceminPrice / maxPrice
bedroomsdata-min-beds / data-max-bedsminBeds / maxBeds
bathroomsdata-min-baths / data-max-bathsminBaths / maxBaths
square feetdata-min-sqft / data-max-sqftminSqft / maxSqft
keep unstateddata-include-unknownincludeUnknown
orderingdata-sortsort
results per pagedata-limit (default 12, max 48)limit
page—page

A region is a list of towns or a box. data-city="Quesnel,Prince George,Fort St. John" with data-match="exact" matches each town exactly; data-bbox="52.5,-124.5,58,-119.9" keeps the grid inside a box in degrees. On a grid with data-url-filters, /search?bbox=52.5,-124.5,58,-119.9 opens the search on that box, and a malformed bbox is dropped and named in data-mk-dropped. A listings-map beside a region grid searches inside both its viewport and the grid's box.

For a brokerage that serves one region everywhere, set it on the site instead: cities and bbox on set_mls_listings (see the API reference). That region is applied after page attributes, so a page can narrow to some of its towns or a smaller box but never past it, and the site's maps open on the box.

A multi-word place needs data-match="exact". The feed matches data-city and data-neighbourhood by token-OR: data-city="Fort Frances" returns every row containing Fort or Frances, including Fort Erie, and Lake Echo and Porters Lake, 60 km apart, return the same listings. The page renders a healthy count of real listings for the wrong towns, so check which cities come back, not how many rows. The write gate warns on any multi-word value, in an attribute or a pre-filtered link.

<mk-component name="listings" data-city="Fort Frances" data-match="exact">
</mk-component>

More filters that fail without an error:

- The unstated bucket dominates, so don't label the result as a range. - Send it to /__data/listings/facets as well, or your filter counts describe a different set than the grid.

Ordering the results — data-sort

newest · oldest · price-asc · price-desc. The order applies to the whole result set, so "the ten cheapest homes in this market" is one query and page 2 follows page 1.

<mk-component name="listings" data-sort="price-asc" data-min-price="50000"></mk-component>

Pair a cheapest-first grid with a minPrice floor: the feed carries junk prices ($1, $700), and raw ascending order opens on them.

Filtering the server-rendered grid

Put the page's default filters on the component, so the results a crawler sees are the results the page is about:

<mk-component
  name="listings"
  data-min-beds="3"
  data-min-baths="2"
  data-min-price="400000"
  data-max-price="900000"
  data-limit="24"
></mk-component>

For "all commercial" or "all residential", use data-property-category. The feed has no category above subtype and no Commercial value at all, so the platform expands a class into the subtypes it covers:

<mk-component name="listings" data-property-category="commercial"></mk-component>
classcovers
residentialdwellings — Single Family (which in this feed includes condos and townhouses) and Multi-family
agriculturefarmland, plus Vacant Land
commercialeverything else — Retail, Industrial, Business, Office, Hospitality, Parking, Institutional, Recreational, Other, and Vacant Land

Vacant Land is deliberately in both agriculture and commercial — a bare parcel is legitimately either depending on who is buying, and a buyer shouldn't have to guess which tab we filed it under. So the classes overlap; they don't partition.

data-property-type still takes a comma list if you want to name subtypes exactly, and it wins when both are set — a page that named its subtypes meant them:

<mk-component name="listings" data-property-type="Office,Retail,Industrial,Business"></mk-component>

Filtering in the browser instead — fetching a wide set and hiding cards with CSS or JS — breaks two things quietly: the indexed grid stops matching what a visitor sees, and the totals you page against still describe the unfiltered set, so "page 3 of 11" becomes fiction.

A search people can share — data-url-filters

Without this, filter state lives only in JavaScript: a copied URL sends the unfiltered page, other pages cannot link into a search, and Back walks out of it. Add data-url-filters and the grid reads the page's own query string server-side:

<mk-component name="listings" data-url-filters="all" data-limit="24"></mk-component>

/listings?city=Warman&minBeds=3 now renders those results in the HTML the server sends, which your own JS cannot do.

Accepted names are the query names, not the data-* spellings:

city, match, cityMatch, neighbourhood, propertyType, propertyCategory, structureType, address, bbox, mls, minPrice, maxPrice, minBeds, maxBeds, minBaths, maxBaths, minSqft, maxSqft, includeUnknown, sort, limit, page

Name a subset instead of all when only some should be URL-driven: data-url-filters="city,propertyType,minPrice,maxPrice".

What the URL does to the grid:

The wrapper publishes what happened:

attributemeaning
data-mk-url-filtersfilters taken from the URL, comma separated
data-mk-droppedfilters named in the URL whose value could not be used
data-mk-pagethe page number being shown
data-mk-defaultsthe page's own data-* filters, as JSON
.mk-listings[data-mk-dropped]::before {
  content: "Some filters in that link weren’t understood — showing a wider search.";
}

The page's scope survives a search. A grid's own data-* attributes are what the _page_ is about; the query string is what the _visitor_ asked for. Both apply, and the grid publishes the first as data-mk-defaults so the filter form's repaint merges them exactly as the server does. So on

<mk-component
  name="listings"
  data-property-type="Single Family,Multi-family"
  data-limit="48"
  data-url-filters="city,minBeds,page"
></mk-component>

a search for Caledon returns Caledon residential listings, 48 a page — whether the visitor followed a link, submitted the form, or reloaded. .reset() and a cleared form return to that scope, not to the whole market: a residential route resets to residential.

Only a grid with data-url-filters publishes it, and only the filters the page actually sets. It is informational — you never write it.

featured is deliberately not a URL filter. It selects the site's own listings from keys held in site config, so accepting it from the query string would let anyone turn a whole-market page into "our listings" (or the reverse) by editing the URL.

Leave the attribute off an editorial grid. A homepage strip headed "Our featured listings" must not be re-filterable by a stranger appending ?city=Toronto. Opt in on the page that _is_ a search; every other grid stays what it says it is.

Indexing. A URL carrying filters is served per request and marked noindex, and its canonical points back at the bare route. Filter permutations are unbounded, so indexing them would dilute your real listings page across thousands of near-duplicate URLs. The bare /listings is unaffected — still statically cached, still indexed.

The filter form — .mk-listings-filters

Write an ordinary GET form. The control name is the filter name:

<form class="mk-listings-filters" method="get">
  <select name="city" data-mk-facet="City">
    <option value="">Any city</option>
  </select>
  <select name="propertyType" data-mk-facet="PropertySubType">
    <option value="">Any type</option>
  </select>
  <input type="number" name="minBeds" min="0" placeholder="Beds" />
  <input type="number" name="maxPrice" min="0" placeholder="Max price" />
  <button type="submit">Search</button>
</form>

The platform ships no markup and no styling for this — the form above is yours, class hook aside. With JavaScript switched off it still works: the browser submits it, the URL becomes ?city=…, and the server renders that grid.

With JavaScript the runtime adds the parts every site was rebuilding:

The URL holds the search, not the page's scope — ?city=Caledon, never the page's own propertyType. So a shared link stays short, and it keeps meaning "Caledon listings on this page" even after you change what the page is scoped to. The one thing it does spell out is a cleared control the page defaults (?minBeds=), because otherwise reloading that link would bring the default straight back under an empty box.

A control whose name is not a filter is ignored — it changes the URL and returns the same listings, which looks like a search that ran. The gate warns about both that and a control naming a filter the grid left out of data-url-filters (which works until the link is shared, then silently doesn't).

data-mk-facet="City" fills an empty <select> from the values the feed actually holds (any of City, PropertySubType, CityRegion, StateOrProvince, StructureType). Options you write yourself are never overwritten, which is right for a sort control.

Other attributes: data-mk-auto on the form submits on every change (no button); data-mk-target="#results" picks the grid when a page has more than one.

Style the states — both are absent until they apply:

.mk-listings-filters[data-mk-loading] button { opacity: 0.6; }
.mk-listings-filters[data-mk-error]::after { content: "Listings are temporarily unavailable."; }

For controls that aren't a form — a "3+ beds" chip row, a saved search — use window.mk.listingFilters: .apply({ minBeds: 3 }) merges and re-runs, .reset() clears, .current() returns the active filters. The form also emits mk:listings:updated (with total, totalPages, page) and mk:listings:error.

Once a page has data-url-filters, any other page links straight into it:

<a href="/listings?city=Warman&minBeds=3">Homes in Warman</a>

Use the filter names exactly — they are case-sensitive, and the wrong one is silent: the link works, the page loads, the grid renders the unfiltered market. ?beds=3 and ?neighborhood=Sutherland both read perfectly and filter nothing (it is minBeds, and the Canadian spelling neighbourhood). The write gate warns on links whose params are not real filter names, but the target page still needs the attribute or the link is inert.

Separating two params, write &amp; — the ordinary HTML escape, and what a validator expects inside an attribute:

<a href="/all-listings?city=Saskatoon&amp;neighbourhood=Brighton">Brighton homes</a>

A bare & works too, and the gate reads both the same way.

Ask what values exist — GET /__data/listings/facets

Build every filter control from this, never from a list you typed. The feed answers a value it does not hold with an empty grid and no error, so a dropdown of invented options goes live looking finished and matching nothing. There is no Commercial subtype, for instance; use data-property-category.

const res = await fetch("/__data/listings/facets?fields=PropertySubType&city=Orangeville");
const { total, facets } = await res.json();
// facets.PropertySubType.values → [{ value: "Single Family", count: 177 }, …]

fields accepts PropertySubType, StateOrProvince, City, CityRegion, StructureType (default PropertySubType,City); anything else is a 400 naming what is supported.

It takes the identical filters /__data/listings does — every bound, structureType, bbox, includeUnknown, all of them — so hand it the same query string as the grid and the counts describe that grid.

exact: true means the counts are complete. City, CityRegion and StructureType are open vocabularies and come back sampled — the values are real, the counts are indicative. Scope a StructureType facet (province + propertyType=Single Family) and the residential vocabulary resolves cleanly; unscoped, it is a list of whatever a large sample happened to hold.

Interactive filtering — GET /__data/listings

The listings component renders server-side, so crawlers see the listings in the initial HTML. For a filter UI a visitor drives — city dropdown, property type, paging — fetch this same-origin endpoint from your site JS instead of re-rendering the page:

const res = await fetch(`/__data/listings?city=${encodeURIComponent(city)}&limit=12&page=1`);
const { listings, html, page, totalPages, total } = await res.json();
document.querySelector("#results").innerHTML = html; // ← prefer this

Params are the query names in _What you can filter by_, plus source/kind for an EvryList grid and featured (office/agent) or agentKey for the site's own listings; those four are echoed in data-mk-scope, and the built-in filter form, Load more and map carry them. Anything else is ignored. The site's market cannot be widened from the query string.

Use html rather than building cards from listings. html is rendered by the same component as the server-rendered grid, so the CREA display requirements (brokerage name, watermarked photo, the one logo and trademark notice) come with it. listings is for counts, sorting and map pins; render cards from it yourself and meeting those requirements becomes your page's responsibility. Each row also carries photos[] and agentName. The endpoint is noindex, which is why the server-rendered grid still matters.

A search box needs both address and mls. address is free text and does not match an MLS® number, so route what the visitor typed: an MLS number goes to mls=, anything else to address=. Both return the same shape. mls= is an exact lookup returning at most one listing inside the site's market; there is no partial or type-ahead MLS matching. Alternatively, navigate: <detail base>/<MLS number> redirects to the canonical /…/<mls>/<slug> URL, or answers 410 if the listing has left the feed.

A feed outage is a 502, never an empty result. A 200 with zero listings means the filters genuinely matched nothing; anything else means the feed did not answer. Don't paint "no listings match" over an outage. Retrying once on a 502 is reasonable.

A 504 is different, and must not be retried. It means the feed ran out of time on _that query_, and it is deterministic: upstream paging cost grows with depth, so a very deep page never answers. Ask for less instead: an earlier page, a narrower filter, or a map viewport.

Pagination for the grid

The grid publishes its own query and the feed's totals:

Attribute on .mk-listingsMeaning
data-mk-scopethe query it ran, as JSON, using the names /__data/listings accepts
data-mk-totalhow many listings match. Absent when unknowable — see data-mk-partial
data-mk-total-pageshow many pages at the grid's limit. Absent whenever data-mk-total is
data-mk-partialthe grid holds SOME of the matches and cannot count the rest. Both totals are absent, and a pager built from them must not render. Say "showing the first N" rather than inventing a number
data-mk-pagethe page being shown (only on a grid with data-url-filters)
data-mk-pagingthe data-paging mode in force (more / auto), when one is set
data-mk-exhaustedset once there is nothing left to load

Three ways to page, simplest first:

  1. data-paging (below): the component emits and runs a Load more control.
  2. ?page=N on the page URL, on a grid with page in data-url-filters: a real server-rendered page, so link the pager and each page is a shareable URL.
  3. /__data/listings with the scope plus &page=N: replace the grid's markup with the html it returns, and call window.mk.bind() on it.

Page against totalPages (data-mk-total-pages), never against "this page came back short". Under radius search the totals over-count (a bounding box, about 27% high) and a page inside a larger set can return fewer rows than limit. total is an upper bound; label it "about N results". The feed also stops serving rows past roughly page 1,750 while still claiming more, so stop when a page returns nothing.

const { html, page, totalPages } = await res.json();
nextButton.disabled = page >= totalPages;

On the server-rendered grid a feed error renders total: 0, totalPages: 0, so a next-page control disables itself; on /__data/listings it is a 502 or 504.

Endless listings — data-paging

Do not hand-roll infinite scroll. Add data-paging to the grid:

<mk-component name="listings" data-url-filters="all" data-paging="auto" data-limit="24">
</mk-component>
ValueBehaviour
moreloads the next page when the control is clicked
autothe same, and also when the control nears the viewport — endless scroll

The component emits the control as .mk-listings__more inside the grid wrapper, carrying data-mk-more (what the runtime binds; don't remove it). Label it with data-more-label. New rows are appended. Style the states on .mk-listings: data-mk-paging carries the mode, data-mk-loading is set while a page is in flight, data-mk-error if one failed, and data-mk-exhausted once there is nothing left (the control is also hidden then).

.mk-listings[data-mk-loading] .mk-listings__more {
  opacity: 0.6;
}

mk:listings:appended fires on the grid after each page (detail: page, total, totalPages, added), and mk:listings:error on a failed one.

Prefer more when the page has a footer worth reaching; endless scroll pushes it out of reach.

Leave the map alone when you paginate: it follows the viewport, not the grid's page. window.mk.listingsMap.refresh() is for a changed search from a control that is not a form (a <form class="mk-listings-filters"> calls it for you). It reads the grid's data-mk-scope, so call it _after_ you have replaced the grid.

Listing detail pages — one template, every listing

Publish a page whose route carries the pattern /listings/:mls/:slug and put <mk-component name="listing-detail"> in it. The router resolves that segment, binds that listing, and serves the template — so you author one page and get every property. A wrong slug on a correct id 301s to the canonical URL; an id that has left the feed answers 410, and one that never existed 404s.

The :mls segment holds whatever identifies a listing on this site's feed: an MLS number on the MLS feed, a lot id on a builder's. {{listing.mls}} renders empty on a builder's lot, so do not build a title around it.

Fields in your own markup

On a listing or collection detail template, any element can take one field of the bound listing or row:

<a class="btn" data-mk-href="applyUrl" data-mk-if="applyUrl">Apply now</a>
<h2>Homes in <span data-mk-text="city">your area</span></h2>

> Publish this route BEFORE any page with a grid. A card's link is added only when a > matching detail route already exists at render time; without one a card has no link at > all, and nothing reaches a listing page. Publishing the route later does not fix grids > that are already live: re-push them. The write gate warns > (listings.no_detail_route) if you publish a grid first, but it cannot re-render pages > you published earlier. The same holds for each EvryList kind's own template.

Each listing gets its own <title> and description, derived from the bound listing — you do not have to do anything for that. Left as a plain title like "Listing", the served title becomes "<address>, <city> | <Site Name>", and the description comes from the feed's own remarks (trimmed to 160 characters on a word boundary).

To control the format yourself, put tokens in the page's title or meta description:

title: "{{listing.address}}, {{listing.city}} — {{listing.price}} | Acme Realty"

Available: {{listing.address}}, {{listing.city}}, {{listing.province}}, {{listing.mls}}, {{listing.price}} (the lease figure when there is no sale price), {{listing.beds}}, {{listing.baths}}, {{listing.sqft}}, {{listing.brokerage}}.

Three behaviours worth knowing:

Tokens work in the title and meta description only, not in page HTML.

You do not need an h1 of your own. listing-detail emits the address as the page's <h1> (.mk-listing-detail__address), which is the reason tokens are not needed in page HTML — and the reason a static heading is the wrong fix. "Property for sale" on every listing is the duplicate-signal problem the per-listing title above exists to avoid.

Auditing this page audits a real listing. GET /v1/pages/:id/verify, GET /v1/pages/:id/screenshot and the write gate's lints all bind one representative listing — the one with the most photos out of a sample — before measuring, because the template on its own renders an empty placeholder. Each says which listing it used (audit / X-Mk-Bound / an audit.bound_sample warning). It is one listing, so a finding about a 40-photo gallery is evidence about that gallery, not all of them.

Every photo is emitted, and the base layer lays them out. listing-detail emits every photo the feed carries for that listing — often 20–40 of them — as repeated .mk-listing-detail__photo elements inside a .mk-listing-detail__gallery wrapper. Cap it with data-photos="6" (default 12, max 48). A one-photo listing emits the bare .mk-listing-detail__photo with no wrapper, so single-photo CSS keeps working.

The wrapper arrives as a responsive thumbnail grid (4/3, cropped top left). Restyle it freely, and check the detail page at a real listing before you call it done.

The first photo is eager; the rest are loading="lazy", so a 37-photo listing does not cost several megabytes up front. The wrapper also carries .mk-gallery, so clicking a photo opens the lightbox with no extra authoring.

Want a stage with a thumbnail rail instead of a grid? Add data-gallery="stage" — do not build the swap yourself. The component emits a .mk-listing-detail__stage image followed by the same photos in a .mk-listing-detail__rail (which stays the .mk-gallery), and the runtime wires the rest: a thumb click drives the stage (the active thumb gets .is-active; the wrapper publishes data-mk-index, 1-based, and data-mk-count), and clicking the stage opens the lightbox at that photo — thumb clicks deliberately do not. The stage sits outside the .mk-gallery so the lightbox still counts 12 photos as 12.

On MLS listings the rail loads realtor.ca's 256×200 copy of each photo, and the stage and lightbox load the full photo only when it is shown. Keep rail thumbs at or below about 128px wide, or they will look soft on high-density screens. The same works in a gallery you build yourself: put the small file in src and the full one in data-mk-full, and the stage and lightbox show data-mk-full.

The base layer ships the working shape — a full-width stage above a horizontally scrolling strip of 96×72 thumbs — so data-gallery="stage" alone is a usable gallery. Style .mk-listing-detail__stage and .mk-listing-detail__rail to taste; the stage gets no crop, so if you give it a fixed aspect ratio, use object-fit: contain.

The gallery element also carries data-mk-photos — how many photos it actually holds, after the data-photos cap and after listings with no imagery are accounted for. Style on it when a one-photo listing should not look like a gallery ([data-mk-photos="1"] .mk-listing-detail__rail { display: none }), rather than assuming every listing came back with a full set.

The value set is closed: anything other than stage is refused at write time, because an unknown value would silently render the flat grid and the page would look finished without its stage. A single-photo listing never splits, whatever the attribute says.

An MLS listing can show its rooms, fees and property details. Both are opt-in, so add them to the template rather than copying them off realtor.ca:

<mk-component name="listing-detail" data-include="details,rooms"></mk-component>

A builder's lot can show its floor plans and lot information. Both are opt-in:

<mk-component name="listing-detail" data-include="blueprints,lot"></mk-component>

Either renders nothing on a lot that states none, or on an MLS listing. The selected plan is not in the URL, so an old ?blueprint= link opens on the first plan.

The listing REALTOR® is named, in .mk-listing-detail__agent, above .mk-listing-detail__brokerage. Its own element, so you can restyle, reorder or hide it without touching the brokerage line, which is a display obligation. The element is absent when the feed carries only part of a name, so its presence means it holds a full one. Card rows on /__data/listings carry agentName too.

The REALTOR.ca logo renders at the bottom of the page, not inside the component. .mk-listing-detail__attribution (the linked logo .mk-listing-detail__realtor and the trademark notice) is moved below everything on the page, just above the footer, so your calculator, map and showing form all sit above it. Style it; don't hide or rebuild it.

The share card is the listing's own photo. og:image is set from the bound listing, so a property pasted into a message or a social post previews as that property rather than the site banner. A meta.ogImage set on the template is only a FALLBACK, used when the feed carries no photo — a fixed image would otherwise be the same share card on every property, which is the problem this solves.

meta.ogImage accepts either shape:

{ "assetId": "ast_…" }                                  // a first-party media asset
{ "url": "https://ddfcdn.realtor.ca/listing/…/1.jpg" }  // an allowlisted image host

The url form is limited to https on ddfcdn.realtor.ca or imagedelivery.net. Any other host is rejected (ref.image_host_not_allowed).

Shape matters. Social cards crop to about 1.91:1, so a tall or extremely wide image arrives as an unrecognisable sliver. The gate warns seo.og_image_aspect when a first-party og:image is outside a loose 0.5–3.0 range. Squares, 4:3, 16:9 and ordinary banners all pass silently; 1200×630 is the target. Only assetId images can be checked — nothing is claimed about a url image.

A map of your listings — the listings-map component

Put it next to a listings grid and it pins what the grid rendered:

<div class="split">
  <mk-component name="listings-map" data-title="Map of listings"></mk-component>
  <mk-component name="listings" data-city="Orangeville" data-limit="24"></mk-component>
</div>

You never pass it data-city or data-limit. Those go on the listings component; the map reads what the grid asked for and follows it.

Give .mk-listings-map a height. It has none of its own.

It plots the listings in the area the visitor is looking at. The cards give it pins instantly; after that every pan or zoom re-queries the feed for that viewport with the grid's current filters, and a filter change re-queries the area already in view. Don't build a "search this area" button, and don't fake a wider search client-side over a page of results. Markers are dots that cluster as you zoom out; click a cluster to zoom into it, a dot for a popup (thumbnail, price, beds/baths, address) that links to the listing's detail page.

Below zoom 10 it stops re-querying, keeps the pins it has, and sets data-mk-zoomed-out on the wrapper. Say so:

.mk-listings-map[data-mk-zoomed-out]::after {
  content: "Zoom in to see listings in this area";
}

Where it opens. It centres on the province (or town) the site is scoped to, with no attributes. It frames itself around the grid's cards only when they sit within about 150 km of each other. On a province-wide site, set data-lat and data-lng (both or neither) or ask Moseik to set the market centre, which GET /v1/site → listings.market.center reports as { lat, lng, zoom? }. data-zoom overrides the zoom on its own.

<!-- opens on a specific spot instead -->
<mk-component name="listings-map" data-lat="43.92" data-lng="-80.09" data-zoom="12"></mk-component>

On a listing detail page it shows that listing. The subject property is a teardrop pin, drawn on top and never clustered, whatever data-pin-color you pick. Add data-live="false" to pin only what the page already has and never query the viewport; on a detail page that leaves just the subject.

Map options:

<mk-component
  name="listings-map"
  data-style='[{"featureType":"water","stylers":[{"color":"#cfd8dc"}]}]'
></mk-component>

The grid can follow the map. Add data-follow-map to the listings grid. Its server-rendered first page stays until the visitor first pans or zooms; after that the cards are the listings in the map's view, with the grid's own filters, and carry data-mk-follow="area" and data-mk-total. Load more pages within that view. Below zoom 10 the grid returns to its full filtered search.

.mk-listings[data-mk-follow="area"]::before {
  content: attr(data-mk-total) " homes in this area";
}

Interactions with no JS: clicking a pin adds .is-active to its card and scrolls it into view, but only inside a scrollable container (a column with overflow-y: auto); hovering a card enlarges its pin. A card outside the current view has no pin; window.mk.listingsMap.focus(key) flies the map to any card's coordinates for a "show on map" control. The two-pane layout this is designed for:

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; height: 80vh; }
.mk-listings-map { height: 100%; position: sticky; top: 0; }
.split .mk-listings { overflow-y: auto; height: 100%; }

How many pins, and being honest about it

One viewport query is capped at 1000 pins, drawn as they arrive in pages; a box already seen on this page view reloads from memory. The wrapper publishes what happened:

AttributeMeaning
data-mk-pins-shownpins actually on the map
data-mk-pins-totalpins it was handed
data-mk-pins-loadedhow many it has fetched beyond the visible cards
data-mk-pins-scopehow many the feed says match the current query
data-mk-loadingpresent only while it is fetching — see below
data-mk-zoomed-outpresent while too far out to query — see above

Compare data-mk-pins-loaded with data-mk-pins-scope to say when the map shows only part of the view. Listings without coordinates (a few percent, mostly vacant land) stay in the grid and have no pin.

.mk-listings-map[data-mk-pins-shown]::after {
  content: attr(data-mk-pins-shown) " of " attr(data-mk-pins-scope) " on map";
}

Say that the map is thinking — [data-mk-loading]

A wide re-query takes a few seconds, during which the map still shows the previous answer. The wrapper carries data-mk-loading exactly while a fetch is in flight, and only when there is something to fetch, so a spinner is pure CSS:

.mk-listings-map { position: relative; }
.mk-listings-map[data-mk-loading]::before {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  background: rgba(255, 255, 255, 0.55) url(/media/ast_yourspinner) center no-repeat;
}

A "what is my home worth" seller page — seller-comparables

A visitor types their own address and gets real numbers about their street, in exchange for their contact details. This component is the numbers half, server-rendered.

It is not a valuation and it will not print one. What it reports is what is on the market nearby. An "estimated price" row in the design is your own markup and a static teaser, never labelled as a figure the platform computed; the visitor's own number comes from a human afterwards.

Before you build: this site must be able to geocode

Address entry runs through /__data/places/autocomplete and /__data/places/geocode (see _Address autocomplete and geocoding_). Both answer 404 until the site is provisioned with them, however correct your request. Read addressLookup.enabled on GET /v1/site first. If it is off, stop and ask: only Moseik can turn it on. A page built anyway shows a panel stuck in unbound, which looks like a page waiting for input.

The three moving parts

The page is one published route that serves two states.

  1. A declared form takes the address and the consent.
  2. /__data/places/geocode turns that address into coordinates and a signed token. You send the visitor to the same route with ?mk_addr=<token>.
  3. That request re-renders this page with the address bound, and the panel fills in server-side.
<mk-component
  name="form"
  data-form-id="lookup"
  data-submit-label="Get my report"
  data-success-message="Looking up your address…"
  data-fields='[
    {"name":"address","label":"Your address","type":"text","required":true}
  ]'
></mk-component>

<mk-component name="seller-comparables" data-radius="0.8"></mk-component>

Don't declare a consent field: the component adds one, and the name is reserved.

Wiring the geocode to the submit

/__mk/forms.js owns the submit and stores the lead. Hang the geocode off the success event, from the site's [island](#interactivity--per-site-javascript-islands):

// island
let session = null; // one per "visitor started typing an address"
let picked = null; // the placeId of the suggestion they chose, if any

document.addEventListener("mk:form-success", async (e) => {
  if (e.detail.formKey !== "lookup") return;
  // e.target is the form. It is hidden on success but stays in the DOM with its
  // values intact, which is why the address is still readable here — the event
  // detail carries only formKey.
  const address = e.target.elements.address.value;
  // Resolve the place they PICKED when there is one: it is exact, and the same
  // session token makes this the Details call that closes the billing session.
  const query = picked
    ? `placeId=${picked}&session=${session}`
    : `q=${encodeURIComponent(address)}`;
  const r = await fetch(`/__data/places/geocode?${query}`);
  if (!r.ok) return; // 502 — the lookup failed, not "no such address". Say so; don't navigate.
  const { results } = await r.json();
  // An empty list is a real answer — "we could not place that address" — not an
  // error. Say so and leave the visitor on the form; do not navigate.
  if (results[0]?.token) location.href = `?mk_addr=${results[0].token}`;
});

Set data-success-message to something like "Looking up your address…": it is on screen between the submit and the navigation. The lead is stored before the geocode runs, so an address Google cannot place is still a lead.

If you offer autocomplete suggestions as they type, listen on the declared form's own input (.mk-form__field--address .mk-form__input), debounce it, and thread one session uuid through every keystroke and into the geocode: autocomplete bills per session only when you do, and per keystroke when you don't.

The lead, in two stages

Both stages are ordinary [forms](#custom-forms--the-form-component). The first carries just the address and the consent, so an abandoned lookup is still a lead somebody may contact. The second, on the results view, collects name, email, phone and timeframe.

The token is the only way in

You cannot pass ?lat=&lng= yourself. The token proves the coordinates came from a geocode the platform performed. A missing, forged or expired one is not an error: the route falls through to the published page, which is the form.

The stored copy of the route is always the unbound state. A bound results response is not cached anywhere either — it is served Cache-Control: private, no-store, because the document contains the visitor's street address. It also carries X-Robots-Tag: noindex, noarchive. Both are response headers, not <meta> tags; check them with curl -sI 'https://…/your-route?mk_addr=…'.

Half the numbers are withheld, and that is the feature

<mk-component name="seller-comparables" data-reveal="count,lowest,dom"></mk-component>
data-revealShows
countHow many active listings are inside the radius
lowestLowest asking price
highestHighest asking price
medianMedian asking price
averageMean asking price
pricePerSqftMedian price per square foot
domMedian days on market
allEvery row above

Omit the attribute and you get count,lowest,dom. Everything not named is emitted withheld: the row is in the layout, marked data-mk-withheld, carrying a deliberately fictitious placeholder number, so blurring it hides nothing real:

.mk-comparables__stat[data-mk-withheld] .mk-comparables__value {
  filter: blur(5px);
  user-select: none;
}

An unrecognised name in data-reveal is refused at write time.

Prefer median over average

House prices are right-skewed, so one expensive listing drags the mean far above every other. If you are choosing the number, choose the median. dom is a median for the same reason.

Six states, and they are not interchangeable

data-mk-comparables on the wrapper:

ValueMeansSay
unboundNo address yet — the published pageThe form. This is what a crawler sees
okReal figuresThe panel
emptyNothing for sale inside the radius"No active listings within 800 m"
outside-marketThe address is outside the area this site covers"We don't cover that area" — and still show the form
degradedThe feed read failed"We couldn't load this — try again"
unconfiguredThe site has no listing providerNothing. A setup problem on Moseik's side

Never write "0 listings nearby" for degraded.

outside-market fires when the address is in another province than the site's market, or, on a site pinned to a city, outside that city. Where the province cannot be read off the address (a non-Canadian one), you get empty.

Radius, and reading back what you got

data-radius is in kilometres, and defaults to 0.8 — or 20 when data-property-category="commercial". It is clamped to 0.25–25.

Print data-mk-radius-km, not the value you asked for. A page requesting 200 gets 25, and "within 200 km" would then be false.

Set data-property-category (residential, commercial, agriculture) or data-property-type to say what a comparable is. Without one a house is compared against vacant land, parking spaces and industrial units, and the median still looks plausible.

Attributes to read before you lay the panel out

AttributeWhy you need it
data-mk-countThe sample size, emitted even when count is withheld; three comparables is a thin basis for a table
data-mk-radius-kmThe radius actually searched
data-mk-addressThe address as geocoded, from the server, so it survives a reload or a shared link
data-mk-withheldOn the wrapper: comma list of the stats being withheld. On one stat row: "1", which is what you hang the blur off
data-mk-statOn each row — count, lowest, highest, median, average, pricePerSqft, dom. Your styling and ordering hook
data-mk-sampledThe figures rest on the first page of a larger set; days on market is dropped entirely in this case
data-mk-matched-totalWith data-mk-sampled, how many listings matched. Over-counts by roughly 27% (see _Pagination_), so treat it as an order of magnitude, not a figure
data-mk-sample-sizeOn one stat, when its figure rests on fewer rows than the panel counted (price per sq ft needs a living area)

A stat the feed could not supply is omitted, not withheld, so do not write CSS or copy that assumes a row exists.

Collections and posts

Collections — lists that outlive the page

Events, offers, activities, testimonials: lists that change on their own schedule. A row is data, not markup: it lives behind /v1/collections, so adding one costs no page write, and a finished one stops rendering with nobody touching the site. You write rows through the API on the client's behalf; the owner's dashboard cannot edit them.

A collection is a named set of rows with a declared field schema: the field types a form's data-fields takes, plus image, link and list. The schema contract is in the API reference.

POST /v1/collections
{ "key": "events", "name": "Upcoming Events",
  "detailBasePath": "/upcoming-events",
  "schema": [
    { "name": "title",  "label": "Title",  "type": "text", "required": true },
    { "name": "starts", "label": "Starts", "type": "date" },
    { "name": "blurb",  "label": "Details","type": "textarea" },
    { "name": "photo",  "label": "Photo",  "type": "image", "altField": "photoAlt" },
    { "name": "photoAlt", "label": "Photo description", "type": "text" },
    { "name": "cta",    "label": "Book now", "type": "link" }
  ] }

Rows go in with POST /v1/collections/events/rows, and the grid renders them:

<mk-component
  name="collection"
  data-collection="events"
  data-featured="true"
  data-limit="4"
  data-sort="starts"
></mk-component>

data-featured="true" shows only the rows the client flagged — a homepage shows four while an index route shows all. data-sort names a declared field, with :desc to reverse. Style .mk-collection, .mk-collection__item and .mk-collection__field--<field name>; never by child position.

There is no ceiling on cards per page: leave out data-limit and every matching row renders, across as many grids as the page carries. To page a long one, see below.

One collection, two grids: data-where

data-where="<field>=<value>" narrows a grid to the rows whose declared field matches, so a page can carry two grids of the same collection under two headings:

<h2>Golf Offers</h2>
<mk-component
  name="collection"
  data-collection="offers"
  data-where="category=golf"
></mk-component>

<h2>Everything else</h2>
<mk-component
  name="collection"
  data-collection="offers"
  data-where="category!=golf"
></mk-component>

= and != are the operators; there is no AND/OR, and one comparison per grid. The field is one the schema declares — add a select for the grouping and the client picks from a list — and it filters before data-limit, so a limit counts the rows the grid is for. The comparison ignores case and surrounding spaces. On a list field, = matches a row whose list contains the value.

Use this rather than data-featured whenever two pages want different subsets: featured is one flag per row, shared by every page.

A clause with no operator is refused at write time, and so is a value outside a select field's declared options. A field the collection does not declare renders empty rather than unfiltered, and the write warns.

A long archive: data-url-filters="page"

One route can hold a whole archive. Page it rather than splitting it into a route per year:

<mk-component name="collection" data-collection="sales" data-sort="soldOn:desc"
  data-limit="24" data-url-filters="page"></mk-component>

data-limit is the page size (default 24, max 100). It works like page-list: page 1 is the cached static page, ?page=2 renders live and noindex, and a page past the end shows the last page. The grid emits its own pager:

<div class="mk-collection mk-collection--sales" data-collection="sales"
  data-mk-page="2" data-mk-total="61" data-mk-total-pages="3">
  …
  <nav class="mk-collection__pager" aria-label="Pagination">
    <a class="mk-collection__prev" rel="prev" href="/past-sales">Previous</a>
    <a class="mk-collection__next" rel="next" href="/past-sales?page=3">Next</a>
  </nav>
</div>

Rows past page 1 are indexed only through their own detail pages (in sitemap.xml). A collection with no detail route is crawled on page 1 alone, so put what must be found there.

Every other field type renders as text. image and link render as a real <img> and a real <a>.

TypeThe valueYou get
image/media/<asset id>, optionally ?w=<px><img class="mk-collection__image" data-field="photo">
linka site path, a full https:// url, mailto:, tel:, sms:<a class="mk-collection__cta" data-field="cta">

A list field holds several values, one per line in the row value, and renders each as <span class="mk-list__item" data-value="…"> inside span.mk-list, separated by span.mk-list__sep (", "). Hide the separators to draw chips. An unpaged grid has every row in the HTML, so to let visitors filter cards by a list, a page script can show and hide .mk-collection__item by the data-values it contains. Don't page a grid you filter this way: the script would only see the current page.

Both classes are shared by the grid and the detail page, the way .mk-date is, so one stylesheet rule covers a photo wherever it appears.

Don't add width, height, srcset or loading, and don't build the <img> in an island. The render path adds them (see _What the renderer injects into your <img> tags_), and an island's <img> is not in the served HTML a crawler reads.

Tell the grid how wide a card image is: data-image-width="364", the widest CSS px box a card image occupies in that grid. The cards then get a matching sizes; without it they fall back to sizes="100vw" and fetch a rung sized for the viewport. Prefer this to a ?w= cap in the row's value, which is shared by every grid and the detail page. A value that is not a whole number from 1 to 4000 is ignored, with a write-time warning.

Alt text and link text come from another field, per row. Put altField on an image (or labelField on a link) naming a declared text field, and that field supplies this row's value:

{ "name": "photo", "type": "image", "altField": "photoAlt" }

That field is then not also rendered as its own div. With no altField the image gets alt="" (decorative). A link with no labelField uses the field's declared label as its text. An altField/labelField naming an undeclared field, or set on the wrong type, is rejected when you write the schema.

A link renders as a sibling of .mk-collection__link, not inside it, because a card with a detail route is already one anchor and anchors cannot nest:

<article class="mk-collection__item" data-slug="the-wyld-trivia">
  <a class="mk-collection__link" href="/upcoming-events/the-wyld-trivia">
    <img class="mk-collection__image" src="/media/ast_…" alt="Trivia night at The Wyld" …/>
    <div class="mk-collection__field mk-collection__field--title">Trivia Night At The Wyld</div>
  </a>
  <a class="mk-collection__cta" href="/the-wyld" data-field="cta">Book now</a>
</article>

It is hoisted whether or not a detail route exists, so publishing the detail template later does not change the shape your CSS is written against. On a detail page nothing wraps the fields, so a link renders in place like any other value.

Already storing the path in a text field? Retype it with PATCH /v1/collections/<key> and "type": "image" on that field; the stored values start rendering as pictures. The retype is refused, naming the field and one offending row, if any row holds a value the new type cannot render.

An image value has to be a picture this site uploaded. Upload with POST /v1/media (or POST /v1/media/import from a URL), then store the path it returns. The only off-site values accepted are our own Cloudflare Images account and CREA's photo CDN. A well-formed asset id that was never uploaded, or one that is a PDF or a video, is refused too.

Editing what is already there

To changeSend
one rowPATCH /v1/collections/events/rows/<id>
the name/schema/routesPATCH /v1/collections/events
remove a rowDELETE /v1/collections/events/rows/<id>
remove the whole thingDELETE /v1/collections/events

A row patch merges data field by field. Send { "data": { "starts": "…" } } to change the start time and nothing else; the other fields are untouched. Clear an optional field by sending it as "". The merged row is validated as a whole, so a patch can never leave a row a fresh write would have rejected. A visibility bound you don't mention keeps its stored value — send null to remove one.

Rows carry authorship. Every row read includes createdBy and updatedBy (null on rows older than the columns), so "who last changed this event" is a read, not a guess. A delete records the full row in the audit trail — data, window, flags, authorship — so an erroneous delete is recoverable: re-POST the same slug with that data, which also clears the 410 the delete leaves behind.

Renaming a row keeps its old URL working. The slug is editable, and the previous URL 301s to the new one, so a link the client already sent out still lands. Deleting a row leaves its URL answering 410 Gone rather than 404 — and re-adding the same slug brings it back to a 200.

Deleting the collection is refused while anything still uses it: a surviving row, a published page, partial or chrome section rendering it, or the detail template at <base>/:slug. The refusal names which; clear it, then delete. ?dryRun=1 tells you without writing anything.

Editing the schema is refused if it would drop a field rows still use. The refusal names the field and the number of rows; re-send with dropFields: ["blurb"] if losing it is what you meant. The collection's key is not editable: pages name it in markup.

Visibility is a window, and it is not the date you display. Each row can carry visibleFrom and visibleUntil:

WindowMeaning
neitheralways visible — the common case
visibleFrom onlyscheduled: appears then, never expires
visibleUntil onlyvisible now, stops rendering then
botha window

A row outside its window is never rendered — you cannot accidentally show a finished event. The row is not deleted, so the client can still fix its dates.

The window takes an instant; a displayed date field takes a bare date. On visibleFrom and visibleUntil a bare "2026-09-30" is rejected, because it has no timezone: send an ISO timestamp with an offset, or epoch milliseconds, in the site's timezone. A date field holds 2026-06-25; an ISO timestamp there stops it rendering as a date (below). The window is separate from the date a row shows: a resort that keeps events listed for a week afterwards sets visibleUntil a week later.

A date field is stored as 2026-06-25 and rendered as a date. You get:

<time class="mk-date" datetime="2026-06-25">
  <span class="mk-date__month">Jun</span><span class="mk-date__sep"> </span
  ><span class="mk-date__day">25</span><span class="mk-date__sep">, </span
  ><span class="mk-date__year">2026</span>
</time>

The parts come in the site locale's own order (en-CA "Jun 25, 2026", fr-CA "25 juin 2026"), so the JUN-over-25 chip on a resort card is CSS — .mk-date { display: grid } plus .mk-date__sep, .mk-date__year { display: none }. Every literal sits in its own .mk-date__sep so you can hide the punctuation; a bare text node would become an anonymous grid item you cannot select. Don't store a formatted string instead — it cannot sort, and it cannot expire. A range is two date fields, with the dash in your own markup. Text a client typed into a date field ("Every Friday") renders as itself.

So does a timestamp: "2026-06-25T19:00:00-06:00" is served as that literal string, with no <time> to style. The write is accepted with a collection.date_not_a_date warning naming the field. Put a time of day in its own time field.

A time field is stored as 19:00 and rendered the same way, as <time class="mk-time" datetime="19:00"> with a .mk-time__hour, .mk-time__minute and .mk-time__sep per part. The site locale picks the clock — en-CA reads "7:00 p.m." and adds a .mk-time__dayPeriod, de-DE reads "19:00" and has none, so style the dayPeriod as optional. Seconds are accepted and not displayed. A whole timestamp in a time field warns as collection.time_not_a_time and renders as itself, the same as the date case above; so does text a client typed ("Doors at 7").

You do not have to re-render. Adding, editing or removing a row regenerates the pages carrying that collection, and a sweep every half hour regenerates them again when a row crosses a visibility boundary — which is what makes an event disappear the day after it ends with nobody touching the site.

A page per row

Give the collection a detailBasePath and publish one page whose route is that base plus /:slug. The router binds the row the URL names, so that single page serves every row — 31 events are one page, not 31.

POST /v1/pages { "route": "/upcoming-events/:slug", "title": "{{row.title}} | Elk Ridge", … }
<article class="event">
  <h1><mk-component name="collection-detail" data-field="title"></mk-component></h1>
  <p class="event__when">
    <mk-component name="collection-detail" data-field="starts"></mk-component>
  </p>
  <mk-component name="collection-detail" data-field="blurb"></mk-component>
</article>

data-field emits that field's value and nothing else — no wrapper, no class — so the detail page is your markup, not ours. Drop data-field to emit every declared field as .mk-collection-detail__field--<field name> instead, which is quicker when CSS is doing all the work.

Put {{row.<field>}} in the page title and meta description. An untokenised title is replaced by a derived per-row one; substitution works in the title and description only, never in page HTML.

The share card is the row's own picture, automatically. The first image field holding a value becomes this page's og:image, outranking a fixed meta.ogImage on the template, which becomes the fallback. The ?w= cap is dropped.

The rest follows from the visibility window, with nothing to maintain:

The rowIts URL
visiblerenders, and is in sitemap.xml
expired (visibleUntil)410 Gone, and out of the sitemap
scheduled (visibleFrom)404 until the window opens

Cards in a grid link to these URLs automatically — but only once the /:slug page is published, so a card never points at a page that does not exist yet. One base path serves one collection; a second collection asking for the same one is refused.

Blog posts are not collections. A post is a page, listed with page-list (below).

Blog posts, news, case studies — the page-list component

A post is a page. To turn a page into a post, give it a publication date:

PATCH /v1/pages/pg_…   { "meta": { "publishedAt": "2026-08-16" } }

That one field is what puts the page in the list and in the feed, and it is what they sort by. Then put the component on your index page:

<mk-component name="page-list" data-under="/blog/"></mk-component>

It lists the site's own published pages under that path, newest first. Don't hand-write an index page instead: it goes stale the day the next post is published.

Pages under that path with no publishedAt never appear — a landing page, an archive stub, or an index that sits inside its own path. There is no second flag to unset.

AttributeDoes
data-underPath prefix to list, e.g. /blog/. Required.
data-limitPosts per page. Default 10, max 50.
data-ordernewest (default) or oldest.
data-headingElement for each title: h2 (default), h3, or none for a span.
data-url-filtersSet to page to turn on ?page=N.

Emitted markup — no styling, only hooks, like every other component:

<div class="mk-page-list" data-under="/blog/" data-mk-page="1" data-mk-total="23" data-mk-total-pages="3">
  <article class="mk-page-list__item">
    <a class="mk-page-list__link" href="/blog/spring-market">
      <img class="mk-page-list__image" src="/media/ast_…" alt="" loading="lazy" />
      <h2 class="mk-page-list__title">Spring market update</h2>
    </a>
    <time class="mk-date" datetime="2026-08-16">…</time>
    <p class="mk-page-list__summary">…</p>
  </article>
  <nav class="mk-page-list__pager" aria-label="Pagination">
    <a class="mk-page-list__next" rel="next" href="/blog?page=2">Next</a>
  </nav>
</div>

The card's title, summary and image come from the page's own title, meta.description and meta.ogImage — there is no second set of fields to keep in step. A post with noindex is left out. The date renders as the same <time class="mk-date"> with per-part spans a collection date field uses, so one rule styles dates everywhere.

Pagination. With data-url-filters="page", page 1 stays the cached static page and ?page=2 renders live and noindex — so pagination never forks your canonical URLs. The component emits its own rel="prev" / rel="next" anchors. Every post is in sitemap.xml regardless of which page of the index it lands on, so nothing depends on a crawler walking the pager.

The pager links to the index's own route, not to data-under. The two are usually the same path — an index at /blog listing /blog/ — but need not be: an index routed /our-office-listings that lists /office-listing/ gets /our-office-listings?page=2. data-under selects content and stays on the wrapper as a styling hook; it is never a link. A ?page= past the last page serves the last page (and says so in data-mk-page) rather than an empty list.

The feed comes free. As soon as one page has a publishedAt, the site serves /feed.xml and every page advertises it with a <link rel="alternate">. You do not author it and there is no switch — a site with no posts has no feed and no link, which is the honest state.

Article structured data is still yours to add, per post, via PATCH /v1/pages/:id { "meta": { "schema": … } }. The shell cannot infer an author or a headline that differs from the title.

Writing a post

When the owner asks for a new post, a case study or a portfolio piece:

  1. Ask for the topic, the key points and an image. Don't ask what the site already answers.
  2. Find the index: the published page carrying a page-list, and its data-under. The post goes under that path (/blog/<short-hyphenated-slug>), never at the root.
  3. Copy the markup of the newest post under that path, so the layout matches.
  4. Create the page with meta.publishedAt (today), meta.description and meta.ogImage. Those three make up its card on the index.
  5. Link to two or three of the site's service pages or posts where the text fits, and end with a related-posts page-list if the other posts have one.
  6. Send the owner the live URL.

A post written outside every index's path, or without a date, comes back with a post.outside_index, post.missing_published_at or post.not_listed warning naming the route it belongs at. A route never changes, so to move a post, create it at the right route and archive the old one with a redirect to it.

Agent roster, brokerage (Marquee) and team sites

The agent roster — agent-roster

A brokerage's own REALTORS®, server-rendered from the DDF feed. Use it for a "meet the team" page instead of one authored card per person: the feed carries only active members, so somebody joining or leaving changes the page with no write from you.

<mk-component name="agent-roster" data-sort="role"></mk-component>

There is no attribute that names an office or an agent: the roster is scoped from the site's own connector, like data-featured on listings. A site with listings has an officeKey, and the roster works from it with nothing to provision. Two cases need more, and Moseik sets both (rosterOfficeKeys, rosterMemberKeys):

If you believe you are in either case, say so rather than working around it. Compare data-mk-count against data-mk-total: it is the only thing that distinguishes a complete roster from a confident-looking fraction of one.

On a site with agent pages: data-source="roster"

When the site has a managed roster collection (a Showroom roster, or the DDF sync behind agent pages), data-source="roster" draws the same cards from it instead of the feed:

<mk-component name="agent-roster" data-source="roster" data-url-filters="page,q"></mk-component>

The grid then lists exactly the agents who have pages, across every office the roster covers, so a multi-office brokerage on Showroom needs no rosterOfficeKeys. Sorting, rotate, paging, search and profile links work as on the feed. An agent with no photo shows the platform's profile silhouette, not initials. The cards carry name, title, headshot, city, phone and website; never role, designations or languages. data-mk-agents reads roster, and unconfigured on a site with no managed roster. A card for an agent with no CREA id has no data-mk-member. Roster changes re-render the page on the next sync.

Read this before you promise a client a team page

WantedIn the feed?
Name, roleYes
PhoneUsually; per member, sometimes direct, sometimes the office
HeadshotPer member. Every member on some brokerages, fewer on others
Designations, languagesPer member, frequently absent
Email addressNo, for anyone
Bio, testimonials, listing countNo, for anyone

Everything but the last two rows varies by brokerage, so render their roster and look before writing copy about it. A site that needs bios, guaranteed headshots or per-agent email wants authored content: write the cards as HTML, or model the team as a [collection](#collections--lists-that-outlive-the-page). Both on one site is fine.

A card with no photo renders an initials element instead of an <img>, and a member who joins later may have none. Size the slot, not the image:

.mk-agents__list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  list-style: none;
  padding: 0;
}
/* Size the SLOT, not the image, so a card with initials matches one with a face. */
.mk-agent__media {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--mk-color-surface-2);
}
.mk-agent__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mk-agent__initials {
  font-size: 2rem;
  letter-spacing: 0.05em;
}
/* Most cards would otherwise print "Broker" twice — see below. */
.mk-agent:has(.mk-agent__title) .mk-agent__role {
  display: none;
}

JobTitle and role overlap — show one, hide the other

.mk-agent__title (the feed's free-text JobTitle) and .mk-agent__role (MemberType, a closed set) hold the same word on most cards, so "Broker" prints twice. JobTitle is sometimes richer (Broker of Record) or a team name. Lead with the title and hide the role behind it, as the :has() rule above does, so a member with no JobTitle still shows a role.

Ordering — data-sort

ValueOrder
name (default)Surname A→Z
roleBrokers and owners first, then salespeople, each alphabetical
feedWhatever order the feed returns, which is stable between renders
rotateSeeded, changes every 6 hours — see below

An unrecognised value is refused at write time. data-limit caps how many render, applied after the sort.

rotate — moving who is above the fold

rotate orders the roster by a seed that is a 6-hour UTC window (starting 00:00, 06:00, 12:00 and 18:00): two renders in one window produce identical HTML. Pages carrying it are re-rendered shortly after each window starts, so the order moves four times a day with no republish. It is a shuffle, not a strict turn.

Don't rotate the directory itself; a large roster is only findable A→Z. Use a limited rotating strip plus a full name-sorted roster on the same page:

<mk-component name="agent-roster" data-sort="rotate" data-limit="4"></mk-component>
<mk-component name="agent-roster" data-sort="name"></mk-component>
Paging and searching a large directory

data-url-filters="page,q" pages the roster and adds a name search. data-limit is the page size (24 without it). The search runs across the whole roster before paging, so never filter the rendered cards in JavaScript: on a paged directory that searches only the current page. Page 1 is the ordinary cached page; ?page= and ?q= URLs render per request and are noindex.

<form method="get" role="search">
  <label for="q">Find an agent</label>
  <input id="q" name="q" type="search" />
</form>
<mk-component name="agent-roster" data-sort="name" data-url-filters="page,q"></mk-component>

The component renders the pager as nav.mk-agents__pager with a.mk-agents__prev and a.mk-agents__next, and keeps q in both. The wrapper reports data-mk-page and data-mk-total-pages, plus data-mk-query and data-mk-matched during a search, so a script can refill the search box. A search that finds nobody renders data-mk-agents-empty="no-match"; write that copy in CSS or the page. page also pages a listings grid on the same page that opted into it, so keep the two on separate pages.

The platform reads the whole scope at render time (250 per call, up to 3,000 members) and sorts the complete set, because the feed cannot sort. A visitor's pageview touches no feed. Past 3,000 it stops and sets data-mk-capped.

Class hooks

HookWhat it is
.mk-agentsThe wrapper. Carries data-mk-agents, data-mk-count, data-mk-total
.mk-agents__listThe <ul>; each child is .mk-agent
.mk-agent__mediaPhoto slot: holds .mk-agent__photo or .mk-agent__initials, inside an a.mk-agent__photo-link when the name links. The <img> carries no width/height; size this
.mk-agent__nameDisplay name. Holds an a.mk-agent__profile to the agent's own page when the site's roster collection has one
.mk-agent__titleThe feed's JobTitle, free text. Usually restates __role
.mk-agent__roleSalesperson, Broker, … (a closed set)
.mk-agent__designations, .mk-agent__languagesComma-joined; frequently absent
.mk-agent__phone, .mk-agent__tollfreetel: links. __phone is the member's own MemberOfficePhone, often a direct line
.mk-agent__linkAn agent's own site or social profile, suffixed by type (.mk-agent__link--website)

Each .mk-agent carries data-mk-member, the DDF MemberKey: the same value a listing carries as ListAgentKey, and the key for data-agent-key on listings.

When something is wrong, the markup says so

AttributeMeaning
data-mk-agents="unconfigured"No DDF connector on this site, or no roster scope reachable from it. Turn MLS listings on with an officeKey (PUT /v1/listings/market); nothing in the page fixes it
data-mk-agents="unavailable"The feed read failed. Renders no list, rather than claiming the brokerage has no agents
data-mk-agents-emptyThe read succeeded and the brokerage has nobody on the feed. ="no-match" instead when a ?q= search found nobody
data-mk-mismatched="N"The configured office key is wrong: DDF matches keys by substring, so a truncated key admits other brokerages' agents. The platform drops them and counts them here
data-mk-total="N"What the feed says the scope holds. Always present. On a paged roster data-mk-count is this page only. Over-counts while data-mk-mismatched is present
data-mk-capped="1"The scope exceeded 3,000 members, so the roster is partial and its sort is wrong. Almost always a bad scope; say so rather than working around it

Setting up a brokerage's agent roster, start to finish

On a brokerage site every agent gets their own page, and a lead belongs to whoever brought the visitor. Four steps, in this order:

  1. GET /v1/roster. If it answers configured: false, ask the client for the Account ID and Secret under Showroom → Admin → Settings → Developer, and connect it with PUT /v1/roster-connector. The client confirms the brokerage name it reports; see the API reference. Then you have every agent, each with the creaId that is their routing key, plus the headshot, bio and contact details to build their page from.
  2. PUT /v1/site { leadRouting }. Do this BEFORE building pages. It is what populates the recipient pool — the response tells you how many recipients now exist, and you should see roughly the routable count from step 1, not the total. Use fallback: "inbox". Round-robin on a site whose pages do not carry the attribution field yet scatters every existing enquiry across the whole brokerage.
  3. PATCH /v1/collections/roster { "detailBasePath": "/agents" }. The roster is synced into a collection keyed roster, one row per active agent, slugged by their Showroom profile slug. Step 2 creates it if the 15-minute sweep has not yet. You set only its name and base path; its rows and schema refuse writes (collection.managed), because the next sync would undo them — an agent's details are changed in Showroom.
  4. Publish ONE template at /agents/:slug. It serves every agent, and picks up a Showroom edit within 15 minutes with no rebuild. An agent who leaves answers 410 Gone, and comes back at the same URL if they return. Screenshot it first — the screenshot binds a real agent.
<h1><mk-component name="collection-detail" data-field="displayName"></mk-component></h1>
<mk-component name="collection-detail" data-field="headshot"></mk-component>
<mk-component name="collection-detail" data-field="phoneLink"></mk-component>
<mk-component name="collection-detail" data-field="bio"></mk-component>
<mk-component name="listings" data-agent-key-field="creaId"></mk-component>
<mk-component name="form" data-form-id="agent-contact" data-fields='[
  {"name":"name","label":"Name","type":"text","required":true},
  {"name":"email","label":"Email","type":"email","required":true},
  {"name":"attributedAgent","label":"Agent","type":"hidden","fill":"row","rowField":"creaId"}]'>
</mk-component>

The fields are displayName firstName lastName title headshot primaryCity phone phoneLink email emailLink bio websiteUrl evrylistReferralUrl specialties awards languages designations communitiesServed marketTypes soloOrTeam creaId, plus three recognition slots: recognition1 (the label), recognition1Description and recognition1Image (the badge), then the same for 2 and 3, in Showroom's order. Most agents have none, so hide an empty slot with :empty. specialties through marketTypes are list fields (see below), which is how a directory filters agents; a DDF-fed roster fills only languages and designations. headshot is never empty: an agent with no usable photo gets the platform silhouette, /__mk/headshot.svg. phoneLink/emailLink render as tel:/mailto: links labelled with the number and address. An empty field renders nothing, but the element around it stays, so style it with :empty. Never write a claim about an agent that is not a field. Hide creaId and bio in a directory grid with CSS (.mk-collection__field--creaId), and give bio white-space: pre-line to keep its paragraphs. Headshots load from our Cloudflare Images account or CREA's CDN, and get none of the automatic sizing uploaded media gets, so size them in CSS.

data-agent-key-field and "fill": "row" take the key from the agent the URL names, so no page carries a typed-in key that goes stale. Once the template is published, each agent-roster card whose agent has a row links its name to that page; republish the directory page once to pick up the links. Agents with routable: false still get a page; their leads fall back to the inbox. List them for the owner — it is a content gap in Showroom, not something to work around.

Which agent a visit belongs to

The visit belongs to the agent whose page it reached first, on every form. Viewing an /agents/:slug page claims the rest of the visit for that agent: any later form whose leadRouting field arrives empty is routed to them, on any page, with no hidden field and no script. An agent page's own form still names its own agent through "fill": "row". A later agent's page does not take the visit over. Keep a form out of it with data-session-agent="false" — careers, recruiting and join forms are the brokerage's, not the agent's. For page script, the readable cookie mk_agent holds the agent page's path (URL-encoded), e.g. to point the logo at it or hide the brokerage's agent directory.

Marquee sites: one agent per browser tab

A Marquee (brokerage) site uses a different rule and a platform script. PUT /v1/site { "marquee": true } makes a session one browser tab. A tab whose first page is an agent page is that agent's until it closes, even on a form that names another agent, so each ad click (a new tab) goes to the agent it advertised. Any other tab belongs to the agent page it viewed last. The site re-renders with /__mk/marquee.js, which keeps that per tab, routes each form by the tab that sent it, and draws the tab's agent into hooks the site's own markup carries:

HookWhat marquee.js does
data-mk-agent-chipUnhides it
data-mk-agent-nameSets the agent's name
data-mk-agent-photo<img>: sets src; other elements: background image, else initials
data-mk-agent-home, a[data-mk-home]Points it at the agent's page
data-mk-agent-contact"Call <first name>" to their phone, else "Contact" to #contact on their page; give the attribute another anchor as its value, e.g. data-mk-agent-contact="#agent-contact"
data-mk-agent-exitEnds the agent view; removed in a locked session
data-mk-brokerage-tel on a tel: linkSwaps that brokerage line for the agent's phone too
data-mk-agent-directoryIn a locked session, leads to the agent's page instead

Contact details. marquee.js swaps the brokerage's phone and email, read from the site's contact record, for the agent's wherever they appear. With no contact record nothing is swapped, so set it first. Another brokerage line, such as a second office or property management, is swapped only when its tel: link carries data-mk-brokerage-tel. A tel:/mailto: link written from an empty field gets the brokerage's phone or email instead (so in an agent's tab, the agent's), and is hidden only when the site has no contact record.

Forms kept from agents. A form with data-session-agent="false" (on a form or contact-form) or listed in noAgentForms never goes to an agent. noAgentForms names a form key, which every contact-form shares, so use the attribute to keep one contact form, such as a careers page's, from agents.

A locked tab. Another agent's page redirects to the locked agent, and an agent-roster shows only them. Only elements carrying data-mk-agent-directory are redirected, so give a directory link in a page body the attribute too.

CSS and script. <html> carries mk-agent-session, plus mk-agent-locked when locked. The site's own script reads the tab's agent from window.mk.agent ({ key, page, name, title, tel, email, photo, locked }, or null); photo may be a site-relative path. marquee.js runs before the site's script, so it is set when that script starts. Read it rather than the mk_agent cookie, which every tab shares. The mk:agent-exit event fires when a visitor ends the view. Don't write your own session island alongside it.

Team sites without a roster

On a team (Ensemble) site with no Showroom, the agents' pages are hand-built, and PUT /v1/site { team } names who is who:

PUT /v1/site
{
  "team": [
    { "key": "jane", "name": "Jane Doe", "title": "REALTOR®", "phone": "403-555-1111",
      "email": "jane@team.ca", "photo": "/media/ast_…", "page": "/our-team/jane" }
  ]
}

Each member with an email becomes a lead recipient, keyed by key; one without keeps a page but gets no leads. If the site has no leadRouting, writing the list sets { field: "attributedAgent", fallback: "inbox" }. The site re-renders with /__mk/ensemble.js: the same tab rule, hooks, contact swap and window.mk.agent as marquee.js above, with a member's page found by its page path rather than a roster. In a locked tab, links to another member's page lead to this one, and an element with data-mk-member="<key>" (a hand-built team card) is removed unless it is the tab's member. team: null clears the list, and its members stop receiving leads at once.

A site takes its members from one source: Showroom, the DDF member roster, or a team list. Each refuses while another is set (409), and marquee and team refuse each other.

Moving a site that has its own session script, and proving routing

Check the contact record is set, then remove that code from the site script and point what remains at window.mk.agent, rename its hooks to the table's, then turn marquee on last. Each of those writes re-renders every page, and the site serves a mix of old and new pages for a few minutes, so test once it settles.

Then prove it rather than assuming it, from a page OTHER than the agent's own: POST /v1/forms/<a consumer form>/test { "sessionAgent": "<creaId>" } answers with assignee: { key, reason }. reason: "attributed" means the chain works end to end; GET /v1/leads carries the same assignee. "rotation" or no assignee means the key did not match, usually a display name or slug where the creaId belongs. The test sends a hidden field with its declared value or empty, as a visit does before a script fills it. It takes one sessionAgent, so it cannot rehearse per-tab routing; check that in a browser. verify_page renders with no agent in session, so it audits only the brokerage's view.

Normal, not faults: leadRecipients is fewer than the roster (only agents with an email address can receive a lead), and most agents have no bio yet (the page still publishes). An agent missing from the roster collection has no usable profile slug in Showroom, or shares one with another agent.

A brokerage without Showroom can have the same collection filled from its DDF roster scope; staff switch it on per site. Steps 3 and 4 are unchanged. Slugs come from the agent's name (jane-doe, or jane-doe-<creaId> when two agents share one) and stay put when a name changes. The feed carries no email or bio, so email, emailLink and bio are always empty and every lead goes to the inbox — skip steps 1 and 2.

Local area data — neighborhood & community pages

Real per-boundary data for the place a page is about: who lives there, what housing costs, what is on the market. Read it before writing a community page, and render it with the three area components below.

Finding an area and reading its profile

Three endpoints, all GET and all content:read. Over MCP they are find_areas, get_area_profile and rank_areas.

EndpointAnswers
/v1/areas?name=&lat=&lng=which boundaries match this place
/v1/areas/:idpopulation, income, tenure, lifestyles, active market for one area
/v1/areas/rank?lat=&lng=the areas around a point, ordered by how attractive they are to farm

Resolve the place first. Boundary ids are opaque and not guessable from a name. /v1/areas returns candidates in alphabetical order, not relevance order, and a bare name matches across countries, so pass lat/lng.

Read coverage before you read the numbers

The vendor answers 200 with zeros for data it does not have. Each profile carries a coverage block and a notes array saying which it is.

For a Canadian market: boundaries, demographics (Statistics Canada 2021) and active listings are present; sold data and schools are not. A sold count of 0 in Canada means the vendor does not cover it, not that nothing sold.

Coverage also varies by city inside one province: Regina has neighborhood boundaries, Saskatoon has none. An empty layer is a reason to retry without it.

Ranking is an ordering, not a recommendation

/v1/areas/rank scores each area 1-100 relative to the others in that same result. 100 means "the best of these", never "a good neighborhood", and two calls around different points cannot be compared. Show a human the raw metrics and the plain-English method each response carries, not just the rank. Areas with no active listings come back in skipped with a reason; a scored area never scores 0.

Naming the area — two ways, never both

All three area components (neighborhood-stats, community-map, market-trends) pick their area the same way:

AttributeUse onMeans
data-boundary-id="6333…"a community pagethis exact area
data-boundary="listing"a listing detail pagethe area containing this listing

On a listing detail page you must use data-boundary="listing". A literal id would print one neighborhood's figures on every property. The platform resolves the area the listing's coordinates sit inside (containment, not the nearest area).

Writing both attributes renders ambiguous-binding rather than a guess.

Each block renders the area's own name and echoes it in data-mk-area, so a wrong id shows a wrong name. Check it against the page you meant.

A page carrying neighborhood-stats or market-trends is re-rendered once a day, so its figures stay current with no republish. If the provider cannot be read then, the live page is kept.

Neighborhood stats — the neighborhood-stats component

Census figures for the area, rendered on the server so crawlers see them.

<mk-component
  name="neighborhood-stats"
  data-boundary-id="63334852ee00b80009d9442c"
  data-heading="Cathedral by the numbers"
></mk-component>
AttributeDefaultWhat it does
data-boundary-id—required; the area
data-fieldssix common statspick and order stats from the closed set below
data-lifestyles0add the top N lifestyle categories, max 6
data-headingnonerenders an <h2> inside the block

Fields: population, medianAge, households, averageHouseholdSize, medianIncome, medianHomeValue, medianRent, ownerOccupiedShare, activeListings, medianListPrice, medianDaysOnSite. A name outside that set is ignored.

A figure the provider does not have is omitted, never printed as zero, and named in data-mk-missing. Money renders in the area's currency, and in none when the country is unknown.

Style via .mk-area, .mk-area__stats / __stat / __label / __value / __lifestyles / __source. The block is a <dl>, so dt/dd are your hooks too.

AttributeOnWhat it carries
data-mk-areathe sectionthe area's own name — check this against the page you meant
data-mk-layerthe sectionneighborhood, city, postal-code, …
data-mk-missingthe sectionstats dropped because the provider had no figure; absent when none
data-mk-stateach statthe field name, so you can style or hide one
data-mk-percentileeach lifestylethe percentile as a number, for drawing your own bar
data-mk-area-statsthe markerwhy nothing rendered — see below

Nothing renders when the lookup fails. The marker carries data-mk-area-stats="unavailable", "unconfigured" (the deployment has no provider key) or "no-boundary" (you left the attribute off).

The source line carries the census vintage and is a display obligation: restyle it, do not remove it.

Community map — the community-map component

The area's boundary drawn on a map, as a same-origin image (/__data/areas/<id>/map.png), so it needs no CSP change and no key reaches the browser. It is a picture, not a pannable map; use map or listings-map for interactive work.

<mk-component name="community-map" data-boundary="listing" data-width="640" data-height="400"></mk-component>

data-width / data-height (defaults 640×400) are real img attributes, so the space is reserved. data-alt overrides the alt text, which otherwise names the area. Hooks: data-mk-area, data-mk-layer on the figure; data-mk-area-map on the marker when nothing renders. Style .mk-areamap / .mk-areamap__img.

Monthly closings, median sale price and days on market.

<mk-component name="market-trends" data-boundary-id="…" data-months="12" data-chart="sparkline"></mk-component>

Check the page before you promise this section to a client. A trend comes only from sold data, and sold coverage is board by board: some large Canadian markets have none, and others have a small fraction of their real volume. The component compares sold volume against standing inventory and renders data-mk-trend="not-covered" instead of drawing a misleading chart.

data-months is the window (3–36, default 12). data-metric is price (default) or volume. data-chart="sparkline" adds an inline SVG line; the figures stay in an <ol> either way. data-heading adds an <h2>.

Hooks: data-mk-metric and data-mk-closings-total on the section, data-mk-period and data-mk-closings on each point. Style .mk-trend, .mk-trend__points / __point / __period / __value / __spark.

A community's market stats — listing-stats

Averages over the active for-sale listings in one place, rendered on the server and refreshed daily: average, lowest and highest price, total listings, average days on market, average price per sq ft, and the property-type mix.

<mk-component name="listing-stats" data-neighbourhood="Arbor Creek" data-chart="donut"></mk-component>

Scope it with the grid's own attributes — data-neighbourhood, data-city, data-property-type, data-property-category — and the site's market applies last. Put it beside a grid with the same filters and the two describe the same listings.

A named neighbourhood or city is matched exactly, so use the feed's own spelling from GET /__data/listings/facets?fields=CityRegion. A misspelling renders empty.

data-chart="donut" draws the type mix as inline SVG arcs in currentColor at falling opacity; recolour a slice with .mk-listing-stats__slice[data-mk-slice="0"] { stroke: … }. The counts are always in the <ol> too. Prices print compact ($985K, $2.1M), or in full with data-price-format="full"; <data value> holds each exact number.

AttributeMeaning
data-mk-listing-statsok, empty or unconfigured (no listing provider)
data-mk-statOn each row: average-price, lowest-price, highest-price, total-listings, average-days-on-market, average-price-per-sqft
data-mk-countListings matched
data-mk-neighbourhoodThe data-neighbourhood the block was scoped to
data-mk-sampledMore matched than were read: prices describe the newest, and days on market is omitted
data-mk-sample-sizeOn one stat, when it rests on fewer rows than the count — price per sq ft usually does

Built-in interactive patterns (no JS to write)

For the common cases you don't need to write any JS — author markup with a hook class and the platform's behavior runtime (auto-loaded first-party when a hook is present) wires it up. Style the states yourself.

HookMarkupBehavior
.mk-carousel.mk-carousel__slide children + [data-mk-prev]/[data-mk-next] buttons, and [data-mk-goto="n"] to jump straight to a slide; optional data-mk-autoplay="5000"shows one slide at a time; see _Carousels_ below
.mk-trackany horizontally scrolling container of items + [data-mk-prev]/[data-mk-next]; put [data-mk-track-viewport] on the scroller when the arrows sit outside itseveral items side by side, stepped by the arrows; see _A track in full_ below
.mk-tabs[data-mk-tab="01"] triggers + [data-mk-panel="01"] panelsclick a trigger → shows its panel; active trigger gets .is-active
.mk-revealany elementships with .is-in-view; the runtime removes it below the fold and re-adds it on scroll — see the note below
.mk-gallery<img> childrenclicking an image opens a .mk-lightbox overlay you can browse — see below
.mk-nava [data-mk-menu] trigger next to a submenuclick toggles aria-expanded + .is-open on the trigger's parent (dropdown / mega-menu); closes on outside click
<div class="mk-tabs">
  <button data-mk-tab="01" class="is-active">Design</button>
  <button data-mk-tab="02">Build</button>
  <section data-mk-panel="01">…</section>
  <section data-mk-panel="02" hidden>…</section>
</div>

Carousels. .mk-carousel shows one slide at a time; prev/next controls and the Left/Right arrow keys navigate.

A track in full. Use .mk-track when several items sit side by side and the visitor scrolls through them. The runtime steps by one item width on the arrows, disables them at the ends, and re-measures when lazy images load; your CSS does everything visual, including the snapping. Swipe is native scrolling, and nothing is hidden with JS off:

<div class="mk-track">
  <button data-mk-prev>‹</button>
  <div class="tiles" data-mk-track-viewport>
    <article>…</article>
    <article>…</article>
    <article>…</article>
    <article>…</article>
  </div>
  <button data-mk-next>›</button>
</div>
.tiles {
  overflow-x: auto; /* the scroller — this is what makes it a track */
  scroll-snap-type: x mandatory; /* optional: snap points */
  display: flex;
  gap: 1rem;
}
.tiles > * {
  scroll-snap-align: start;
  flex: 0 0 240px;
}
.mk-track[data-mk-fits] button {
  visibility: hidden; /* everything already fits — the arrows have nothing to do */
}

Never pair scroll-snap-type with scroll-behavior: smooth on a scroller. It can snap on load as an animated scroll, which stops Chrome recording Largest Contentful Paint, so PageSpeed reports NO_LCP and no Performance score. Pass { behavior: "smooth" } to scrollTo/scrollBy from script instead. verify reports it as performance → snap_smooth_scroll.

Omit [data-mk-track-viewport] and the root itself is the scroller, so the arrows travel with the content. A counter reads data-mk-index / data-mk-count (1-based, and the index reaches the count at the far end however short the travel).

data-mk-fits means "nothing to scroll" (overflow of at most a pixel), not "not worth scrolling". data-mk-overflow holds the scrollable pixels (0 when it fits), so a custom threshold is two lines in your island:

document.querySelectorAll(".mk-track").forEach((t) => {
  // Your bar, not ours: below 80px of travel, this design hides its arrows.
  t.classList.toggle("is-barely-scrollable", +t.dataset.mkOverflow < 80);
});

A thumbnail rail can drive a carousel and scroll itself at the same time. Put the rail inside the carousel root, give it class="mk-track", and its own [data-mk-prev]/[data-mk-next] scroll the rail while the [data-mk-goto] thumbs inside it still select slides:

<div class="mk-carousel">
  <div class="mk-carousel__slide">…</div>
  <div class="mk-track">
    <button data-mk-prev></button>
    <div data-mk-track-viewport>
      <button data-mk-goto="1"><img src="/media/…" alt="Lakeview cabin" /></button>
    </div>
    <button data-mk-next></button>
  </div>
</div>

A control belongs to the nearest root that answers to it. [data-mk-prev] / [data-mk-next] mean something to both, so the innermost of the two wins — which is why the rail's arrows above scroll only the rail. [data-mk-goto] means nothing to a track, so a track in between does not intercept it and the thumb still reaches its carousel. Nest two carousels and an arrow key presses the inner one only.

For anything beyond these, write a per-site island (above).

Scroll-reveal is default-visible, and you must keep it that way. Write both halves of the pair — hide the base class, reveal it on .is-in-view:

.mk-reveal {
  opacity: 0;
  transition: opacity 0.4s;
}
.mk-reveal.is-in-view {
  opacity: 1;
} /* ← never omit this */

The platform renders your .mk-reveal elements with .is-in-view already applied, and the runtime strips it off whatever is below the fold before watching for scroll. So the animation works exactly as you'd expect, and a visitor whose JavaScript never runs — blocked, failed request, an error earlier in your island — still sees the content.

What the platform cannot rescue is a missing second rule. If you hide .mk-reveal and never write an .is-in-view rule, there is no visible state to fall back to and the content is invisible for everyone, always. The gate warns about this (render.reveal_never_visible), and GET /v1/pages/:id/verify will show you the rendered result.

Hover-opening nav (mega-menus). .mk-nav opens on click. Hover-open on desktop is presentation, so write it: pair :hover with the .is-open class the hook toggles, scoped to pointer devices:

@media (hover: hover) and (min-width: 900px) {
  .mk-nav > li:hover > .nav__sub {
    opacity: 1;
    visibility: visible;
  }
}
.mk-nav > li.is-open > .nav__sub {
  opacity: 1;
  visibility: visible;
}

Keep the .is-open rule outside the media query — that is the one keyboard users and touch devices rely on.

Markup you create after page load needs window.mk.bind(), or a carousel, tab set or reveal your island builds has no behaviour, silently:

container.innerHTML = html; // e.g. the `html` from /__data/listings
window.mk.bind(container); // ← wires any hooks inside it

It is safe to call repeatedly. .mk-gallery is the exception: its lightbox is delegated from the document, so an injected gallery works with no bind() call.

The lightbox, in detail

Clicking any <img> inside a .mk-gallery opens the overlay on that photo and lets a visitor browse the rest of the same gallery — two galleries on one page never page into each other. An image may sit inside a link to its full-size file: the lightbox opens instead of the link, and a Ctrl- or Cmd-click still opens the file in a new tab. You get, with no JS of your own:

ElementWhat it is
.mk-lightboxthe overlay (role="dialog", aria-modal, aria-label naming the current photo)
.mk-lightbox__imagethe full-size image
.mk-lightbox__closeclose (×)
.mk-lightbox__prev / .mk-lightbox__nextprevious / next — only when the gallery has more than one image
.mk-lightbox__count3 / 12, aria-live="polite" — also only for multi-image galleries
.mk-lightbox__captionthe shown photo's alt text, visible; hides itself when the alt is empty

Also handled: ←/→ to move, Esc or a background click to close, focus into the dialog on open and back to the photo on close, and html.mk-lightbox-open while it's open so the page behind doesn't scroll.

It works before you style it. The base layer ships the structural overlay (fixed, dimmed, image centred, controls placed) and nothing aesthetic. Every rule is a single class, so your stylesheet re-skins any of it. The caption is the photo's alt text, so write real alt text. On listing photos, leave object-fit: contain alone: the lightbox is where the uncropped frame, watermark included, is shown.

Want a thumbnail strip, or a main stage with prev/next on the page itself? Build it — that's presentation, and it's yours. If you build your own overlay, call classList.remove("mk-gallery") on the wrapper first so the platform handler stops matching and one click doesn't open two lightboxes.

Interactivity — per-site JavaScript (islands)

Yes, you can add JavaScript. Interactive behavior — tabbed/click selectors, carousels, scroll-triggered reveals, accordions, sticky headers, counters — is fully supported through per-site JS. Reach for it whenever the source has interactivity; you do not have to render those sections static.

PUT  /v1/script   { "js": "…vanilla JS…" }
GET  /v1/script                          → current js + version
POST /v1/script/revert { "toVersionId": "ver_…" }

Your JS is versioned, size-budgeted (≤ 512 KB), bundled, and served first-party at /__mk/site.js; every page loads it (deferred) while a script is published. It runs under the strict CSP — it can manipulate the DOM freely but cannot load a third-party script or reach an origin the site has not allowed, so write self-contained vanilla JS. The pattern is progressive enhancement: author normal markup with class hooks, then activate it from the island.

If something is blocked, we already know. Every page reports CSP violations back to the platform, so a refused script or fetch is visible to us rather than only to the visitor's console. So you do not need to report "this was blocked" — and you should not work around a block you do not understand. Check GET /v1/site → csp.effective first: it is often the difference between "the platform forbids this" and "this site has not enabled it".

// a tabbed selector (like a "solutions" switcher): markup has
// <div class="tabs"><button data-tab="01">…</button>…<section data-panel="01">…
document.querySelectorAll(".tabs").forEach((tabs) => {
  const show = (id) => {
    tabs.querySelectorAll("[data-panel]").forEach((p) => (p.hidden = p.dataset.panel !== id));
    tabs.querySelectorAll("[data-tab]").forEach((b) => b.classList.toggle("is-active", b.dataset.tab === id));
  };
  tabs.querySelectorAll("[data-tab]").forEach((b) => b.addEventListener("click", () => show(b.dataset.tab)));
});

// scroll-triggered reveal / scale
const io = new IntersectionObserver((es) =>
  es.forEach((e) => e.target.classList.toggle("in-view", e.isIntersecting)));
document.querySelectorAll(".reveal").forEach((el) => io.observe(el));

Style the states (.is-active, .in-view, [hidden]) in your stylesheet. The screenshot endpoint captures the settled state after the island runs; drive interactions in your own testing.

Calculators & configurators — form controls + an island

For any configurator, author real form controls (input, select, output, …) and compute in the browser from the island. The controls are inert on their own — no oninput=, no submit — so read them and write the result from your JS:

<!-- payload html -->
<div class="calc">
  <label>Length <input type="number" id="len" value="12" min="1"></label>
  <label>Width <input type="number" id="wid" value="10" min="1"></label>
  <output id="area">—</output>
</div>
// island
const calc = document.querySelector(".calc");
if (calc) {
  const $ = (id) => calc.querySelector("#" + id);
  const update = () => {
    $("area").textContent = (+$("len").value * +$("wid").value).toFixed(1) + " sq ft";
  };
  calc.addEventListener("input", update);
  update();
}

Everything runs client-side; nothing is submitted. Anything that submits, whether to the leads pipeline or another system, is a form component (see _Forms_).

Mortgage & land-transfer tax — do NOT hand-roll these

Canadian mortgage arithmetic differs from the US formulas most calculators copy, and each mistake produces a plausible number:

Wrong (common)Correct
CompoundingannualRate / 12 — US monthlySemi-annual: (1 + r/2)^(2/n) − 1
CMHC premium base% of the purchase price% of the loan amount
CMHC premiumadded to a "total" lineadded to principal and amortized

Land-transfer tax has its own traps (municipal brackets, capped rebates, the non-resident tax). So the platform does the math. Add data-mk-finance to any element on the page and you get two functions:

<!-- payload html — `data-mk-finance` is the whole opt-in -->
<section class="mortgage" data-mk-finance>
  <label>Price <input type="number" id="price" value="749000" step="1000"></label>
  <label>Down payment <input type="number" id="down" value="74900" step="1000"></label>
  <label>Rate % <input type="number" id="rate" value="4.49" step="0.01"></label>
  <label>Amortization
    <select id="years"><option>25</option><option>30</option></select>
  </label>
  <output id="payment">—</output>
  <p class="mortgage__meta"></p>
</section>
// island
const el = document.querySelector(".mortgage");
if (el) {
  const $ = (id) => el.querySelector("#" + id);
  const update = () => {
    const r = window.mk.mortgage({
      price: +$("price").value,
      downPayment: +$("down").value,
      annualRate: +$("rate").value, // PERCENT — 4.49, not 0.0449
      amortizationYears: +$("years").value,
      province: "ON",
    });
    if (!r.ok) {
      $("payment").textContent = "—";
      el.querySelector(".mortgage__meta").textContent = r.errors[0];
      return;
    }
    $("payment").textContent = "$" + r.payment.toFixed(2) + "/mo";
    el.querySelector(".mortgage__meta").textContent =
      `CMHC premium $${r.cmhcPremium.toFixed(2)} (financed) · rates as of ${r.ratesEffective}`;
  };
  el.addEventListener("input", update);
  update();
}

Payment frequency, and the two amortization numbers

paymentFrequency accepts exactly: monthly (the default), semi-monthly, bi-weekly, weekly, accelerated-bi-weekly, accelerated-weekly.

An accelerated schedule pays the mortgage off early, so the result carries two amortizations:

fieldmeans
effectiveAmortizationYearshow long it actually takes — 21.69 where you asked for 25
amortizationYearsthe same number as above (kept for existing callers)
scheduledAmortizationYearsthe amortization you asked for, echoed back — always 25 here

Render effectiveAmortizationYears for "pays off about 3 years sooner". totalInterest agrees with it, not with scheduledAmortizationYears.

The rate is yours. annualRate is an argument and the platform has no rate table. If the mortgage partner publishes a feed, put it behind a [connector](#live-data--the-__data-proxy); otherwise a partial keeps it in one editable place. Name the lender and the date next to any rate you display.

Read ok first. On ok: false there is no payment field. errors[] says what's wrong, and minimumDownPayment comes back even on failure. notes[] carries things worth surfacing, such as provincial sales tax on the CMHC premium being payable at closing.

window.mk.landTransferTax({ price, province: "ON", municipality: "toronto", firstTimeBuyer, foreignBuyer }) returns total plus each component (provincial, municipal, provincialRebate, municipalRebate, nrst). Ontario only: another province is refused rather than approximated.

Print ratesEffective, the date of the tables behind every result. These are estimates, not advice; put your own disclaimer next to the output.

Modals — use <dialog>, do not build one out of a <div>

<dialog> is allowed, and it is the only correct way to write a modal. Opening it with showModal() gives you, from the browser and for free:

A <div role="dialog" aria-modal="true"> gives you none of that. Write the markup in the payload; open and close it from the island.

<!-- payload html -->
<button type="button" data-open-tour>Book a tour</button>
<dialog id="tour">
  <h2>Book a tour</h2>
  <mk-component name="form" data-form="tour" data-fields="…"></mk-component>
  <button type="button" data-close-tour>Close</button>
</dialog>
// island
const tour = document.getElementById("tour");
document.querySelector("[data-open-tour]")?.addEventListener("click", () => tour.showModal());
tour?.querySelector("[data-close-tour]")?.addEventListener("click", () => tour.close());
/* page css or the site stylesheet */
#tour::backdrop {
  background: rgb(0 0 0 / 60%);
}

Only the open attribute is allowed on it. Writing <dialog open> gives you the non-modal dialog — visible, but with no focus trap and no backdrop — so if you want the modal behaviour, leave it closed in the markup and call showModal(). A dialog with no open attribute is hidden before your island runs, which is what you want: nothing flashes on screen during load.

Other server-rendered components and data endpoints

Google reviews — the google-reviews component

Reviews are fetched on the server and rendered into the page, so crawlers see them and they can be styled like the rest of the site. Don't use a review widget.

<mk-component name="google-reviews"></mk-component>

The place is named, never pasted. Site config holds the Place IDs under names:

{ "places": { "default": "ChIJ…", "dartmouth": "ChIJ…" } }

so a page writes data-place="dartmouth", or nothing at all for default. GET /v1/site → reviews.places lists the names you may use.

Don't ask the client for a Place ID; what they find is usually a CID or a 0x…:0x… pair that looks right and isn't. Search with the business name and town:

GET  /v1/reviews/places?q=Proof Digital Saskatoon   → candidates with address, rating, Maps link
POST /v1/reviews/place { "placeId": "ChIJ…" }        → 202, held for the site owner

(MCP: find_google_place, propose_google_place.) Confirm the right candidate with the person you work for first: a franchise name plus a city is not unique. The owner then confirms it in the dashboard under Settings → Site details; GET /v1/site → reviews.pending shows it until they do. A google-reviews block is refused (component.feature_off) until a place is confirmed, and so is a data-place name the site does not have. A site with several locations still needs Moseik to add the extra names.

Google returns at most five reviews and cannot page, so "all our reviews" is not available. The rating and count are Google's across every review.

AttributeEffect
data-placewhich configured place (default: default)
data-limithow many reviews to render, 1–5 (default 5)
data-min-ratinghide reviews below N stars — the write gate warns, see below

Hooks: .mk-reviews, .mk-reviews__rating, .mk-reviews__count, .mk-reviews__list, .mk-reviews__attribution, and per review .mk-review__photo, __author, __stars, __time, __text. Each .mk-review carries data-mk-rating, so draw your own stars from it. The block carries data-mk-place, the place name it resolved (never the ID).

The reviewer's name and the attribution line are display obligations. Restyle them freely; do not hide them.

On data-min-rating. The gate warns every time it is used: the rating and count beside the list are unfiltered, so a five-star-only list under a 4.2 average misleads, and Google's terms speak to misrepresenting review content. The block publishes data-mk-filtered with the number it hid.

Nothing renders when the lookup fails, rather than an empty block. Style .mk-reviews--unavailable for a placeholder; it carries data-mk-reviews="unavailable" (or "unconfigured" when no place is set up).

Linking to the client's Google page

Never paste a Place ID, a CID or a maps.google.com link into markup for a "see all our reviews" button. Instead:

GET /v1/site → reviews.mapsUrls reports the same URL per place name, once a page has rendered that place.

Address autocomplete and geocoding

Two same-origin endpoints, so no Google key reaches the browser:

GET /__data/places/autocomplete?q=100+Main&session=<uuid>
    → { "suggestions": [ { "placeId": "ChIJ…", "text": "100 Main St, Halifax, NS" } ] }

GET /__data/places/geocode?placeId=ChIJ…&session=<uuid>     ← prefer this
GET /__data/places/geocode?q=100+Main+St+Halifax
    → { "results": [ { "token": "v1.…", "lat": 44.65, "lng": -63.57,
                       "address": "…", "placeId": "ChIJ…" } ] }

Off by default. Until Moseik opts the site in, both routes 404. GET /v1/site → addressLookup.enabled tells you (addressLookup also carries usage, and a reason when it is off). Ask your human if you need it.

token is the field you came for. It is a signed statement that the platform geocoded this address, and the only way to bind an address to [seller-comparables](#a-what-is-my-home-worth-seller-page--seller-comparables).

results: [] from geocode means "we could not place that address": tell the visitor to check what they typed. A 502 means the lookup failed; retry. Every response carries X-Mk-Places-Path naming the resolver that answered (details, geocode, text-search). Nothing is cached.

Realtor name search ("find your name")

For a form where a realtor at any brokerage in Canada picks themselves, such as a sign-up. Same-origin, on any site with a listing feed:

GET /__data/members?q=sandra+kers[&limit=10][&province=Alberta]
    → { "members": [ { "memberKey": "2062694", "name": "Sandra Jane Kersteman",
                       "officeKey": "279033", "officeName": "CENTURY 21 BRAVO REALTY",
                       "province": "Alberta" } ],
        "hasMore": false }

This is not agent-roster, which lists one brokerage's own agents.

Live data — the /__data/ proxy

To render data from an external source (e.g. a Google Sheet), fetch the platform's same-origin data proxy from your island. It calls the source server-side, so credentials stay on the server, and returns raw JSON; you own the markup.

GET /__data/sheet?sheetId=<id>&tabName=<tab>   → the source's JSON rows
// author an empty container in the page, fill it from the island
fetch("/__data/sheet?sheetId=" + el.dataset.sheetId + "&tabName=Pricing")
  .then((r) => r.json())
  .then((data) => renderHoweverYouWant(el, data))   // your markup + styling
  .catch(() => showFallback(el));                    // source down → graceful fallback

The response is short-cached and noindex, so this content is client-rendered and not indexed. sheetId/tabName are supplied by the page; the source URL and key are configured on the platform.

Freshness — check it, don't assume it

If the source is unreachable, the proxy still answers 200 with the last data it fetched successfully. Every response says which it is:

HeaderMeaning
X-Data-Stale: 0Live — fetched from the source just now.
X-Data-Stale: 1The source was unreachable; this is the last-known-good copy.
X-Data-Age-SecondsStale responses only — how old the copy is.
X-Data-Fetched-AtStale responses only — ISO timestamp of the last good fetch.

A 502 means the source is unreachable _and_ there is no cached copy yet.

Surface staleness in the UI. A caption that asserts freshness ("Current pricing") must be conditional on X-Data-Stale: 0:

fetch("/__data/sheet?sheetId=" + el.dataset.sheetId + "&tabName=Pricing")
  .then(async (r) => {
    if (!r.ok) throw new Error("no data available");
    return { rows: await r.json(), stale: r.headers.get("X-Data-Stale") === "1" };
  })
  .then(({ rows, stale }) => {
    renderHoweverYouWant(el, rows);
    // Say so — don't let old data pass as current.
    if (stale) el.querySelector(".caption").textContent = "Prices may be out of date";
  })
  .catch(() => showFallback(el)); // and label the fallback as unverified too

Other backends — /__data/<connector>

Any other name after /__data/ resolves to a per-site connector: a REST backend the platform fetches server-side and passes back as raw JSON. The backend URL and any key live in the connector config, never in page source:

GET /__data/inventory?sort=newest&page_size=12   → the backend's JSON
GET /__data/inventory/by-slug/<slug>             → a single record (if allowed)
fetch("/__data/inventory?sort=newest&page_size=12")
  .then((r) => r.json())
  .then((data) => renderCards(el, data)) // your markup + styling
  .catch(() => showFallback(el));

A backend may paginate. Field names are the backend's; if it returns a row count, compare it with the rows before treating one response as the whole set. Request a size that covers the collection, or give a real <a rel="next" href="?page=2"> that works with JS off. verify reports connectorPaging when a response declared more rows than it carried and the page has no link onward.

Connectors get the same last-known-good fallback and X-Data-Stale headers as sheet. A subpath the backend answers 404 (a sold or removed record) comes back as a plain 404, never a stale copy; show a "no longer available" state. Subpaths and forwarded query params are whitelisted per connector. A new backend is a config change by the platform team; ask for it.

Calling an external origin directly — the allowlist

When a page must talk to an external origin directly from the browser (most often an upload endpoint on another host), propose it for the site's allowlist (POST /v1/allowlist; see the API reference). Once a human approves it, the origin is added to the CSP directives the entry names: by default connect-src and form-action, so your island can fetch()/POST to it and a form component's data-action can submit to it. A vendor's script or stylesheet is a separate directive that only the site owner can approve. Prefer the /__data/ proxy whenever you are just reading data.

Partials — fragments reused across pages

A partial is a named HTML fragment referenced from many pages and inlined at render. Edit it once; every referencing page updates.

PUT  /v1/partials/cta   { "html": "<section class=\"cta\">…</section>" }
<!-- in any page payload -->
<mk-partial ref="cta"></mk-partial>

Partials publish → the site re-renders. A reference to a missing/unpublished partial is rejected at the gate; there is no partial-in-partial nesting in v1; unpublishing a partial that a published page still references is blocked (DELETE /v1/partials/:ref → 409).

Chrome is the markup that appears on every page. Each of header, footer, announcement is a single per-tenant fragment; the renderer stitches them around each page (announcement + header above the body, footer below), and publishing one re-renders the whole site.

GET  /v1/chrome                              → { header, footer, announcement }
PUT  /v1/chrome/header  { "html": "…", "css"?: "…" }
POST /v1/chrome/header/revert { "toVersionId": "ver_…" }

Chrome can use everything a page can — components, partials, interactive hooks (a .mk-nav dropdown belongs here), and its own CSS (which applies site-wide). Build the header and footer first on a new site.

Which reuse mechanism?

The platform attribution badge

Every served page ends with a small "Created on Moseik" badge — a one-line, centered link rendered by the platform after your footer, outside every surface you author. It is part of the page shell, like the <head>: you will never see it in a payload, you don't add it, and you can't remove or restyle it. Design your footer as if the badge weren't there, and it will look right.

It carries its own colour pair — your theme's --color-text on --color-background — rather than inheriting from body, so it blends in on a site whose page background is its theme background and stays legible on one that paints body something else. To make it disappear into a section whose background differs from your theme's, set the theme tokens to match.

Its identifier (mk-attribution) is reserved: any authored HTML, CSS, or JS containing that string is refused at the write gate with sanitize.reserved_attribution (or the same code from PUT /v1/script). A rule targeting it, a counterfeit copy, or a script that removes it all fail at write time.

The badge comes off on Grid and above, or wherever staff switch it off — either one is enough, and neither is yours to set. GET /v1/site → attribution reports whether this site carries it and which of the two took it off (planIncludes / staffOverride). Read that before answering a client who asks: the answer is a plan change or a staff request, never a write, and the reserved token refuses the write regardless.

Theme — design tokens

The theme is the site's colors, fonts, type scale, spacing, radius, and gradients. A change is validated, versioned and published at once, restyling every page.

GET  /v1/theme                → current tokens + themeVersionId
PUT  /v1/theme  { …tokens }    → published
POST /v1/theme/publish { "themeVersionId": "thv_…" }   → put an earlier version back

Tokens are validated for schema (e.g. font.scale in 1.067–1.5, hex colors, fonts from the vendored family list) and WCAG contrast on required text/background pairs before anything changes. Fonts are self-hosted by the platform.

That contrast check covers the theme's own pairs, such as text on background and primaryContrast on primary. Page CSS and the site stylesheet may set any colour, and that is intended: a dark band, a brand gradient or an accent outside the theme belongs there, not in a token bent to pass. Those colours are checked when you run GET /v1/pages/:id/verify, which measures the rendered page, gradients included. Run it after any styling that puts text on a colour the theme doesn't define.

font.heading and font.body pick the main faces; the optional font.mono slot names a monospace family and exposes it as var(--font-mono) for labels, numbers, code, and "data terminal" styling.

Fonts

`` POST /v1/fonts (multipart: file=<woff2>, family, weight?, style?) GET /v1/fonts → list { id, family, weight, style, url } DELETE /v1/fonts/:id ``

The platform hosts it first-party (served at /fonts/<id> under font-src 'self') and injects an @font-face into every page, so font-family: "Your Font" in your stylesheet/page CSS resolves. Each upload declares one weight and style (default 400 normal), so upload each one you need (e.g. 400 + 700). Only woff2 is accepted, and it's your responsibility to hold a license for the font you upload.

An uploaded family is preloaded on any page that paints it, matched by family name. A face you declare yourself under another name, such as a weight range for a variable upload, is never preloaded.

Web fonts without layout shift. Keep font-display: swap and give the face a size-adjusted local fallback. Don't size text containers in ch on a page that uses a web font: ch is the "0" of whichever font is painting, so the box resizes when the font arrives and headings re-wrap. Use em or px computed from the web font's own "0" width (if it is 0.473em at your weight, 13ch becomes 6.15em). The gate warns with font.ch_width_shift. The preload helps layout shift but delays first paint; font-display: optional avoids the shift only by never showing the font on a first visit, which a warm-cache screenshot won't reveal. Lighthouse 13 counts layout shift in both Performance and Agentic Browsing.

Images, icons & embeds

Photos / bitmap images — <img> via imported media. Import first (off-site src is rejected), then reference the first-party URL. The one exception is our own Cloudflare Images account (see "What HTML you can write"); such an image gets no automatic width/height or srcset, so write them yourself.

POST /v1/media/import  { "url": "https://…/photo.jpg", "alt": "…" }
<img src="/media/ast_…" alt="Storefront at dusk" width="1200" height="800">

Every image is resized and re-encoded on serve, whether or not you ask. A /media/<id> request comes back capped at 1920px wide and in AVIF or WebP if the browser advertised either — so a 2400px JPEG upload is not a 2400px JPEG download. You do not have to do anything to get this, including in CSS.

?w=<px> overrides the width when you know better than the default:

/* a hero: the default 1920 cap is already right, nothing to add */
.hero {
  background-image: url(/media/ast_…);
}
/* a small avatar: ask for what you'll actually display */
.avatar {
  background-image: url(/media/ast_…?w=320);
}

Widths snap to 320 / 640 / 960 / 1280 / 1920 / 2560, and nothing is ever upscaled — a ?w= above the intrinsic width returns the intrinsic width. Use it for anything displayed much smaller than full-bleed; the default has no way to know your CSS box, so it errs large.

What you can upload:

ClassAcceptedSize limit
imagePNG, JPEG, WebP, AVIF, GIF, SVG25 MB
documentPDF, DOCX25 MB
videoMP4, WebM50 MB

Acceptance is decided by the file's actual contents, not its extension — a .png that is really something else is rejected, and renaming it changes nothing. SVG must additionally pass the SVG sanitizer, so a refused SVG means _that file_, not the format.

A PDF opens in the browser's viewer and a DOCX downloads. A link to a PDF (<a href="/media/<id>">) opens in a new tab unless you set target yourself.

If an upload is rejected, that file did not qualify; uploads still work. Pick a different file or format and retry. The owner can replace an image on a page from the dashboard, but the same file would be refused there too.

What the renderer injects into your <img> tags

The served HTML will not match what you authored. Every <img> whose src is a first-party /media/<id>, with or without a ?w= of your own, gets:

AddedValueWhy
width / heightthe asset's real intrinsic sizereserves layout space, so the image can't shift the page (CLS)
srcset?w= rungs, capped at the intrinsic widthlets the browser pick a size per viewport — better than the serve-time default, which has to assume desktop
sizes100vwconservative default — override it if you know the CSS box
loadinglazy — on everything below the LCP imagekeeps the long tail off the critical path
decodingasync on those same imageskeeps a large decode off the main thread
fetchpriorityhigh, on the LCP image onlythe hero should not wait its turn

Worth knowing:

``css .team-card > img { width: 100%; } /* correct — height follows the ratio */ ``

This rule has zero specificity, so anything you write beats it. A fixed height, a height: 100%, or the absolutely-filled wrapper pattern all still win:

``css .photo { position: relative; aspect-ratio: 3 / 2; overflow: hidden; } .photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } ``

The one case where it changes what you'd otherwise get: an <img> whose own width/height attributes disagree with the file's real proportions is no longer stretched to fit them — it scales from the width. Injected dimensions always match the file, so this only reaches attributes you wrote by hand. Want the stretch? Say height in CSS.

object-fit: cover hides a wrong image box from the eye, so check image geometry by comparing declared aspect-ratio with the rendered ratio; GET /v1/pages/:id/verify does this on the live render.

A foreign-origin <img> (a hotlinked listing photo) can't be measured or resized, so it gets only the loading/decoding treatment.

Consequence for screenshots and measurement: because most images are lazy, a tool that captures the page without scrolling will photograph empty space where those images are. If you are measuring your own layout, width/height are present from the first paint, so geometry is reliable even before pixels land.

Video, icons and embeds

Self-hosted video — <video> via imported media. For clips you host yourself (short hero background loops, product demos), upload or import the file first, then point a plain <video> at the first-party URL. Off-site src on <video>/<source>/poster is rejected — the file must live on /media/…, exactly like images.

POST /v1/media          (multipart: file, alt)         — direct upload
POST /v1/media/import   { "url": "https://…/loop.mp4", "alt": "…" }

Accepted formats: mp4 and webm (sniffed by content, not extension; an iPhone .mov counts as mp4), up to 50 MB per file. Upload what you were sent. An mp4 of 60 seconds or less is converted to a smaller H.264 copy (at most 1280px on its long side) that /media/<id> serves in its place, usually within a minute; longer videos and webm are served as uploaded. The route streams with HTTP range support, so seeking works. There is no custom player — the browser's native <video> is used, so controls gives you the default player chrome.

A <video> playing a /media/ file gets poster="/media/<id>?poster", a frame one second in, unless you set your own poster.

<!-- A normal, user-controllable video -->
<video src="/media/ast_…" controls preload="metadata"
       width="1280" height="720" style="max-width:100%"></video>
<!-- Muted autoplay background loop for a hero. muted + playsinline are REQUIRED
     for autoplay to start on mobile. -->
<section style="position:relative;isolation:isolate">
  <video autoplay muted loop playsinline preload="metadata"
         style="position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1">
    <source src="/media/ast_…" type="video/webm">
    <source src="/media/ast_…" type="video/mp4">
  </video>
  <div style="padding:6rem 2rem;color:#fff">
    <h1>Headline over the video</h1>
  </div>
</section>

Allowed <video> attributes: src, poster, width, height, controls, autoplay, loop, muted, playsinline, preload. Use self-hosting for short, brand-owned loops; for anything long-form prefer a YouTube/Vimeo <iframe> (next) — it sidesteps the 50 MB cap and gives you an adaptive player.

Icons / logos / simple vectors — inline <svg>. Write the SVG directly in your HTML; a safe subset is allowed (path, circle, rect, line, polygon, g, defs, gradients, <use>, text + presentation attributes). Use inline SVG for crisp, CSS-styleable icons (fill="currentColor" inherits your text color); use <img> for photos or complex artwork. <foreignObject>, <script>, and external refs inside SVG are rejected.

<svg viewBox="0 0 24 24" width="24" height="24" fill="none"
     stroke="currentColor" stroke-width="2" aria-hidden="true">
  <path d="M4 12l6 6L20 6"/>
</svg>

Maps / long-form video / third-party widgets — <iframe> embeds. Write a normal iframe with an https:// (or first-party) src. This is the right path for YouTube/Vimeo and any video too big for the 50 MB self-host cap. Wrap it in a responsive container yourself; the frame runs sandboxed to its own origin.

<div style="position:relative;aspect-ratio:16/9">
  <iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID"
          title="Intro" allow="fullscreen" allowfullscreen loading="lazy"
          style="position:absolute;inset:0;width:100%;height:100%;border:0"></iframe>
</div>

Google Maps — the map component

Use the component. It renders an interactive, fully branded Google map: styled map features, custom pin icons, multiple pins, and custom info windows.

<mk-component
  name="map"
  data-zoom="6"
  data-title="Our depots"
  data-pins='[
    {"lat":51.05,"lng":-114.07,"title":"Calgary","icon":"/media/ast_…",
     "html":"<h3>Calgary</h3><p>24h dispatch</p>"},
    {"lat":52.13,"lng":-106.67,"title":"Saskatoon"}
  ]'
  data-style='[{"featureType":"water","stylers":[{"color":"#2F7D86"}]}]'
></mk-component>
.mk-map {
  position: relative;
  aspect-ratio: 16 / 9;
}
.mk-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
attributemeaning
data-pinsJSON array of pins — see the pin fields below.
data-styleA Google styles array, verbatim — the same JSON you'd pass to the JS API.
data-lat/data-lngMap centre. Optional — defaults to the first pin.
data-zoomOptional, default 12. With two or more pins the map fits them all instead.
data-titleAccessible name for the frame.

Pin fields:

fieldmeaning
lat / lngRequired. A pin without both is dropped.
titleAccessible label, and the info-window heading when there's no html.
htmlInfo-window content. Sanitized like page HTML.
iconFirst-party /media/<id> pin artwork.
iconWidth / iconHeightRendered pin size in px, 4–256. Send both or neither.
anchorX / anchorYWhere the art touches the coordinate, px from its top-left. Both or neither.

Things that will save you time:

``json { "lat": 51.05, "lng": -114.07, "icon": "/media/ast_…", "iconWidth": 34, "iconHeight": 48 } ``

anchorX / anchorY are rarely needed: the default anchor is the bottom-centre of the image, which is already right for a teardrop. Set them for art that points somewhere else — a centred dot wants the anchor in the middle.

The map is served as a signed, cross-origin document the component embeds, so you cannot load the Maps script yourself. Don't recolour a map with CSS filter: it also alters Google's logo and attribution, which the Maps terms require unaltered. Use data-style.

Structured data (JSON-LD)

Read this before auditing a site's schema — a good deal of it already ships.

Every page the platform serves already carries, generated from validated site data:

@typeFrom
WebSitethe site name and primary hostname
Organization, or LocalBusiness when contact data existssiteConfig.contact — name, telephone, email, full PostalAddress, openingHours, legalName, foundingDate, areaServed, sameAs, founder/employee
BreadcrumbListthe route, on nested pages

So a failing LocalBusiness audit is a site-config problem, not a markup problem. Fix it with PUT /v1/site contact data and it corrects on every page at once; never add a second LocalBusiness block by hand.

A listing detail route additionally emits RealEstateListing, automatically. Built from the feed data already loaded for the page — address, coordinates, beds/baths, floor size and price, plus the MLS number, the REALTOR.ca link and the listing brokerage on an MLS row. A builder's lot has none of those three, so they are omitted. You do not author it and you should not add your own.

It mirrors only what the page displays, with the same omissions as the card: no price on a listing priced at 0, no bedroom count on land that reports none.

Adding the types the platform cannot infer

FAQPage, Service, Article, Product and friends are page-specific, so you supply them:

PATCH /v1/pages/:id
{ "meta": { "schema": { "@type": "FAQPage", "mainEntity": [ … ] } } }

You cannot write a <script type="application/ld+json"> block yourself; the sanitizer rejects every script element. meta.schema produces the same block in the head.

Files the platform serves for you

These files exist on every site, generated from your pages. None of them is authorable: a page is served as text/html, so a route named /llms.txt would answer with an HTML document. Do not create pages for them.

URLWhat it isBuilt from
/robots.txtcrawl rules + the sitemap pointerfixed, plus your primary hostname
/sitemap.xmlevery indexable URLpublished pages, listing detail URLs, visible collection rows — sharded past 50k
/feed.xmlRSSpages with meta.publishedAt; 404s until at least one exists
/llms.txtthe site described for an AI agentthe site name, the home page's meta.description, and your published page and post titles + descriptions
/<key>.txtthe site's IndexNow keyfixed per site; every publish on a live client domain pings IndexNow (Bing, Copilot, ChatGPT search)

/llms.txt

What an agent reads to find its way around the site, and what PageSpeed Insights audits under Agentic Browsing. Generated per request from page data you control:

You shape the rest with PUT /v1/site { "llms": … } (MCP put_site). It replaces the whole block; null clears it; GET /v1/site → llms reads it back.

{
  "llms": {
    "summary": "Replaces the home page meta.description as the summary line.",
    "policies": ["/privacy", "/legal/terms"],
    "rules": ["Showings are booked by phone only."],
    "sections": [
      {
        "title": "Resources",
        "links": [{ "title": "Buyer guide", "url": "/guides/buying", "description": "…" }]
      }
    ]
  }
}

policies replaces the route convention above ([] turns the section off). A named route with no published page is left out, and the write response lists it in llmsUnlisted. rules are appended after the fixed ones, which cannot be removed. A section url is https:// or a path on this site, and its title may not reuse one of the platform's headings.

On a *.moseik.app preview host belonging to a site that has its own domain, and on a site created as a copy, /llms.txt answers 404, as robots.txt disallows those hosts.

Root text files

analytics.txt, ads.txt and app-ads.txt are the files whose text you supply: Google Analytics' recovery file for a property with no admin left, and the ad-seller lists.

PUT /v1/site { "rootFiles": { "analytics.txt": "<Google's exact wording>" } }

Each is served as text/plain at /<name> on every hostname of the site, within five minutes. Files you don't name are kept; a name set to null is removed; "rootFiles": null removes them all. Up to 64 KB each. Any other name is a 422 site.bad_root_files. GET /v1/site → rootFiles reads them back.

Search engine verification

To prove ownership to Google Search Console or Bing Webmaster Tools, use the meta-tag method and send only the tag's content value:

PUT /v1/site { "searchVerification": { "google": "<token>", "bing": "<token>" } }

The platform puts <meta name="google-site-verification"> and <meta name="msvalidate.01"> in the head of every page on every hostname, and re-renders the site. It replaces the whole object; null clears both. A malformed token is a 422 site.bad_search_verification. GET /v1/site → searchVerification reads it back. Don't create a /google<token>.html page: it would be served as a page, not the file Google expects.

Translated pages

PUT /v1/site { "languages": ["fr"] }

Every published page then gets a machine-translated copy at /<code><route> (/fr/about; the home page is /fr), made after each render of the source page. A copy carries lang, its own canonical, hreflang alternates for every language, and links that stay in its language; the source page gets the same alternates, and the sitemap lists every copy. Until a copy is written its address redirects to the source page.

The model reads each page in order, so a menu label is translated as a label ("For Rent" → "À louer"). French is Canadian French.

Left in English: listing cards, the REALTOR.ca attribution, <code>/<pre>, REALTOR® and MLS®, the site's name, agent names from the roster (agent-roster cards and the managed roster collection's names and towns), and anything you mark translate="no" or class="notranslate". Short text you mark stays in English everywhere else on that page too, inside sentences included. Write the page in English; edit the English and the copies follow.

Place names and brands can be read as ordinary words ("Cottage Club" became "Club de chalets"), so before turning a language on, list the site's towns, brand and team names once:

PUT /v1/site { "untranslated": ["Okotoks", "Olds", "Calgary", "Century 21 Bravo"] }

Each is matched as a whole word, case-sensitively, and kept as written in every copy. A whole-list replace, at most 300 terms of up to 100 characters (site.bad_untranslated otherwise). Changing it re-makes every copy. GET /v1/site → untranslated reads it back.

To fix a wrong translation, compare the copy with its English page and give your own, keyed by the English text of one text node (an element's text, without its child tags):

PUT /v1/site { "translations": { "fr": { "No Matter What.": "Peu importe." } } }

Yours wins over the model on every page carrying that text. A whole-object replace, so send every correction each time; at most 500 per language (site.bad_translations otherwise). Changing it re-makes every copy. GET /v1/site → translations reads it back.

Codes: fr es pt it de nl pl uk ru zh ko ja vi tl hi pa gu, at most 5. Refusals (422): site.bad_languages for an unsupported code, site.languages_route_taken when a page already lives at /fr/…, site.plan_not_included on a tier without it. Removing a language deletes its copies. GET /v1/site → languages reads it back.

Place the switcher once, in the header chrome:

<mk-component name="language-switcher"></mk-component>

It renders <nav class="mk-language-switcher"> with one plain link per language, each labelled in its own language, and aria-current="true" on the one being shown. It is unstyled and renders nothing on a site with no languages.

Checking your work

See your work — screenshots

GET /v1/pages/:id/screenshot            → PNG of the published page
GET /v1/pages/:id/screenshot?version=ver_…&w=1200   → PNG of a specific draft

The platform renders the page in a real browser and returns an image, so you can run the pixels-first loop (edit → screenshot → compare) with no local browser. See Cloning a site.

GET /v1/pages/:id/verify (MCP verify_page) renders the page and audits it on demand; it never runs on publish. It reports computed contrast and core accessibility (alt text, accessible names, labelled controls, heading order), performance findings (such as snap_smooth_scroll), images whose rendered ratio disagrees with their box, and connectorPaging. The response shape is in the API reference.

Capturing a page honestly — ?nolazy=1 and ?nomotion=1

Two query parameters, handled at the serve layer, so they work on every page of every site with nothing to author — including a site you did not build:

ParameterEffect
?nolazy=1every <img> and <iframe> loads immediately, whatever the markup says
?nomotion=1every scroll-reveal section is held revealed (the runtime is told not to un-reveal any) and all motion suppressed
https://client.example.com/our-facility?nolazy=1&nomotion=1

The flags are inert when absent, a flagged response is no-store + noindex, and the cached page is untouched. The response echoes X-Mk-Capture-Flags: nolazy,nomotion, so "the flag did nothing" is distinguishable from "the section really is empty".

?nomotion=1 also stamps data-mk-nomotion on <html>: carousels do not autoplay and the track steps without smooth scrolling. If your island animates anything, read that attribute and skip the animation too.

If you only need one page at one width, GET /v1/pages/:id/screenshot already does all of this and reports what it achieved in X-Mk-* headers. Use the flags when you drive a real browser yourself. For every image to paint there, scroll, then capture with fullPage and captureBeyondViewport: false.

Judge position: fixed overlays at viewport size, not in a full-page capture. An open .mk-lightbox, the consent banner and a sticky header render misplaced or absent in a fullPage capture, intermittently and depending on document height, even with captureBeyondViewport: false. Use a viewport capture (fullPage: false, or ?fullPage=false on the screenshot endpoint) or compare pixels.

Checking a fallback state — ?mkstate=

Components publish states you cannot otherwise reach: the roster's unavailable needs the feed to fail, .mk-agent__initials needs a member with no headshot. ?mkstate= renders them, at the serve layer, on any page of any site:

https://client.example.com/directory?mkstate=agents:unavailable
https://client.example.com/directory?mkstate=agents:nophoto
ValueRenders
agents:unconfiguredthe roster's empty wrapper, as on a site with no office key
agents:unavailablethe empty wrapper for a FAILED read — deliberately no list at all
agents:emptythe ordinary wrapper with data-mk-count="0" and the empty paragraph
agents:nophotoevery card as if the member had no photo, so .mk-agent__initials renders
listings:errordata-mk-error on a .mk-listings-filters form, as on a feed outage

Comma-separate to combine: ?mkstate=agents:nophoto,listings:error. Each value reproduces what the renderer really emits. Check unavailable and empty separately: they look similar and mean opposite things.

The response is no-store + noindex and the stored page is untouched. An applied value is echoed in X-Mk-State; an unrecognised one is named in X-Mk-State-Ignored.

The safety gate

Every write runs: sanitize (hard — the envelope in _What HTML you can write_) → placeholder resolution (hard — components/partials must exist) → budgets (hard) → compliance (fair-housing scan on real-estate copy: a match refuses the write and names the rule). The served page additionally carries a strict CSP.

Every change that passes publishes; nothing waits for Moseik staff. Anything worth fixing comes back as warnings on the response. A contact-detail change (phone, email, address) also emails the site owner a one-click undo.

Undoing changes, and backups

Every write is a version, so most mistakes are a revert away:

The site script has no preview. PUT /v1/script publishes to every page at once, and a page preview runs the live script too. Change one thing per write, check the live site straight away, and keep the previous publishedVersionId from GET /v1/script so POST /v1/script/revert can put it back. dryRun validates without publishing, but it doesn't run the code.

A worked example

POST /v1/lease
PUT  /v1/stylesheet { "css": ".hero{padding:4rem 2rem;background:var(--color-primary);color:var(--color-primary-contrast);text-align:center}.mk-form__submit{background:var(--color-primary);color:#fff;border:0;padding:.6rem 1.2rem;border-radius:var(--radius-button)}" }
POST /v1/pages {
  "route": "/",
  "title": "Acme Realty",
  "payload": {
    "html": "<header class=\"hero\"><h1>Acme Realty</h1><p>Homes in the west end.</p></header><main><section><h2>Get in touch</h2><mk-component name=\"contact-form\" data-phone=\"true\"></mk-component></section></main>"
  }
}
POST /v1/pages/:id/publish
GET  /v1/pages/:id/screenshot   → eyeball it

Work in small, validated steps. If a write is rejected, the reason code (and the version's validation report) names exactly what to fix.