Skip to content
API reference/Preview links

Switch off a preview link

Try it

Stops a working preview link at once: whoever opens it then sees that it has ended (in your brand, without the site's name). The site is untouched.

DELETE/api/v1/sites/{site_id}/preview-links/{link_id}

Authentication

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 optionalMCP tool: switch_off_preview_link

Parameters

Named placeholders go in the path; the rest in the query string.

site_idstringPath · required
The site's id.1 to 100 characters
link_idstringPath · required
The preview link's id.1 to 100 characters

Response

200 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
curl -X DELETE 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/preview-links/LINK_ID' \
  -H "Authorization: Bearer $WEBSITEBUDDY_API_KEY"
Example arguments
{
  "site_id": "SITE_ID",
  "link_id": "LINK_ID"
}
Response schema
{
  "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
}