Provisioning: spin up a site with a staff key

Only for agents holding Moseik's provisioning key (ONBOARD_KEY). If nobody gave you that key, this page is not for you: start at Getting started, which sets up a site for your human with no key at all.

This is the bootstrap path for an agent that creates a new site on Moseik and builds it out, with no human in the loop. If you were handed an _existing_ site to edit, skip to the API reference and authoring guide.

What you need

Everything else — a per-site credential, a short-lived token — you obtain in the steps below.

Two levels of auth

LevelSecretWhat it can doWhat it cannot do
ProvisioningONBOARD_KEYCreate or copy a site and get its credential; set its scopes and publish policy.Edit any site's content, or reach any other admin route.
Tenanta short-lived tokenBuild one site — every content edit.Reach any _other_ site. The token is bound to a single tenant server-side.

The split is enforced server-side.

The flow

1. Spin up a site — POST /admin/onboard

Authenticated with your provisioning key. The site starts on the 180-day free trial and goes offline when it ends, unless its owner buys a plan or Moseik staff grant one.

POST /admin/onboard
Authorization: Bearer <ONBOARD_KEY>
Content-Type: application/json

{
  "name": "Acme Realty",
  "vertical": "realestate",          // generic | realestate | automotive | hotel
  "domain": "acme.example.com",      // optional; the preview host is live either way
  "mintCredential": true,            // default true — returns a credential to build with

  // Optional. Invites this person to the client dashboard for this site, with full
  // access, in this same call. Omit it and nobody can sign in to the site.
  "client": { "email": "owner@acme.example", "name": "Dana Owner" },

  // REQUIRED for the realestate vertical only — the market this site serves.
  // `province` is the only required field. `officeKey`/`agentKey` are optional and
  // name the site's OWN brokerage/agent, so pages can show featured listings.
  "listings": { "province": "Saskatchewan", "officeKey": "264739", "agentKey": "1520210" }
}

On realestate, listings is mandatory — without it the request is refused (422 onboard.listings_required). Only province is required: it determines how much of a ~227k-row national feed each query touches, so it cannot be guessed.

Do not sidestep it by choosing another vertical. realestate also switches on the fair-housing compliance gate.

client — who can sign in afterwards

Supplying it emails an invitation to the client dashboard in the same call. The 201 carries client: { invited, emailed, link }; emailed: false is not a failure — the invitation exists and link is the way in, so pass it on rather than re-inviting. Omit client and the response says client: null: the site is real and nobody can reach its dashboard until someone is invited.

Don't ask a human for the keys — look them up

GET /admin/listings/lookup?agent=<person's name> turns a name into the whole listings block. Do this instead of asking: people routinely don't know their DDF key and often give the board-scoped MlsId, which is not globally unique.

curl -sS -H "Authorization: Bearer $ONBOARD_KEY" \
  --get --data-urlencode "agent=Karen McGuffin" \
  "https://api.moseik.app/admin/listings/lookup"

Encode the value. Names contain spaces, and a brokerage like RE/MAX must arrive as RE%2FMAX. A raw space or slash gets you a malformed request or a silent miss.

{
  "searched": "McGuffin",
  "candidates": [
    {
      "name": "KAREN DANA MCGUFFIN",
      "agentKey": "1520210",
      "officeKey": "277619",
      "brokerageName": "CENTURY 21 MILLENNIUM INC.",
      "province": "Ontario",
      "suggestedListings": { "province": "Ontario", "officeKey": "277619", "agentKey": "1520210" }
    }
  ],
  "truncated": false
}

Pass the chosen candidate's suggestedListings straight through as listings. Use ?brokerage=<name> when the site belongs to a brokerage rather than an individual — though an agent search usually beats it, returning the province, the agent's key and their brokerage's key in one call.

These are candidates. Have your human confirm which one, and never take the first hit. Matching is fuzzy ("mcguffin" also returns "McGaffin") and a surname repeats inside one brokerage.

Reading the other answers:

Once listings are on, tell the client to select Benchmetrics as their technology provider on CREA's DDF dashboard. The feed works until then, but CREA can shut it off. Seeing their listings on the site does not mean it is done: their brokerage may have put them on the national feed, which does not cover this site. Their dashboard Home stops on this step until they confirm it or choose to do it later. The full guide is moseik.ca/ddf-setup.

