API reference/Preview links
Make a preview link
Try itMakes a no-login link to the site's unpublished DRAFT — every page, on a computer or a phone, under a bar in your brand, never indexed — to send a prospect or a client before they have a login. It works for `days` (1–90, default 14) or until you switch it off. Up to 10 working links per site. Nothing on the site changes.
POST
/api/v1/sites/{site_id}/preview-linksAuthentication
An API key as Authorization: Bearer or x-api-key. It needs the sites:write scope — edit draft pages and sections.
sites:writeChanges the draft or a recordIdempotency-Key requiredMCP tool: create_preview_link
Parameters
Named placeholders go in the path; the rest in a JSON body.
site_idstringPath · required- The site's id.1 to 100 characters
labelstringBody · optional- Who it's for, e.g. "Sarah at Rosie's" — only you see it.At most 80 characters
daysintegerBody · optional- How many days it works (default 14).1 to 90
Response
201 with JSON on success (schema on the right). Errors use the standard envelope; a retry with the same Idempotency-Key gets the first answer back (how retries work).
curl -X POST 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/preview-links' \
-H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'{
"site_id": "SITE_ID"
}{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"site_id": {
"type": "string"
},
"link": {
"type": "string",
"description": "The address to send (on your own address when it's connected). No login needed."
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Who it's for — only you see it."
},
"status": {
"type": "string",
"enum": [
"active",
"expired",
"off"
],
"description": "active = works now; expired = ran out; off = switched off (or the site was archived)."
},
"expires_at": {
"type": "string"
},
"switched_off_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"last_opened_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"open_count": {
"type": "number",
"description": "Visits (moving between pages within a minute is one)."
},
"created_at": {
"type": "string"
}
},
"required": [
"id",
"site_id",
"link",
"label",
"status",
"expires_at",
"switched_off_at",
"last_opened_at",
"open_count",
"created_at"
],
"additionalProperties": false
}