Documentation
Save a Library item
POST
/v1/presetsLibraryFive saved items on Free, 100 on Pro. All reuse is free. Custom account limits apply. Concurrent creates cannot exceed the allowance.
Request body
JSON, sent with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
kind | rules | qr | campaign | preview | template | optional | |
name | string | required | |
description | string | optional | |
config | object | optional | rules: {routes}; qr: {qr_style}; campaign: {utm}; preview: {preview}; template: any of these plus domain, redirect, expires_in_days, expired_url, max_clicks, track, forward_query, snapshots, stats_public. No passwords, absolute dates or disabled state. |
version | integer | optional | Current version from the Library response. A stale edit answers 409. |
source_link | string | optional | Copy compatible settings and owned QR artwork from this account's link. |
include | 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. |
artwork_from | string | optional | An owned Library item's uploaded QR artwork to copy. |
Example request
curl -s -X POST "https://snip.link/v1/presets" \
-H "Authorization: Bearer $SNIP_KEY" \
-H "Content-Type: application/json" \
-d '{}'Example response
{
"preset": {
"kind": "rules"
}
}Response fields
| Field | Type | Description |
|---|---|---|
preset | LibraryItem | |
preset.id | string | |
preset.kind | rules | qr | campaign | preview | template | |
preset.name | string | |
preset.description | string | |
preset.config | object | |
preset.version | integer | |
preset.is_default | boolean | |
preset.created_at | string | |
preset.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. |
| 403 | This account role cannot perform the action. details.reason identifies the permission refusal. |
| 404 | No Library item or selected link in the authenticated account. |
| 409 | The item or a selected link changed. Read it again and preview before retrying. |
| 413 | The input is larger than the plan allows per run. details carries the size, the limit and the unit. |
| 429 | Either the key exceeded its requests-per-second limit (honor Retry-After), or a daily or plan quota is used up (details.reason). |
| 503 | The feature is switched off for the service right now. Try again later. |