Correcting the scope afterwards

PATCH /admin/sites/<tenantId>/listings, same provisioning key:

curl -sS -X PATCH -H "Authorization: Bearer $ONBOARD_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city": null, "officeKey": "56148"}' \
  "https://api.moseik.app/admin/sites/ten_…/listings"

Send only the fields you're changing. null clears an optional one — that is how you widen a market back to the whole province, since omitting a key already means "leave alone". province cannot be cleared. The response returns the new scope in the shape GET /v1/site reports it, and queues a re-render.

A brokerage with several branches sets "officeKeys": ["54563", "243289", …] (up to 25): data-featured="office" and data-agent-key then cover every branch. It replaces officeKey for those two; look each branch up with ?brokerage=.

Think hardest about city. It floors the market and a page cannot widen past it, so a brokerage serving a whole region must not be scoped to the one town its office sits in — area pages for neighbouring towns would render the scoped town's listings under the neighbouring town's heading, looking entirely correct doing it.

Google reviews, if the client wants them

Same key. Find the Place ID — never ask for it; it appears on no dashboard and not in the URL of the business's own Maps listing:

curl -sS -H "Authorization: Bearer $ONBOARD_KEY" \
  --get --data-urlencode "q=Acme Realty Saskatoon" \
  "https://api.moseik.app/admin/places/lookup"

Have your human confirm the candidate — open its mapsUrl and check the address. A franchise name plus a city is not unique, and a wrong pick publishes another business's reviews under their name on this client's site. Then save it:

curl -sS -X PATCH -H "Authorization: Bearer $ONBOARD_KEY" \
  -H "Content-Type: application/json" \
  -d '{"places": {"default": "ChIJ…"}}' \
  "https://api.moseik.app/admin/sites/ten_…/reviews"

Add more named places for a multi-location client; a page then selects one with data-place="<name>". {"places": null} turns reviews off without losing the ids.

The response (201)

{
  "tenantId": "ten_…",
  "previewUrl": "https://eager-beaver.moseik.app/",   // random words; resolves, 404s until step 4
  "pages": [],                                            // a fresh site has no pages
  "nextStep": "This site has no content yet, so previewUrl answers 404 until you build it. …",
  "credential": { "clientId": "cred_…", "clientSecret": "…" },  // if mintCredential
  "docs": "https://…/docs/provisioning"
}

Onboarding provisions the site shell — tenant, theme, the preview hostname, and (unless mintCredential:false) an agent credential. A fresh site has zero pages and no header or footer, so previewUrl answers the branded 404 until you publish in step 4. The returned credential is scoped to this one site — keep it, it's how you build.

A first build is a first write: no If-Match and no X-Mk-Overwriting-Writer, on the page or the chrome. (starter is retired and answers 422.)

Starting from an existing site instead

