Skip to content
nexdoc.design Docs

Viewer API

Mint live preview sessions, recover expired viewer links, and patch editable text nodes in the canvas.

Preview links last 24 hours. Remint anytime — the design is not gone when a link expires. Completed runs also include viewer_url and viewer_expires_at on GET …/runs/:id.

GET/v1/jobs/{job_id}/viewer/session

Scope: jobs:read

code
{
  "viewer_url": "https://view.nexdoc.design/job/job_...?token=...",
  "expires_at": "..."
}
code
curl -sS "$NXD_API_URL/v1/jobs/$JOB/viewer/session" \
  -H "Authorization: Bearer $NXD_API_KEY" | jq

Opening a still-valid link extends the session. After expiry the viewer shows a recovery page (not a raw 401). If the job was published, that page still links to public_url.

GET/v1/jobs/{job_id}/viewer/resume

Scope: jobs:read

Signed-in visitors receive a fresh preview token (expired-token recovery).

PATCH/v1/jobs/{job_id}/nodes

Scope: jobs:rw

Hot-patch a contenteditable node in the job’s current HTML (click-to-edit in the viewer).

code
{
  "node_id": "nxd-node-...",
  "content": "Updated headline"
}
code
{
  "updated": true,
  "job_id": "job_...",
  "node_id": "nxd-node-..."
}

404 if no HTML is available for the job.