Skip to content
SOSEI

For hosting companies and agencies

Partner API

Rebuild your customers' websites from your own control panel. You send a customer's email and the address of their current site; SOSEI crawls it, builds a modern multi-page replacement, hosts it and keeps it current. Your system creates the site, follows the build, signs the customer in, and suspends or deletes the site when the customer leaves.

REST and JSON, server to server. Machine-readable description: OpenAPI 3.1. To get an API key, contact us.

How it works

  1. Create. POST /sites with the customer's email and current website. The answer is immediate; the site is building.
  2. Wait. A build takes about ten minutes. Poll GET /sites/{id}, or receive the signed site.ready webhook.
  3. Open. When the customer clicks "my website" in your panel, ask for a login link and redirect their browser to it. They land in the editor signed in, with no password and no second account to remember.
  4. Manage. Suspend, resume or delete the site as the customer's plan with you changes, and read the month's usage.

Two choices: who bills, and whose brand

They are set per partner account when it is created, and they are independent of each other.

Who charges the customer

ModeWhat the customer experiencesWhat you can do
Partner billingYou charge the customer, at your own price. The customer never sees a trial countdown, a SOSEI checkout or a SOSEI billing email. SOSEI invoices you per site from the usage report.Everything, including suspend, resume and delete.
Direct billingThe customer gets a free trial and then subscribes with SOSEI. You are the introducer.Create, read and sign in. Suspend, resume and delete are refused: you may take offline only what you pay for.

White-label

SettingWhat the customer sees
OnYour logo, name, colour, browser-tab icon and support address in the dashboard and the editor, with no cookie banner or advertising tags of ours. No "Made by sosei.site" credit on sites you pay for. No emails about the site under SOSEI's name: you tell your customer their site is ready. One thing still carries our name: until the customer's own domain is connected, the site's address is on sosei.site.
OffSOSEI's own editor and emails, as a direct SOSEI customer sees them.

Authentication

Every call carries your API key in a header, from your server:

Authorization: Bearer sk_yourslug_0123456789abcdef0123456789abcdef
  • Never put the key in a URL or in code that runs in a browser. A key sent as a query parameter is refused with api_key_in_url, because a URL ends up in browser history and in every proxy's access log.
  • The key belongs to one partner account. It acts only on sites that account created.
  • We show a key once, when it is issued or rotated. Rotating it stops the old one at once.

Quickstart

Check the key:

curl https://sosei.site/api/partner/v1/account -H "Authorization: Bearer $SOSEI_API_KEY"

Create a site:

curl -X POST https://sosei.site/api/partner/v1/sites \
  -H "Authorization: Bearer $SOSEI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "url": "example.com",
    "external_id": "order-1234"
  }'

The answer is 201 with the site. Keep its id, then read it until status is ready:

curl https://sosei.site/api/partner/v1/sites/SITE_ID -H "Authorization: Bearer $SOSEI_API_KEY"

Endpoints

Base address: https://sosei.site/api/partner/v1. Requests and answers are JSON. No answer is cached.

GET /account

Check the key and read your limits. Who the key belongs to, the billing mode, whether white-label is on, how many sites and customer accounts are used out of the limit, and terms: the prices (or the commission) in force this month, null when none are recorded yet. The cheapest call there is: use it to test a new key.

Answers 200 with { account }.

POST /sites

Create a site (starts the rebuild). Starts rebuilding a customer's existing website. Answers at once with the site in building; the crawl and the build run afterwards and take about ten minutes. Safe to retry: the same external_id, or the same customer and website, answers with the site that already exists (200) instead of building a second one. Calling it again for a site whose build failed starts the build again (202).

Body fieldTypeRequiredMeaning
emailstringYesThe customer who will own the site. An account is created for a new address. An address that already has an account you did not create is refused.
urlstringYesThe customer's current website, for example example.com.
namestringNoA display name, 1-120 characters. Defaults to the domain.
external_idstringNoYour own reference (an order or service id), 1-200 characters. Unique per partner; makes the call idempotent.

Answers 201 with { site }.

GET /sites

List your sites. Your sites, newest first. Sites in the trash are not listed. Pass external_id to look one up by your own reference.

Query parameterTypeMeaning
limitinteger1-100, default 50.
offsetintegerDefault 0.
external_idstringReturn only the site with this reference.

Answers 200 with { sites, total, limit, offset }.

GET /sites/{id}

Read one site. The site as it is right now. Poll this until status is ready or failed.

Answers 200 with { site }.

Sign the customer in. A single-use address that signs the site's owner in and opens the site. Redirect the customer's browser to url straight away: it works once and for two minutes. Your API key is never part of it.

