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. Also available as the MCP tool shorten_link.
Request body
JSON, sent with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
url | string | required | The http or https address to shorten. Checked for abuse before it goes live. |
ending | string | optional | A custom ending for snip.link/<ending>: 3 to 40 letters, digits, dashes or underscores. Omit 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 in the dashboard and at its image URLs. |
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. |
Example request
curl -s -X POST "https://snip.link/v1/links" \
-H "Authorization: Bearer $SNIP_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/menus/spring-2026","ending":"spring-menu","title":"Spring menu"}'Example response
{
"link": {
"id": "lnk_7f0c2a2b4bb04a8b",
"code": "spring-menu",
"short_url": "https://snip.link/spring-menu",
"url": "https://example.com/menus/spring-2026",
"title": "Spring menu",
"redirect": 302,
"disabled": false,
"clicks": 1284,
"qr_style": {
"style": "rounded",
"fg": "#111111",
"bg": "#ffffff",
"ecc": "M"
},
"qr_png_url": "https://snip.link/qr.png?data=https%3A%2F%2Fsnip.link%2Fspring-menu%3Fqr%3D1",
"qr_svg_url": "https://snip.link/qr.svg?data=https%3A%2F%2Fsnip.link%2Fspring-menu%3Fqr%3D1",
"created_at": "2026-10-01T09:12:40.000Z",
"updated_at": "2026-10-18T16:03:11.000Z"
}
}Response fields
| Field | Type | Description |
|---|---|---|
link | Link | |
link.id | string | Stable id. Every link route accepts it, or the ending. |
link.code | string | The ending: the path after snip.link/. |
link.short_url | string | The short link, ready to share or print. |
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.clicks | integer | Every click and scan since the link was made. |
link.qr_style | QrStyle | How the link's QR code is drawn in the dashboard and at its image URLs. |
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.created_at | string | |
link.updated_at | string |
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). |