https://www.helprange.com/api/v2/files/{file_id}/linksA new tracked share link for a document with its own settings. A setting your plan does not include is refused with the plan that has it. Counts towards the daily cap of 2,000 links created through the API.
Plans: Max, Unlimited, Deal Room Pass, trial. Auth: Authorization: Bearer hr_live_… (team key), X-API-Key, Authorization: Api-Key <key> or an OAuth Bearer token. Scope: links:write. Operation id: createLink
| Name | In | Type | Description |
|---|---|---|---|
file_id required | path | integer | Document id (from List documents). (min 1) |
Content types: application/json, application/x-www-form-urlencoded.
| Field | Type | Description |
|---|---|---|
label | string | Who the link is for, e.g. "ACME - Anna" (shown in statistics). Unique per document: a label the document already has is refused with 400. Default: a label with the date and time. |
allow_download | boolean or integer or string | Allow download & print. Default: blocked on Pro and up, allowed on Free. true / false (also 1 / 0 or "true" / "false"). |
passcode | string | Password the viewer must enter (Pro and higher). Surrounding spaces are dropped; only spaces = no passcode. At most 30 characters. |
expires_on | string (date) | Last day the link works, YYYY-MM-DD (Pro and higher). Today or later – a day in the past or an unreadable date is refused with 400. |
views_limit | integer or null | Maximum number of views. 0, null or empty = no limit; a negative or non-whole number is refused with 400. (min 0) |
watermark | boolean or integer or string | Watermark pages with the viewer's e-mail and date (Pro and higher). true / false (also 1 / 0 or "true" / "false"). |
require_email | boolean or integer or string | Ask for the viewer's e-mail before opening (Pro and higher). true / false (also 1 / 0 or "true" / "false"). |
disallow_forwarding | boolean or integer or string | Only the first person who opens it can use it. true / false (also 1 / 0 or "true" / "false"). |
one_viewer_at_a_time | boolean or integer or string | Only one person can view at the same time. true / false (also 1 / 0 or "true" / "false"). |
curl -X POST https://www.helprange.com/api/v2/files/250/links \
-H "X-API-Key: $HELPRANGE_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary '{"label": "ACME - Anna", "passcode": "oak-41", "expires_on": "2026-12-31", "watermark": true, "require_email": true}'
const res = await fetch('https://www.helprange.com/api/v2/files/250/links', {
method: 'POST',
headers: {'X-API-Key': process.env.HELPRANGE_API_KEY, 'Content-Type': 'application/json'},
body: JSON.stringify({
"label": "ACME - Anna",
"passcode": "oak-41",
"expires_on": "2026-12-31",
"watermark": true,
"require_email": true
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${data.error || data.message || data.reason}`);
console.log(data);
import os
import requests
r = requests.post(
'https://www.helprange.com/api/v2/files/250/links',
headers={'X-API-Key': os.environ['HELPRANGE_API_KEY']},
json={
"label": "ACME - Anna",
"passcode": "oak-41",
"expires_on": "2026-12-31",
"watermark": True,
"require_email": True,
},
timeout=60,
)
r.raise_for_status()
print(r.json())
The samples read the key from the HELPRANGE_API_KEY environment variable.
| Status | Description |
|---|---|
201 | Created |
400 | Invalid input – the message says which parameter. |
401 | Missing or invalid API key / OAuth token. Team keys: code invalid_key, key_revoked, key_expired or key_owner_removed. |
402 | Your plan does not include the REST API (or this feature). |
403 | The team API key lacks the scope this endpoint needs. |
404 | Not found – or not yours (the API never says which). |
405 | Wrong HTTP method for this endpoint. |
429 | A usage limit was reached – wait Retry-After seconds. |
{
"id": 264,
"url": "https://www.helprange.com/view/8956d1e7b91b47e196a8040b1d4894f8/proposal.pdf",
"label": "ACME - Anna",
"allow_download": false,
"passcode": true,
"expires_on": "2026-12-31",
"views_limit": null,
"watermark": true,
"require_email": true,
"disallow_forwarding": false,
"one_viewer_at_a_time": false,
"document_id": 250,
"document": "proposal.pdf"
}
Uses your real account. The request goes from your browser straight to www.helprange.com with your API key and acts as you – this POST changes data. The key stays in this page (in this tab's session storage only if you tick the box), is never put in a URL and is not sent to analytics. Do not paste a key on a shared computer.