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
- Create.
POST /siteswith the customer's email and current website. The answer is immediate; the site isbuilding. - Wait. A build takes about ten minutes. Poll
GET /sites/{id}, or receive the signedsite.readywebhook. - 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.
- 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
| Mode | What the customer experiences | What you can do |
|---|---|---|
| Partner billing | You 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 billing | The 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
| Setting | What the customer sees |
|---|---|
| On | Your 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. |
| Off | SOSEI'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 field | Type | Required | Meaning |
|---|---|---|---|
email | string | Yes | The 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. |
url | string | Yes | The customer's current website, for example example.com. |
name | string | No | A display name, 1-120 characters. Defaults to the domain. |
external_id | string | No | Your 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 parameter | Type | Meaning |
|---|---|---|
limit | integer | 1-100, default 50. |
offset | integer | Default 0. |
external_id | string | Return 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 }.
POST /sites/{id}/login-link
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 field | Type | Required | Meaning |
|---|---|---|---|
target | "dashboard" | "editor" | No | Where the customer lands. Default dashboard. |
host | string | No | Sign 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 parameter | Type | Meaning |
|---|---|---|
month | string | YYYY-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"
}
}statusisbuilding,readyorfailed.phaseis the step inside it (crawling,queued,writing,done,failed) for a progress line.liveis true once a built version is public aturl. A suspended site is not live. A rebuild that fails leaves the version before it serving, so a site can befailedandliveat once.urlis the customer's own domain once it is connected and verified, and the hosted address until then.preview_urlis always the hosted address.errorsays in plain words why a build stopped. CallPOST /sitesagain 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
idtwice is a retry; ignore the second. Reject an event whosecreated_atis more than five minutes old. - A
site.failedcan be followed by asite.readywhen 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
| Code | HTTP | Meaning |
|---|---|---|
missing_api_key | 401 | No Authorization: Bearer <key> header. |
invalid_api_key | 401 | The key is wrong, was rotated, or the partner account is disabled. |
api_key_in_url | 400 | The key was sent as a query parameter. Send it in the header, and rotate it. |
rate_limited | 429 | Too many requests. Wait for Retry-After seconds and retry. |
invalid_json | 400 | The body is not a JSON object. |
invalid_email | 400 | email is missing or not an email address. |
invalid_url | 400 | url is missing or not a website address. |
invalid_name | 400 | name is empty or longer than 120 characters. |
invalid_external_id | 400 | external_id is empty or longer than 200 characters. |
invalid_target | 400 | target is not "dashboard" or "editor". |
host_not_allowed | 400 | host is not one of the domains registered for your account. |
invalid_limit | 400 | limit is not a whole number from 1 to 100. |
invalid_offset | 400 | offset is not a whole number, 0 or more. |
invalid_month | 400 | month is not YYYY-MM. |
email_not_allowed | 403 | The address belongs to an account you did not create. Use another address, or ask SOSEI to link the account. |
blocked_rebuild_target | 403 | The website is on the list of sites that are not rebuilt (large platforms, banks, government and similar). |
owner_not_managed | 403 | The site's owner is no longer one of your customers, so they cannot be signed in through you. |
site_not_found | 404 | No such site among the sites you provisioned. |
ambiguous_email | 409 | Two accounts answer to this address. Contact SOSEI. |
account_conflict | 409 | The customer account could not be created. Retry; if it persists, contact SOSEI. |
user_limit_reached | 409 | Your customer-account limit is reached. Ask SOSEI to raise it. |
site_limit_reached | 409 | Your site limit is reached. Delete a site, or ask SOSEI to raise the limit. |
site_has_no_owner | 409 | The site has no owner account to sign in. |
direct_billing | 409 | Suspend, resume and delete are only for partners that pay for their customers' sites. |
database_error | 500 | A temporary failure on our side. Retry. |
usage_unavailable | 500 | The usage report could not be computed. Retry. |
internal_error | 500 | A failure on our side. Retry; if it persists, contact SOSEI. |
unavailable | 503 | The 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
429with aRetry-Afterheader. - 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.