Preview the page template
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.
Authorization<token>Format: Authorization: Token {api_key}
application/json- body
body?stringLiquid and HTML for the page body, at most 65,536 bytes (UTF-8, so fewer characters if you
use non-ASCII text). Must include {% store_buttons %} at the top level. Omit to keep the
current value; send an empty string to clear it. null is rejected.
css?stringPlain CSS for the page, at most 32,768 bytes. Omit to keep the current value; send an empty
string to clear it. null is rejected.
platform?stringDevice the page is rendered for
"ios""ios""android""desktop"link_id?stringUUID of a link in the project to render the page for. Needs the links.show scope. Defaults to a sample link.
The rendered page
application/json- response
html?stringcurl -X POST 'https://dynalinks.app/api/v1/page_template/preview' \ -H 'Content-Type: application/json' \ -d '{ "body": "<h1>{{ link.title }}</h1>\n{% store_buttons %}", "platform": "android"}'{ "html": "<!DOCTYPE html>\n<html>\n <head>...</head>\n <body>...</body>\n</html>"}Unpublish the page template POST
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.
List page template versions GET
Lists the kept published versions (up to 20), newest first, marking the live one. Bodies and CSS are left out; get a single version for them. **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.