Documentation
Create a link
POST
/v1/linksLinksShortens a destination into the account. Free: no credits are charged. The destination is screened (http or https, a real host, not another shortener, not flagged by Google Web Risk) and the link is live within seconds. A plan holds 100 links on Free and 5,000 on Pro; past that the call answers 429 quota_exceeded with details.upgrade. With capture, the page it points to is saved too (see Snapshots): the answer still comes back at once, with every format's URL. Also available as the MCP tool shorten_link, and without a key from a terminal: curl -d url=https://example.com https://snip.link answers with a visitor's short link.
Request body
JSON, sent with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
url | string | required | The http or https address to shorten. Slips with one reading are fixed first (a clipped or doubled scheme such as tps:// or https://https://, quotes around the link, punctuation after it), so the stored url can differ from what was sent. Checked for abuse before it goes live; a refusal names the field in details.url. |
ending | | string | optional | A custom ending for go.snip.link/<ending> (also available at snip.link/r/<ending>): 3 to 40 ASCII letters, digits, dashes or underscores, with no spaces. Free with an account. Omit or send an empty string for a random code. |
title | string | optional | A name for the dashboard. |
redirect | 301 | 302 | optional | 302 (default) or 301. |
qr_style | QrStyle | optional | How the link's QR code is drawn: dots, colours and error correction apply in the dashboard and at the image URLs; the frame and artwork apply to the dashboard's downloads. |
qr_style.style | rounded | square | optional | Dot shape. |
qr_style.fg | string | optional | Dark colour, #rrggbb. |
qr_style.bg | string | optional | Light colour, #rrggbb. |
qr_style.ecc | L | M | Q | H | optional | Error correction level. |
qr_style.frame | object | optional | A frame with a call to action under the code, in the dashboard's downloads. |
qr_style.artwork | object | optional | Centre artwork drawn into the dashboard's downloads. Icons and emoji are saved by name; an uploaded image is saved through the dashboard and read back here as image. Sending image keeps the link's uploaded image; leaving artwork out removes it. |
presets | string[] | optional | Saved Library ids, at most one of each kind. Omit to inherit account Library defaults. [] opts out of Library defaults. Explicit link fields win. |
stats_public | boolean | optional | |
domain | string, null | optional | One of the account's own active domains (see list_domains) to put the link on instead of snip.link. Endings are per domain, and the site's own paths are free there. Left out: the account's default domain for new links, when it has one. |
expires_at | string | number | null | optional | When the link stops sending people to its url: an ISO date-time, a minute to ten years ahead. Null removes the expiry. Free on every plan. |
expires_in_days | integer | optional | A shortcut for expires_at: the link expires this many days from now (1 to 3650). Send one or the other. |
expired_url | string, null | optional | Where the link sends people after it expires; null shows a plain 'link expired' page (410). Checked like a destination. |
starts_at | string | number | null | optional | When the link goes live: an ISO date-time, a minute to ten years ahead. Before it a visit gets a "not live yet" page (404) and is not counted, and saved copies stay private. Null removes it. Must come before expires_at. Free on every plan. |
max_clicks | integer, null | optional | Stop the link after this many counted visits in total (1 to 10,000,000), counting the clicks it already has. Counted means what clicks counts: bots, link previews and repeat taps from one network within a minute are not. The visit that reaches it still goes through; after it the link answers like an expired one (expired_url or a 410), within a minute everywhere. Raising or removing the limit reopens it. Null removes it. Free on every plan. |
track | boolean | optional | False: visits are only counted (clicks still rises, max_clicks still applies), with no record of when, where, on what device or from which site. True (the default): every counted visit is recorded for analytics. Free on every plan. |
password | string, null | optional | A password visitors must enter before the link opens, 4 to 128 characters. Null removes it. Write-only: links report password_protected instead. |
routes | array, null | optional | Up to 20 rules, tried in order: each sends visits that match its conditions (device, OS, browser, country, region, language, time, weekday, dates, scan or click, referring site, a link parameter, a share of visitors) to its own url, or with action off switches the link off for them. Free on every plan. Null or an empty list removes them. Each new address counts toward the day's destination changes with url and expired_url (one change per request). |
forward_query | boolean | optional | When true, a visit's own query parameters (?ref=ig and the like) are added to the destination, replacing a parameter of the same name; Snip.link's qr marker is never passed on. Free on every plan. |
preview | object, null | optional | The link's own social preview: the title, line and picture chat apps and social sites (iMessage, WhatsApp, Slack, Discord, X, LinkedIn, Facebook and the like) show when the short link is pasted, in place of the destination's own. Any field left out falls back to the destination's. image is an https address of a picture, or screenshot for the page's first screen from the link's newest public saved copy. Null clears it. Free on every plan. |
snapshots | public | private | off | optional | Who can read the link's saved copies. public: anyone with the link, at the link's format endings (snip.link/abc.md, .pdf ...), and the first one asked for saves the page. private: only you, through the signed URLs the API returns. off: no copies are made. |
capture | boolean | string | string[] | optional | Save the page the link points to. true saves every format (Markdown, text, a full-page screenshot, a PDF and a web archive); a list or comma list picks some: markdown, text, screenshot, pdf, archive. The answer comes back at once with snapshot.formats; those URLs work right away and fill in seconds later. |
wait | boolean | optional | Hold the answer until the page is saved (up to about 25 seconds) and include its Markdown in snapshot.markdown. Without it the answer is immediate. |
max_age | integer | optional | Reuse a copy of the same page saved this many seconds ago or less (default 86400). 0 always loads the page again. |
Example request
Terminal
curl "https://snip.link/v1/links" \
-X POST \
-H "Authorization: Bearer $SNIP_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/menus/spring-2026",
"ending": "spring-menu",
"title": "Spring menu",
"capture": true
}'Example response
Response
{
"link": {
"id": "lnk_7f0c2a2b4bb04a8b",
"code": "spring-menu",
"domain": "go.snip.link",
"short_url": "https://go.snip.link/spring-menu",
"url": "https://example.com/menus/spring-2026",
"title": "Spring menu",
"redirect": 302,
"disabled": false,
"held": false,
"expires_at": null,
"expired_url": null,
"expired": false,
"starts_at": null,
"scheduled": false,
"max_clicks": null,
"limit_reached": false,
"track": true,
"password_protected": false,
"routes": [
{
"when": "all",
"conditions": [
{
"kind": "os",
"values": ["ios"]
}
],
"url": "https://apps.apple.com/app/id1234567890",
"match": "ios"
},
{
"name": "Lunch menu",
"when": "all",
"conditions": [
{
"kind": "time",
"from": "11:00",
"to": "15:00",
"tz": "America/New_York"
},
{
"kind": "weekday",
"values": [1, 2, 3, 4, 5],
"tz": "America/New_York"
}
],
"url": "https://example.com/menus/lunch"
}
],
"forward_query": false,
"preview": {
"title": "Spring menu",
"description": "Twelve new dishes, out now.",
"image": "screenshot"
},
"health": {
"status": "ok",
"code": 200,
"checked_at": "2026-10-20T08:00:00.000Z"
},
"clicks": 1284,
"qr_style": {
"style": "rounded",
"fg": "#111111",
"bg": "#ffffff",
"ecc": "M"
},
"qr_png_url": "https://snip.link/qr.png?data=https%3A%2F%2Fgo.snip.link%2Fspring-menu%3Fqr%3D1",
"qr_svg_url": "https://snip.link/qr.svg?data=https%3A%2F%2Fgo.snip.link%2Fspring-menu%3Fqr%3D1",
"snapshots": "public",
"watch": null,
"file": null,
"stats_url": null,
"created_at": "2026-10-01T09:12:40.000Z",
"updated_at": "2026-10-18T16:03:11.000Z"
},
"snapshot": {
"id": "5f0f3a2e-8c1b-4b0e-9d6a-1f2e3d4c5b6a",
"status": "ok",
"reason": null,
"reused": false,
"saved_at": "2026-10-23T09:12:40.000Z",
"captured_at": "2026-10-23T09:12:46.000Z",
"source": "https://example.com/menus/spring-2026",
"final_url": "https://example.com/menus/spring-2026",
"title": "Spring menu",
"description": "Seasonal dishes, served from March to May.",
"formats": {
"md": "https://snip.link/spring-menu.md?v=5f0f3a2e-8c1b-4b0e-9d6a-1f2e3d4c5b6a",
"pdf": "https://snip.link/spring-menu.pdf?v=5f0f3a2e-8c1b-4b0e-9d6a-1f2e3d4c5b6a",
"jpg": "https://snip.link/spring-menu.jpg?v=5f0f3a2e-8c1b-4b0e-9d6a-1f2e3d4c5b6a"
},
"fingerprints": {
"markdown": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
link | Link | |
link.id | string | Stable id. Every link route accepts it, or a current or previous ending. |
link.code | string | The current ending: the path after the domain. |
link.domain | string | The hostname the link lives on: snip.link, or one of the account's own domains. |
link.short_url | string | The canonical short link, ready to share or print. New platform links use go.snip.link; snip.link/r/<ending> is an equivalent alias. Existing root URLs stay valid. |
link.url | string | Where the link goes now. Change it any time; printed codes follow. |
link.title | string, null | A name for the dashboard. Null when unset. |
link.redirect | integer | 302 (default: every scan is counted) or 301 (browsers may cache the hop). |
link.disabled | boolean | A disabled link answers 404 until it is enabled again. |
link.held | boolean | True while the link is switched off for a safety review. A held link cannot be changed or enabled (403 forbidden, details.reason link_held); it can be deleted. |
link.expires_at | string, null | When the link stops sending people to url, or null. |
link.expired_url | string, null | Where the link sends people after it expires; null shows a plain 'link expired' page (410). Checked like a destination. |
link.expired | boolean | True once expires_at has passed. |
link.starts_at | string, null | When the link goes live: an ISO date-time, a minute to ten years ahead. Before it a visit gets a "not live yet" page (404) and is not counted, and saved copies stay private. Null removes it. Must come before expires_at. Free on every plan. |
link.scheduled | boolean | True while starts_at is still ahead. |
link.max_clicks | integer, null | Stop the link after this many counted visits in total (1 to 10,000,000), counting the clicks it already has. Counted means what clicks counts: bots, link previews and repeat taps from one network within a minute are not. The visit that reaches it still goes through; after it the link answers like an expired one (expired_url or a 410), within a minute everywhere. Raising or removing the limit reopens it. Null removes it. Free on every plan. |
link.limit_reached | boolean | True once the link reached max_clicks. |
link.track | boolean | False: visits are only counted (clicks still rises, max_clicks still applies), with no record of when, where, on what device or from which site. True (the default): every counted visit is recorded for analytics. Free on every plan. |
link.password_protected | boolean | True when visitors must enter a password first. The password is never returned. |
link.routes | array, null | Rules, or null. |
link.forward_query | boolean | When true, a visit's own query parameters (?ref=ig and the like) are added to the destination, replacing a parameter of the same name; Snip.link's qr marker is never passed on. Free on every plan. |
link.preview | LinkPreview | The link's own social preview: the title, line and picture chat apps and social sites (iMessage, WhatsApp, Slack, Discord, X, LinkedIn, Facebook and the like) show when the short link is pasted, in place of the destination's own. Any field left out falls back to the destination's. image is an https address of a picture, or screenshot for the page's first screen from the link's newest public saved copy. Null clears it. Free on every plan. |
link.health | object | The destination check: every link's destination is fetched every few days. failing after two failed checks in a row (a 404, a 410, a server error or no answer); sites that refuse automated visitors are not counted as failing. |
link.clicks | integer | Every click and scan since the link was made. |
link.qr_style | QrStyle | How the link's QR code is drawn: dots, colours and error correction apply in the dashboard and at the image URLs; the frame and artwork apply to the dashboard's downloads. |
link.library_sources | object[] | Snapshots of the Library items copied to this link. They are provenance, not live inheritance. |
link.qr_png_url | string | The link's QR code as PNG (512 px). Free, no key. |
link.qr_svg_url | string | The same code as SVG, for print. |
link.snapshots | public | private | off | Who can read the link's saved copies. public: anyone with the link, at the link's format endings (snip.link/abc.md, .pdf ...), and the first one asked for saves the page. private: only you, through the signed URLs the API returns. off: no copies are made. |
link.watch | Watch | The page watch: a fresh copy of the page daily or weekly, its words compared with the last look's, and an email to the owner listing what was added and what went when they differ. Null while the page is not watched. |
link.file | File | The file, when the link is a shared file (docs/drops.md): the link shows it instead of redirecting. Null for an ordinary link. |
link.stats_url | string, null | The link's public stats page (totals by day, country, referring site and device for the last 30 days), when the owner shared it with stats_public; null while the stats are private. |
link.created_at | string | |
link.updated_at | string | |
snapshot | Snapshot | The saved copy, when capture was sent. |
snapshot.id | string | The version's id; ?v=<id> on any format ending opens this version. |
snapshot.status | pending | running | ok | skipped | failed | pending or running: being saved. ok: saved. skipped: the page asks not to be archived (noarchive), so nothing was kept. failed: the page could not be loaded; reason says why. |
snapshot.reason | string, null | |
snapshot.reused | boolean | True when a copy of the page saved moments earlier was used. |
snapshot.saved_at | string | |
snapshot.captured_at | string, null | |
snapshot.source | string | The address that was saved: the link's destination at the time. |
snapshot.final_url | string, null | Where the browser ended up, after redirects. |
snapshot.title | string, null | |
snapshot.description | string, null | |
snapshot.formats | object | Each format this version can be had in, by extension, as the short link with that ending: md, txt, html (a reading view), pdf, jpg, png, webp, avif, json (the page's facts and words), csv (its tables) and mhtml. Private links' URLs carry a signature that works for a day. |
snapshot.fingerprints | object, null | SHA-256 of each saved file, by file name, once saved: proof of what the page said and when. |
snapshot.markdown | string | The page as Markdown, with wait. |
snapshot_error | object | Why the page was not saved (the daily limit, say). The link was still created. |
Errors
| Status | Meaning |
|---|---|
| 400 | The body or query is invalid. details names each field. |
| 401 | The API key is missing, malformed or revoked. |
| 409 | The ending is taken or reserved. Pick another. |
| 429 | Either the key exceeded its requests-per-second limit (honor Retry-After), or a daily or plan quota is used up (details.reason). |

