Raw schema
{
"type": "object",
"properties": {
"targetUrl": {
"type": "string",
"description": "Absolute http(s) URL visitors are redirected to"
},
"name": {
"description": "Human label, up to 200 chars",
"type": "string"
},
"slug": {
"description": "Custom slug, ^[a-zA-Z0-9_-]{3,64}$; random if omitted",
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Free-form labels, up to 20; filter with list_short_links tag"
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
},
"description": "Up to 20 string key/value pairs for your own bookkeeping"
},
"qrStyle": {
"type": "object",
"properties": {
"dark": {
"type": "string",
"description": "Hex colour, e.g. #000000 (the # is optional)"
},
"light": {
"type": "string",
"description": "Hex colour, e.g. #000000 (the # is optional)"
},
"errorCorrectionLevel": {
"type": "string",
"enum": [
"L",
"M",
"Q",
"H"
],
"description": "QR error correction level: L 7%, M 15% (default), Q 25%, H 30%"
},
"margin": {
"description": "Quiet zone in modules, 0-16",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"modules": {
"description": "Shape of the data modules (default square)",
"type": "string",
"enum": [
"square",
"rounded",
"dot",
"row",
"column"
]
},
"eyeFrame": {
"description": "Outer ring of the three corner markers",
"type": "string",
"enum": [
"square",
"rounded",
"circle"
]
},
"eyeBall": {
"description": "Centre of the corner markers",
"type": "string",
"enum": [
"square",
"rounded",
"circle"
]
},
"eyeColor": {
"description": "Colour of the corner markers; defaults to dark",
"type": "string"
},
"image": {
"description": "A picture in the code. mode \"logo\": in the middle (error correction becomes H; size is its side as a share of the code, 0.1-0.3, default 0.22). mode \"halftone\": a photo behind the code, drawn as dots over it. data is a data URL (data:image/png;base64,... png, jpeg, webp or gif, up to 2 MB). To keep the current picture while changing other fields, pass its imageId instead of data.",
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"logo",
"halftone"
]
},
"data": {
"description": "A new picture, as a data URL",
"type": "string"
},
"imageId": {
"description": "Keep the picture the link already has (its qrStyle.image.imageId)",
"type": "string"
},
"size": {
"type": "number"
}
},
"required": [
"mode"
]
}
},
"description": "Default look of this link's QR image (free): colours, module and corner-marker shapes, and an optional picture. Styled codes need dark on light with at least 3:1 contrast. The whole style is replaced on update."
},
"groupIds": {
"type": "array",
"items": {
"type": "string"
},
"description": "Ids of groups (from create_group/list_groups) this link belongs to, up to 20"
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Stable id, shown on visits; generated if omitted. Keep it when editing a rule",
"type": "string"
},
"name": {
"type": "string"
},
"enabled": {
"description": "Default true; false keeps the rule but skips it",
"type": "boolean"
},
"when": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {},
"description": "The condition, e.g. {\"field\":\"os\",\"op\":\"eq\",\"value\":\"ios\"}"
},
"targetUrl": {
"type": "string",
"description": "Absolute http(s) destination when this rule matches"
}
},
"required": [
"when",
"targetUrl"
]
},
"description": "Redirect rules, evaluated in order on every visit; the first enabled rule whose \"when\" matches sends the visitor to its targetUrl, otherwise the link's targetUrl is used. A condition is either a test {field, op, value} or a combination {all: [...]}, {any: [...]}, {not: {...}}. Fields and their ops: os (ios|android|windows|macos|linux|chromeos|other), device (mobile|tablet|desktop|bot), browser (safari|chrome|firefox|edge|samsung|opera|in_app|other), source (qr|direct|bot): eq, neq, in, not_in. language (Accept-Language primary tag; \"pt\" also matches \"pt-BR\"): eq, neq, in, not_in, exists. country (ISO 3166-1 alpha-2, e.g. \"GB\", geolocated by the edge on every host): eq, neq, in, not_in. An unknown or absent value fails eq/in and passes neq/not_in. referrer (host, e.g. instagram.com) and query (needs \"key\", the parameter name): eq, neq, in, not_in, contains, starts_with, ends_with, exists. time (ISO timestamp): before, after. weekday (sun..sat, UTC): eq, neq, in, not_in. hour (0-23 UTC): eq, neq, in, not_in, gte, lte. in/not_in take an array. Text compares case-insensitively. Up to 20 rules, 20 conditions per rule. Example app-store split: [{\"name\":\"iOS\",\"when\":{\"field\":\"os\",\"op\":\"eq\",\"value\":\"ios\"},\"targetUrl\":\"https://apps.apple.com/app/id123\"},{\"name\":\"Android\",\"when\":{\"field\":\"os\",\"op\":\"eq\",\"value\":\"android\"},\"targetUrl\":\"https://play.google.com/store/apps/details?id=com.example\"}]"
}
},
"required": [
"targetUrl"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}