If a site like the one you want already exists on the platform, copy it with POST /admin/sites/<sourceTenantId>/duplicate ([below](#duplicating-an-existing-site)) rather than rebuilding it, and step 4 becomes "change what differs". The staff dashboard has a Duplicate site button that does the same.

2. Get a token — POST /v1/auth/token

POST /v1/auth/token
{ "clientId": "cred_…", "clientSecret": "…" }        → { "token": "…" }

Tokens are short-lived — re-exchange when one expires. Send it as Authorization: Bearer <token> on every /v1 call.

3. Take the writer lease — POST /v1/lease

Only one writer may edit a site at a time. Acquire the lease before editing; renew it during a long session with POST /v1/lease/renew.

4. Build

Read GET /v1/site before you plan the page list, not after. It reports which capabilities this site actually has, and several of them are things a client will never think to ask for — so waiting to be asked means never building them. Each enabled capability's detail says what to build with it.

On a real-estate site that usually means listings, an agent roster, a seller lead page, and community pages — the last built from real per-neighbourhood census and market data (neighborhood-stats, community-map), with the same blocks bound to each property on the listing detail template. Nobody asks for those by name; they ask for "a page about the area" and get four adjectives unless you offer better.

Every write goes through the safety gate (sanitize → placeholders → budgets → compliance), is versioned and reversible, and publishes, with warnings when something needs fixing. See edit classes.

Reference

Endpoints on this key

Looking up ids

The scope routes are not create-time-only: a site already built can gain featured keys or reviews with one request, so never tell a client an id "has to come from platform staff".

Whatever a human hands you is usually the wrong id in the right shape: for DDF, the board-scoped OfficeMlsId rather than the globally unique officeKey (OfficeMlsId 72 is three unrelated brokerages in three provinces); for Google, a CID or the 0x…:0x… pair out of a Maps URL, neither of which is a Place ID.

PATCH …/reviews replaces places, and the ids are not readable back. It takes an object of name → placeId; GET /v1/site → reviews.places is an array of names only. So a call carrying just a new place drops the others, and their pages then render nothing — send every place you want configured, every time. reviews.mapsUrls gives the resolved Google URL per name, which is what a build script should compare a link against.

Duplicating an existing site

POST /admin/sites/:sourceTenantId/duplicate — stand up a new site as a copy of an existing one, instead of rebuilding it. Same provisioning key as /admin/onboard.

POST /admin/sites/ten_…/duplicate
  { "name": "Jordan Ellis Realty", "vertical"?: "…", "notifyEmail"?: "…",
    "includeConnectors"?: false, "asTemplate"?: false, "mintCredential"?: true }
→ 201 { tenantId, previewUrl, sourceTenantId, copied, notCopied, warnings, credential }

Two things it's for: instantiating a template (build one good site per vertical, duplicate it per client) and taking a safe copy of a live site so it can be reworked with no possibility of touching the original.

What comes across: every page, chrome singleton, partial, the stylesheet and the site script; the theme; media and uploaded fonts (bytes and rows); live redirects; the approved external-origin allowlist; and per-site policy settings.

What doesn't — the response lists this too, under notCopied:

Not copiedWhy
hostnamesThe copy gets a fresh preview host. Add its real domain with POST /admin/domains, never by hand
leadsThey are the source client's data
credentialsA fresh one is minted for the copy
audit logThe copy's history starts at its creation
version historyOnly each page's live payload comes over, as one fresh version
SEO fingerprintsCopying them would flag the copy as a near-duplicate of itself
contact details (NAP)site_config.contact starts empty — set the new client's with PUT /v1/site { "contact": … }, or the copy stays a plain Organization
connector configsOpt in with includeConnectors: true; a feed config names a specific office/board id, so as copied it pulls the source's data
archived pages, 410 tombstonesA new site has no old URLs to keep stable
unused media, redirectsOnly with asTemplate: true: the copy takes just the media its pages use, and none of the source's redirects

Asset ids are reminted, and references are rewritten for you — in html, in css url(), and in meta.ogImage. A hand-rolled copy that keeps the original ids points at assets that don't exist under the new site, and every image 404s.

The copy is kept out of search results until it has a domain of its own: its pages and its robots.txt stay closed to crawlers, and this clears itself when its own custom hostname serves. It does not come from page meta, so don't try to fix it there.

Your first write to each page of the copy needs no acknowledgment while it has no custom domain serving; the rules are in Sites created as a copy.

One call copies at most 300 pages and 400 media items; a larger source returns 422 rather than half-copying. A source with more media is accepted with asTemplate: true when its pages use 400 or fewer. Check warnings: an asset whose bytes are missing from storage is skipped and named there, and would otherwise render a broken image silently.

Integration field types, for other Proof products

GET /admin/integration-field-types?product=<name>, on the product's own key, tells another Proof product which of its question types a Moseik form can render: supported (their type → the Moseik field type) and refused (their type → why). Both are derived from the platform's own tables, so read this rather than keeping a copy of the mapping. A product with no mapping answers 404.

Drafts from the outreach pipeline

POST /v1/drafts with Authorization: Bearer <pipeline key> (issued to Proof's outreach pipeline only) requires domain: the business's own domain, new to Moseik (400 draft.domain, 409 draft.domain_taken). The key's daily cap replaces the per-address one (429 draft.key_limit), and the claimer lands on Billing unless landing says otherwise. A key that isn't live is 401 draft.key. Two reads need the key too:

In one breath

/docs (no auth) → provisioning key → POST /admin/onboard → credential → exchange for a token → take the lease → build with /v1/stylesheet, /v1/pages, /v1/partials, /v1/script, /v1/theme, screenshotting as you go.