Skip to content

Documentation

Preview applying an item to existing links

POST/v1/presets/{preset}/previewLibrary

Read-only. Returns each field before/after and each link's numeric updated_at revision. Does not change links.

Parameters

ParameterTypeRequiredDescription
presetstring, in the pathrequired

Request body

JSON, sent with Content-Type: application/json.

FieldTypeRequiredDescription
versionintegerrequiredCurrent version from the Library response. A stale edit answers 409.
linksstring[]required

Example request

curl -s -X POST "https://snip.link/v1/presets/preset/preview" \
  -H "Authorization: Bearer $SNIP_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Example response

{
  "preset": {
    "kind": "rules"
  }
}

Response fields

FieldTypeDescription
presetLibraryItem
preset.idstring
preset.kindrules | qr | campaign | preview | template
preset.namestring
preset.descriptionstring
preset.configobject
preset.versioninteger
preset.is_defaultboolean
preset.created_atstring
preset.updated_atstring
changesobject[]
changes[].link_idstring
changes[].titlestring
changes[].updated_atinteger
changes[].domain_unchangedboolean
changes[].fieldsobject[]

Errors

StatusMeaning
400The body or query is invalid. details names each field.
401The API key is missing, malformed or revoked.
403This account role cannot perform the action. details.reason identifies the permission refusal.
404No Library item or selected link in the authenticated account.
409The item or a selected link changed. Read it again and preview before retrying.
413The input is larger than the plan allows per run. details carries the size, the limit and the unit.
429Either the key exceeded its requests-per-second limit (honor Retry-After), or a daily or plan quota is used up (details.reason).
503The feature is switched off for the service right now. Try again later.

Back to getting started