Body fieldTypeRequiredMeaning
target"dashboard" | "editor"NoWhere the customer lands. Default dashboard.
hoststringNoSign the customer in on your own portal host. Must be one of the domains registered for your account.

Answers 201 with { url, expires_at }.

POST /sites/{id}/suspend

Take a site offline. Visitors see a neutral "temporarily unavailable" page; the owner can still open the site signed in. Nothing is deleted, and the site stops counting on the usage report while it stays suspended. Safe to repeat. Partner billing only.

Answers 200 with { site }.

POST /sites/{id}/resume

Put a suspended site back online. Safe to repeat. Partner billing only.

Answers 200 with { site }.

DELETE /sites/{id}

Delete a site. Moves the site to the trash: it stops serving at once and is removed for good after 14 days (purge_after). Until then SOSEI support can restore it. Safe to repeat. Partner billing only.

Answers 200 with { deleted, site_id, purge_after }.

GET /usage

Read a month's usage. What the month's invoice is made from: every site, whether it was billable in that month, and how many builds finished in it. When prices are recorded for the month it also carries the money, from the same computation our invoice is written from. With partner billing: charges (the monthly fee, the sites it covers, each further billable site at its price, and the total before tax, in minor units of currency). With direct billing and a commission agreed: commission (what your customers paid in the month, per currency, and your share). final is false while the month is still running.

Query parameterTypeMeaning
monthstringYYYY-MM, UTC. Default: the current month.

Answers 200 with { usage }.

The site object

{
  "site": {
    "id": "0b8f5c1e-6a0f-4f0e-9a52-2f1d3c7b9e10",
    "external_id": "order-1234",
    "name": "example.com",
    "source_url": "https://example.com",
    "status": "building",
    "phase": "crawling",
    "live": false,
    "suspended": false,
    "url": "https://sosei.site/s/example-com",
    "preview_url": "https://sosei.site/s/example-com",
    "custom_domain": null,
    "custom_domain_verified": false,
    "error": null,
    "created_at": "2026-11-24T16:00:00.000Z",
    "updated_at": "2026-11-24T16:00:00.000Z"
  }
}
  • status is building, ready or failed. phase is the step inside it (crawling, queued, writing, done, failed) for a progress line.
  • live is true once a built version is public at url. A suspended site is not live. A rebuild that fails leaves the version before it serving, so a site can be failed and live at once.
  • url is the customer's own domain once it is connected and verified, and the hosted address until then. preview_url is always the hosted address.
  • error says in plain words why a build stopped. Call POST /sites again with the same reference to start it again.

Signing a customer in

Ask for a login link at the moment the customer clicks, and redirect their browser to it. The link works once and for two minutes, so it is useless to anyone who finds it in a log afterwards.

// Your server, when the customer clicks "Open my website".
app.get("/open-website/:siteId", async (req, res) => {
  const r = await fetch(`https://sosei.site/api/partner/v1/sites/${req.params.siteId}/login-link`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SOSEI_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ target: "dashboard" }),
  });
  if (!r.ok) return res.status(502).send("Could not open the website.");
  const { url } = await r.json();
  res.redirect(url); // works once, for two minutes
});

With your own portal host registered for the account, pass "host" to sign the customer in on that host instead of ours.

Webhooks

Give us one HTTPS address and we POST an event to it when a build finishes (site.ready) or stops (site.failed).

{
  "id": "evt_5f0c2b7a-…",
  "event": "site.ready",
  "created_at": "2026-11-24T16:10:42.000Z",
  "partner_id": "…",
  "site": { "id": "…", "status": "ready", "live": true, "url": "…" }
}

site is the same object GET /sites/{id} returns. Every request is signed: the X-Sosei-Signature header is sha256= followed by the HMAC-SHA256 of the raw request body, keyed with your signing secret, in hex. Verify it before you trust the body:

import crypto from "node:crypto";

