Dynalinks
Page templates

Unpublish the page template

POST
/page_template/unpublish
Manage the page template shown on link preview pages. Requires page-template access, enabled per project by Dynalinks. Experimental: the request and response shapes may still change.

Stops serving the page template. This changes the page every link in the project shows: links go back to the default page (or a legacy custom template, if the project has one). The draft and the versions are kept, so you can publish again at any time.

Requirements: a Pro plan, page templates enabled for the project, and an API key of a project owner or manager with the page_templates.publish scope. API keys with no scopes have full access, so they can unpublish too.

Authorization

headerAuthorization<token>

Format: Authorization: Token {api_key}

Response Body

Page template unpublished; live_version is null

application/json
  1. response
id?string

UUID of the page template

Formatuuid
body?string

Body of the draft

css?string

CSS of the draft

unpublished_changes?boolean

Whether the draft differs from the live version

live_version?|null

The version links currently show, or null if nothing is published

created_at?string
Formatdate-time
updated_at?string
Formatdate-time
Example Request
curl -X POST 'https://dynalinks.app/api/v1/page_template/unpublish'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "body": "string",  "css": "string",  "unpublished_changes": true,  "live_version": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "published_at": "2019-08-24T14:15:22Z",    "live": true,    "body": "string",    "css": "string"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}

Publish the page template draft POST

Publishes the draft as a new version. **This changes the page every link in the project shows.** Send `body` and/or `css` to save them first, as with `PATCH /page_template`. The last 20 versions are kept. Versions published through the API are recorded as published by the project owner. The request body is optional. When you send one, send `Content-Type: application/json`. Saving, publishing and previewing share a limit of 60 requests per minute per API key. **Requirements**: a Pro plan, page templates enabled for the project, and an API key of a project owner or manager with the `page_templates.publish` scope. API keys with no scopes have full access, so they can publish too. The `page_templates.publish` scope is enough to save a posted `body` or `css` here; `page_templates.update` is not needed.

Preview the page template POST

Renders the full link page as HTML, without saving anything. Renders the posted `body` and `css`; whatever is omitted comes from the saved draft (or the starter template if the saved draft is empty or the project has no page template). The page is rendered for a sample link, unless you pass `link_id`. The preview never redirects and never collects a fingerprint. Asset URLs in the HTML are absolute, so it can be shown in a webview or a `srcdoc` iframe. The HTML includes our page scripts, so show it in a sandboxed iframe (`<iframe sandbox="allow-scripts" srcdoc="...">`) to keep them out of your own origin. The request body is optional. When you send one, send `Content-Type: application/json`. Saving, publishing and previewing share a limit of 60 requests per minute per API key. **Requirements**: a Pro plan, page templates enabled for the project, and an API key of a project owner or manager with the `page_templates.show` scope. Previewing with `link_id` also needs the `links.show` scope.