hosting

POST /v1/bulk-site-imports/preview

Check every row of a site file before anything is created.

All hosting endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the sites.create permission; a key without it is refused with 403, not 404.

Where your organisation id goes

This endpoint takes org_id as a field in the JSON body.

Your organisation id is on the API keys screen in your dashboard, beside the key itself. It is the same id in every call you make.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X POST https://api.zinndigital.com/v1/bulk-site-imports/preview \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "csv": <string> }'

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Parses the rows (CSV; comma, semicolon or tab; a header row naming the columns, or no header and the columns in the template's order, so a pasted list of domains works) over the batch defaults, and answers per row what is wrong with it, by column: field validation by the one-site create path's own rules, an unknown site type, an unknown CDN, an own CDN account that is not connected (or not acknowledged on a platform-managed line), duplicates inside the file, a domain that is already one of the account's sites, and rows past the plan's remaining site slots. Nothing is written. A file that cannot be read at all comes back as file_error with a 200, so the screen can say why. ⛔ POST for a read: a file does not fit in a query string. Requires sites.create.

Request body

NameTypeRequiredWhat it is
csvstringYesThe rows' text. Comma, semicolon or tab separated; the first line is the header when it names a domain column, otherwise every line is a row in the template's order.
defaultsBulkSiteImportDefaultsNo"Settings for all sites": any of these SiteCreate fields, applied to every row that leaves the matching column blank. A row naming its own site_type drops the batch's…
org_idUuid | nullNoThe account the sites belong to. Optional when you reach exactly one.
product_linestringNoThe product line every row is created on (the deploy form's line).
notestringNo—

Response

NameTypeRequiredWhat it is
rowsobject[]Yes—
totalintegerYes—
validintegerYes—
invalidintegerYes—
quotaobject[]Yes—
file_errorobjectYes—

Errors this endpoint can return

401 · 403 · 422