PapermarkDocs

Brand API links with a custom domain

Create links on your own verified domain instead of the default papermark.com URL.

By default a link created through the API resolves on the marketing domain — https://www.papermark.com/view/{id}. If you have a custom domain connected to your workspace, you can have the API mint links on it instead, e.g. https://dataroom.acme.com/q4-acme-ventures — the same branded URL your manually-created links use.

Prerequisites

  1. A verified custom domain. Add and verify the domain in the Papermark dashboard first (Settings → Domains). The API only accepts domains that belong to your team and have passed DNS verification.
  2. The right plan. Custom domains require:
    • the Business plan (or higher) for document links, and
    • the Data Rooms plan (or higher) for dataroom links.

Pass domain and slug together in the POST /v1/links body. domain is the verified domain; slug is the path segment of the URL.

TOKEN=pm_live_…

curl -X POST https://api.papermark.com/v1/links \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dataroom_id": "dataroom_abcd1234",
    "name": "Acme Ventures — Q4",
    "domain": "dataroom.acme.com",
    "slug": "q4-acme-ventures",
    "email_protected": true
  }'

The response url is the branded URL:

{
  "id": "link_abcd1234",
  "object": "link",
  "url": "https://dataroom.acme.com/q4-acme-ventures",
  "domain": "dataroom.acme.com",
  "slug": "q4-acme-ventures",
  ...
}

Omit both fields and the link falls back to the default papermark.com/view/{id} URL.

domain and slug must always be sent together. Sending only one returns 422 unprocessable_entity.

The same pair works on PATCH /v1/links/{id}:

curl -X PATCH https://api.papermark.com/v1/links/link_abcd1234 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "dataroom.acme.com",
    "slug": "q4-acme-ventures"
  }'

Errors

StatusWhen
422 unprocessable_entityOnly one of domain / slug was sent.
422 unprocessable_entityThe domain is not connected to your team, or is not verified.
403 forbiddenYour plan does not include custom domains for this link type (Business for documents, Data Rooms for datarooms).
409 conflictThe slug is already in use on that domain. Pick another.

Required scopes

links.write — the same scope used to create or update any link.

On this page