// `rawBody` is the request body exactly as received, before JSON.parse.
function isFromSosei(rawBody, signatureHeader, signingSecret) {
  const expected =
    "sha256=" + crypto.createHmac("sha256", signingSecret).update(rawBody).digest("hex");
  const a = Buffer.from(signatureHeader ?? "");
  const b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
  • Answer with any 2xx within 5 seconds. Anything else is retried twice, a few seconds apart.
  • The same id twice is a retry; ignore the second. Reject an event whose created_at is more than five minutes old.
  • A site.failed can be followed by a site.ready when an automatic retry succeeds.
  • Webhooks are a convenience. GET /sites/{id} is the source of truth, so a missed event costs you nothing but a poll.
  • We do not follow redirects, and we do not deliver to private or internal addresses.

Usage and invoicing

GET /usage?month=YYYY-MM returns every site with whether it was billable in that month, and the number of builds that finished in it. With partner billing, that report is what your invoice is made from, and you can read it any day.

The rule, in one sentence: a site is billable for a calendar month (UTC) if at any moment of that month it had been built, was not suspended and had not been deleted.

  • A site that never finished building costs nothing.
  • A site suspended for the whole month costs nothing.
  • A site that was live for one day of the month counts for that month.

The amount is in the same answer. Once your prices are recorded, usage.charges shows the month as we will invoice it: the monthly fee, the sites it covers, each further billable site at its price, and the total before tax. Amounts are whole numbers in the minor unit of currency (1490 is 14.90). It is the computation our invoice is written from, so you can check the invoice against it, and final tells you whether the month is still running. A new price applies from the month it starts in; earlier months keep theirs.

"charges": {
  "currency": "EUR",
  "billable_sites": 123,
  "monthly_fee_minor": 75000,
  "included_sites": 100,
  "extra_sites": 23,
  "site_price_minor": 600,
  "sites_minor": 13800,
  "total_minor": 88800
}

With direct billing your customers pay SOSEI, and if a commission is agreed, usage.commission shows what they paid in the month and your share of it: one line per currency they paid in, from paid invoices, before tax and after refunds.

Prices and commission are agreed per partner; GET /account shows the ones in force. Ask us for a quote.

Errors

An error is always the same shape. code is stable and safe to branch on; message is written for a person reading a log.

{ "error": { "code": "site_limit_reached", "message": "…" } }

Error codes

CodeHTTPMeaning
missing_api_key401No Authorization: Bearer <key> header.
invalid_api_key401The key is wrong, was rotated, or the partner account is disabled.
api_key_in_url400The key was sent as a query parameter. Send it in the header, and rotate it.
rate_limited429Too many requests. Wait for Retry-After seconds and retry.
invalid_json400The body is not a JSON object.
invalid_email400email is missing or not an email address.
invalid_url400url is missing or not a website address.
invalid_name400name is empty or longer than 120 characters.
invalid_external_id400external_id is empty or longer than 200 characters.
invalid_target400target is not "dashboard" or "editor".
host_not_allowed400host is not one of the domains registered for your account.
invalid_limit400limit is not a whole number from 1 to 100.
invalid_offset400offset is not a whole number, 0 or more.
invalid_month400month is not YYYY-MM.
email_not_allowed403The address belongs to an account you did not create. Use another address, or ask SOSEI to link the account.
blocked_rebuild_target403The website is on the list of sites that are not rebuilt (large platforms, banks, government and similar).
owner_not_managed403The site's owner is no longer one of your customers, so they cannot be signed in through you.
site_not_found404No such site among the sites you provisioned.
ambiguous_email409Two accounts answer to this address. Contact SOSEI.
account_conflict409The customer account could not be created. Retry; if it persists, contact SOSEI.
user_limit_reached409Your customer-account limit is reached. Ask SOSEI to raise it.
site_limit_reached409Your site limit is reached. Delete a site, or ask SOSEI to raise the limit.
site_has_no_owner409The site has no owner account to sign in.
direct_billing409Suspend, resume and delete are only for partners that pay for their customers' sites.
database_error500A temporary failure on our side. Retry.
usage_unavailable500The usage report could not be computed. Retry.
internal_error500A failure on our side. Retry; if it persists, contact SOSEI.
unavailable503The partner API is not available on this server.

Limits

  • Sites and customer accounts. Each partner account has a maximum of both, shown by GET /account. Sites in the trash do not count.
  • Requests. 300 a minute per partner account, 20 new sites a minute. Past that the answer is 429 with a Retry-After header.
  • Rebuilds. A site you pay for can be regenerated from the editor up to 5 times a month. Edits in the editor are not rebuilds and do not count.
  • What cannot be rebuilt. Large platforms, banks, government sites and similar are refused, to keep the service from being used to clone them.

What version 1 does not do

Said here so you can plan around it rather than discover it:

  • Connecting the customer's domain. A site is served at its hosted address until its own domain is connected, which today is done in the editor's Domain tab, not through this API.
  • Building a site from a description. The API rebuilds an existing website. Starting from a written brief, for a customer who has no website yet, is not available through the API.
  • Your own preview domain. The hosted address is on sosei.site.
  • Restoring a deleted site. Within the 14 days, write to [email protected].

Questions, or a call your integration needs that is not here: [email protected]. Security and data protection are described on the Security & Trust page.