{"openapi":"3.1.0","info":{"title":"Zebra API","version":"1","description":"Public REST API for Zebra. Use bearer API keys to manage spaces, links, collections, and short domains."},"servers":[{"url":"https://app.zeblink.io","description":"API host"}],"externalDocs":{"url":"https://zeblink.io/docs","description":"Browsable Zebra API reference"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"zeb_<ulid>","description":"API keys act as their owning user. A key can be limited to selected spaces and to per-resource read/write scopes; its effective authority is always the intersection of the key's scope and the owner's own role in the target space. Provision via the dashboard; pass as `Authorization: Bearer zeb_…`. Keys require a plan with API access; without one, every call returns 402 `API_ACCESS_REQUIRED`."}},"schemas":{"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code. Stable across versions; safe to switch on.","example":"UNAUTHORIZED"},"message":{"type":"string","description":"Human-readable explanation. Subject to change.","example":"Missing or invalid API key."},"details":{"type":"object","additionalProperties":{},"description":"Optional structured context — field paths, retry-after seconds, etc."}},"required":["code","message"]}},"required":["error"]},"CreateLinkInput":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The destination URL the short link redirects to."},"path":{"type":"string","maxLength":128,"description":"Custom short-link path. Omit to auto-allocate one, which is the default and the right choice for most links. When set, it is an address rather than a summary: the bare word someone could repeat from memory and type without looking, such as `heineken` or `launch`. What the link is for belongs in `title`, not here. The maximum length is a storage bound, not a target, and short paths are worth more than descriptive ones."},"candidates":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":3,"description":"Ranked alternatives to `path` — up to 3 names, best first (set `path` or `candidates`, never both). The first that is valid and free becomes the link's path, decided in the same transaction as the create; `choice` in the response says which won (1 = first). When every candidate is taken or invalid, the create fails with each name's reason. Same naming rules as `path`: bare address words, not summaries."},"namespace":{"type":"string","maxLength":128,"description":"Namespace prefix for auto-allocated paths (e.g. `promo` yields `promo/x7k…`). Ignored when `path` is set."},"title":{"type":"string","maxLength":200,"description":"Display title for dashboards and lists."},"description":{"type":["string","null"],"maxLength":2000,"description":"User-authored description (distinct from the scraped page metadata). `null` clears it."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Normally left out — Zebra fetches it from the destination in the background shortly after creation. Supply it only to override; a supplied value is never overwritten by the background fetch."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false}],"description":"Where a visitor goes while the link is off. Omit to inherit the domain default, then the system default. `target_root` redirects to the destination's root domain; `url` to an explicit URL."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"When the link goes live (ISO 8601 timestamp or epoch ms). Before this instant the link is off and visitors get its fallback (or the countdown page). `null` clears it; omit to leave unchanged."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"When the link turns off (ISO 8601 timestamp or epoch ms). After this instant visitors get the link's fallback. Must be after `activatesAt` when both are set. `null` clears it; omit to leave unchanged."},"scheduleTimezone":{"type":["string","null"],"maxLength":64,"description":"IANA timezone (e.g. `Europe/Copenhagen`) used only to display the schedule in the picker. The instants above are absolute and decide liveness on their own."},"showCountdownPage":{"type":["boolean","null"],"description":"Show visitors a countdown page (HTTP 200) instead of the fallback while the link is not yet live. Requires `activatesAt`."},"domain":{"type":"string","minLength":1,"maxLength":253,"description":"Short domain to create the link on: a hostname or `dom_…` id from `GET …/domains`. Omit to use the space's default domain."},"collection":{"type":"string","minLength":1,"maxLength":200,"description":"Collection to add the link to: a `col_…` id or exact collection name (duplicate names require the id)."}},"required":["targetUrl"],"additionalProperties":false},"LinkFilter":{"type":"object","properties":{"query":{"type":"string","maxLength":200,"description":"Free text matched against each link's short path, title, and destination URL."},"status":{"type":"string","enum":["active","inactive"],"description":"active = live right now; inactive = off (manually or by schedule). Schedule-aware."},"created":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Creation-time window: within the last 1h, 24h, 7d, or 30d."},"edited":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-edit window (1h|24h|7d|30d). Creation counts as the initial edit."},"createdVia":{"type":"string","enum":["web","import","chat","api","mcp"],"description":"How the link was created: web, import, chat, api, or mcp."},"hasCollection":{"type":"boolean","description":"true = in at least one collection; false = uncollected."},"schedule":{"type":"string","enum":["upcoming","completed"],"description":"upcoming = has an activation/deactivation still to fire; completed = schedule fully in the past. Unscheduled links match neither."},"attribution":{"type":"string","enum":["utm","signals","any"],"description":"Which attribution the link CARRIES: utm = a utm_* param on its destination URL; signals = a QR code carries signals; any = carries either (spoken to a user as \"Either\")."},"targetHost":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"Where the link POINTS, its destination host (e.g. cnn.com), as hostnames. A leading `www.` is ignored on both sides, so cnn.com matches www.cnn.com — pass the bare host, never both spellings. User-facing word: \"destination\" (never say \"target host\" to a user)."},"shortDomain":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"The link's OWN domain (its short-link host, e.g. zbrah.link) as hostnames. User-facing word: \"domain\" / \"short domain\"."},"clicks":{"type":"object","properties":{"op":{"type":"string","enum":["greaterThan","lessThan"]},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false,"description":"Total-click threshold: {op: greaterThan|lessThan, value: <whole number>}, e.g. {op: greaterThan, value: 100} for more than 100 clicks."},"uniqueClicks":{"type":"object","properties":{"op":{"type":"string","enum":["greaterThan","lessThan"]},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false,"description":"Unique-visitor (distinct) threshold, same shape as clicks."},"clicked":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-click recency window (1h|24h|7d|30d). Links never clicked match nothing."},"negate":{"type":"array","items":{"type":"string","enum":["query","status","created","edited","schedule","createdVia","hasCollection","attribution","clicks","uniqueClicks","clicked","shortDomain","targetHost"]},"description":"Filter names to INVERT, each still AND-combined. e.g. status:'active' + negate:['status'] means 'not active'; clicked:'30d' + negate:['clicked'] means 'not clicked in the last 30 days'."}},"additionalProperties":false,"description":"Link filter. All fields optional; dimensions AND-combine, arrays OR within a dimension. `shortDomain` is the link's own domain (say \"domain\"); `targetHost` is where it points (say \"destination\"). `negate` inverts the named structured dimensions."},"QueryAnalyticsInput":{"type":"object","properties":{"groupBy":{"type":"string","enum":["country","region","city","browser","os","deviceType","referrerDomain","fromQr","shortDomain","isBot","botType","botName","day","link"],"description":"Break the result down by this dimension (one row per value); omit for a single total. `day` is a per-day time series."},"measure":{"type":"string","enum":["clicks","uniqueClicks"],"description":"What to count: total clicks (default) or unique visitors."},"range":{"type":"string","enum":["15m","1h","1d","7d","30d","all","custom"],"description":"Time window: all (all-time, the default), 7d, 30d, 1d (last 24h), 1h, 15m, or custom (then set from/to). Use a rolling window like 7d for 'this week' / 30d for 'last 30 days'."},"from":{"type":"string","description":"Custom window start as an ISO date or date-time. Only with range=custom."},"to":{"type":"string","description":"Custom window end as an ISO date or date-time. Only with range=custom."},"limit":{"type":"integer","minimum":1,"maximum":1000,"description":"Max breakdown rows (group-by only; default 100)."},"query":{"type":"string","maxLength":200,"description":"Free text matched against each link's short path, title, and destination URL."},"status":{"type":"string","enum":["active","inactive"],"description":"active = live right now; inactive = off (manually or by schedule). Schedule-aware."},"created":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Creation-time window: within the last 1h, 24h, 7d, or 30d."},"edited":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-edit window (1h|24h|7d|30d). Creation counts as the initial edit."},"createdVia":{"type":"string","enum":["web","import","chat","api","mcp"],"description":"How the link was created: web, import, chat, api, or mcp."},"hasCollection":{"type":"boolean","description":"true = in at least one collection; false = uncollected."},"schedule":{"type":"string","enum":["upcoming","completed"],"description":"upcoming = has an activation/deactivation still to fire; completed = schedule fully in the past. Unscheduled links match neither."},"attribution":{"type":"string","enum":["utm","signals","any"],"description":"Which attribution the link CARRIES: utm = a utm_* param on its destination URL; signals = a QR code carries signals; any = carries either (spoken to a user as \"Either\")."},"targetHost":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"Where the link POINTS, its destination host (e.g. cnn.com), as hostnames. A leading `www.` is ignored on both sides, so cnn.com matches www.cnn.com — pass the bare host, never both spellings. User-facing word: \"destination\" (never say \"target host\" to a user)."},"collectionId":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Scope to one specific collection (analytics-only). Mutually exclusive with the object-attribute filters and with linkId."},"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Scope to one specific link by its id (analytics-only) — the click counterpart to opening that link's dashboard. Mutually exclusive with the object-attribute filters and with collectionId. Click dimensions (country, browser, …) still apply on top."},"negate":{"type":"array","items":{"type":"string","enum":["status","created","edited","createdVia","hasCollection","schedule","attribution","targetHost"]},"description":"Object-scope dimensions to invert, e.g. [\"status\"] for clicks from links that are NOT active. Free text is not negatable."},"country":{"type":"array","items":{"type":"string","minLength":1},"maxItems":60,"description":"ISO country codes of the click (e.g. US, GB)."},"continents":{"type":"array","items":{"type":"string","enum":["europe","africa","asia","north-america","south-america","oceania","antarctica"]},"maxItems":7,"description":"Named continent groupings; expand to their countries."},"region":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"Region / state of the click."},"city":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"City of the click."},"browser":{"type":"array","items":{"type":"string","minLength":1},"maxItems":30,"description":"Browser name (e.g. Chrome, Safari)."},"os":{"type":"array","items":{"type":"string","minLength":1},"maxItems":30,"description":"Operating system (e.g. iOS, Windows)."},"deviceType":{"type":"array","items":{"type":"string","minLength":1},"maxItems":10,"description":"Device type (e.g. mobile, desktop, tablet)."},"referrerDomain":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"Referring domain of the click."},"shortDomain":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"The link's own short-domain host(s) the click came through, as hostnames."},"fromQr":{"type":"boolean","description":"true = QR scans only; false = ordinary (non-QR) clicks only."},"isBot":{"type":"boolean","description":"true = automated traffic only; false = humans only."},"botType":{"type":"array","items":{"type":"string","minLength":1},"maxItems":15,"description":"Traffic class (ai_assistant, crawler, fetcher, …)."},"botName":{"type":"array","items":{"type":"string","minLength":1},"maxItems":30,"description":"Bot product name (e.g. \"GPTBot\")."},"timeZone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone (e.g. `Europe/Copenhagen`) for `day` bucketing and custom `from`/`to` bounds. Default: UTC."}},"additionalProperties":false,"description":"Analytics query, two halves. Object SCOPE — WHICH links to count clicks for — uses the same vocabulary as link search: `status`, `created`, `edited`, `createdVia`, `hasCollection`, `schedule`, `attribution`, `targetHost`, `query`, plus the identity scopes `linkId` / `collectionId` (one link OR one collection OR attributes, never combined) and `negate` (invert named scope dims). Click MEASUREMENT — `country`/`continents`/`region`/`city`, `browser`/`os`/`deviceType`, `referrerDomain`, `fromQr`, bot dims — filters the clicks. `groupBy` returns a breakdown (one row per value), `measure` counts clicks or uniqueClicks, `range` sets the window (`day` buckets and custom `from`/`to` resolve in `timeZone`, default UTC). All fields optional; an empty body is whole-space all-time totals."},"UpdateLinkInput":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"New destination URL."},"title":{"type":["string","null"],"maxLength":200,"description":"Display title. `null` clears it."},"description":{"type":["string","null"],"maxLength":2000,"description":"User-authored description (distinct from the scraped page metadata). `null` clears it."},"isActive":{"type":"boolean","description":"Master on/off switch. A link is live only while `isActive` is true AND inside its schedule window (if one is set)."},"path":{"type":"string","maxLength":128,"description":"Move the link to a new short path. The old short URL stops resolving immediately — anything already shared or printed with it breaks."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Replaces the stored value; the background fetch never overwrites what you set."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes while the link is off. `null` restores inheritance (domain default, then system default)."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"When the link goes live (ISO 8601 timestamp or epoch ms). Before this instant the link is off and visitors get its fallback (or the countdown page). `null` clears it; omit to leave unchanged."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"When the link turns off (ISO 8601 timestamp or epoch ms). After this instant visitors get the link's fallback. Must be after `activatesAt` when both are set. `null` clears it; omit to leave unchanged."},"scheduleTimezone":{"type":["string","null"],"maxLength":64,"description":"IANA timezone (e.g. `Europe/Copenhagen`) used only to display the schedule in the picker. The instants above are absolute and decide liveness on their own."},"showCountdownPage":{"type":["boolean","null"],"description":"Show visitors a countdown page (HTTP 200) instead of the fallback while the link is not yet live. Requires `activatesAt`."}},"additionalProperties":false},"BulkCreateLinksInput":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The destination URL the short link redirects to."},"path":{"type":"string","maxLength":128,"description":"Custom short-link path. Omit to auto-allocate one, which is the default and the right choice for most links. When set, it is an address rather than a summary: the bare word someone could repeat from memory and type without looking, such as `heineken` or `launch`. What the link is for belongs in `title`, not here. The maximum length is a storage bound, not a target, and short paths are worth more than descriptive ones."},"candidates":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":3,"description":"Ranked alternatives to `path` — up to 3 names, best first (set `path` or `candidates`, never both). The first that is valid and free becomes the link's path, decided in the same transaction as the create; `choice` in the response says which won (1 = first). When every candidate is taken or invalid, the create fails with each name's reason. Same naming rules as `path`: bare address words, not summaries."},"namespace":{"type":"string","maxLength":128,"description":"Namespace prefix for auto-allocated paths (e.g. `promo` yields `promo/x7k…`). Ignored when `path` is set."},"title":{"type":"string","maxLength":200,"description":"Display title for dashboards and lists."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Normally left out — Zebra fetches it from the destination in the background shortly after creation. Supply it only to override; a supplied value is never overwritten by the background fetch."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false}],"description":"Where a visitor goes while the link is off. Omit to inherit the domain default, then the system default. `target_root` redirects to the destination's root domain; `url` to an explicit URL."},"domain":{"type":"string","minLength":1,"maxLength":253,"description":"Short domain to create the link on: a hostname or `dom_…` id from `GET …/domains`. Omit to use the space's default domain."}},"required":["targetUrl"],"additionalProperties":false},"minItems":1,"maxItems":250},"collection":{"type":"string","minLength":1,"maxLength":200}},"required":["items"],"additionalProperties":false},"BulkUpdateLinksInput":{"type":"object","properties":{"updates":{"type":"array","items":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"New destination URL."},"title":{"type":["string","null"],"maxLength":200,"description":"Display title. `null` clears it."},"description":{"type":["string","null"],"maxLength":2000,"description":"User-authored description (distinct from the scraped page metadata). `null` clears it."},"isActive":{"type":"boolean","description":"Master on/off switch. A link is live only while `isActive` is true AND inside its schedule window (if one is set)."},"path":{"type":"string","maxLength":128,"description":"Move the link to a new short path. The old short URL stops resolving immediately — anything already shared or printed with it breaks."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Replaces the stored value; the background fetch never overwrites what you set."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes while the link is off. `null` restores inheritance (domain default, then system default)."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"When the link goes live (ISO 8601 timestamp or epoch ms). Before this instant the link is off and visitors get its fallback (or the countdown page). `null` clears it; omit to leave unchanged."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"When the link turns off (ISO 8601 timestamp or epoch ms). After this instant visitors get the link's fallback. Must be after `activatesAt` when both are set. `null` clears it; omit to leave unchanged."},"scheduleTimezone":{"type":["string","null"],"maxLength":64,"description":"IANA timezone (e.g. `Europe/Copenhagen`) used only to display the schedule in the picker. The instants above are absolute and decide liveness on their own."},"showCountdownPage":{"type":["boolean","null"],"description":"Show visitors a countdown page (HTTP 200) instead of the fallback while the link is not yet live. Requires `activatesAt`."},"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},"required":["linkId"],"additionalProperties":false},"minItems":1,"maxItems":500}},"required":["updates"],"additionalProperties":false},"BulkDeleteLinksInput":{"type":"object","properties":{"linkIds":{"type":"array","items":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"minItems":1,"maxItems":500}},"required":["linkIds"],"additionalProperties":false},"CreateQrVariantInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"style":{"type":["object","null"],"properties":{"backgroundShape":{"type":"string","enum":["square","circle"]},"dotType":{"type":"string","enum":["dot","random-dot","rounded","extra-rounded","vertical-line","horizontal-line","square","small-square","diamond","wave","hexagon","circuit","zebra-horizontal","zebra-vertical","blocks-horizontal","blocks-vertical","blobs","soft"]},"cornerSquareType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","center-circle"]},"cornerDotType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","diamond","hexagon","star","heart"]},"dotsColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerSquareColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerDotColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"dotsGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerSquareGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerDotGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"backgroundGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"branding":{"type":"object","properties":{"mode":{"type":"string","enum":["favicon","upload"]},"size":{"type":"string","enum":["small","large"]},"imageRef":{"type":"string","maxLength":2048,"format":"uri"},"mat":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"string","enum":["none"]}],"description":"Backing behind the mark: a hex color, or \"none\" so the code's background shows through. Omitted = #ffffff."}},"required":["mode","size"],"additionalProperties":false},"errorCorrectionLevel":{"type":"string","enum":["M","Q","H"]}},"additionalProperties":false},"signals":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":120}}},"required":["name"],"additionalProperties":false},"UpdateQrVariantInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"style":{"type":["object","null"],"properties":{"backgroundShape":{"type":"string","enum":["square","circle"]},"dotType":{"type":"string","enum":["dot","random-dot","rounded","extra-rounded","vertical-line","horizontal-line","square","small-square","diamond","wave","hexagon","circuit","zebra-horizontal","zebra-vertical","blocks-horizontal","blocks-vertical","blobs","soft"]},"cornerSquareType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","center-circle"]},"cornerDotType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","diamond","hexagon","star","heart"]},"dotsColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerSquareColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerDotColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"dotsGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerSquareGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerDotGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"backgroundGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"branding":{"type":"object","properties":{"mode":{"type":"string","enum":["favicon","upload"]},"size":{"type":"string","enum":["small","large"]},"imageRef":{"type":"string","maxLength":2048,"format":"uri"},"mat":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"string","enum":["none"]}],"description":"Backing behind the mark: a hex color, or \"none\" so the code's background shows through. Omitted = #ffffff."}},"required":["mode","size"],"additionalProperties":false},"errorCorrectionLevel":{"type":"string","enum":["M","Q","H"]}},"additionalProperties":false},"signals":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":120}},"archived":{"type":"boolean"}},"additionalProperties":false},"QrExportInput":{"type":"object","properties":{"variant":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"CreateCollectionInput":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["smart"]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"filter":{"type":"object","properties":{"query":{"type":"string","maxLength":200,"description":"Free text matched against each link's short path, title, and destination URL."},"status":{"type":"string","enum":["active","inactive"],"description":"active = live right now; inactive = off (manually or by schedule). Schedule-aware."},"created":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Creation-time window: within the last 1h, 24h, 7d, or 30d."},"edited":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-edit window (1h|24h|7d|30d). Creation counts as the initial edit."},"createdVia":{"type":"string","enum":["web","import","chat","api","mcp"],"description":"How the link was created: web, import, chat, api, or mcp."},"hasCollection":{"type":"boolean","description":"true = in at least one collection; false = uncollected."},"schedule":{"type":"string","enum":["upcoming","completed"],"description":"upcoming = has an activation/deactivation still to fire; completed = schedule fully in the past. Unscheduled links match neither."},"attribution":{"type":"string","enum":["utm","signals","any"],"description":"Which attribution the link CARRIES: utm = a utm_* param on its destination URL; signals = a QR code carries signals; any = carries either (spoken to a user as \"Either\")."},"targetHost":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"Where the link POINTS, its destination host (e.g. cnn.com), as hostnames. A leading `www.` is ignored on both sides, so cnn.com matches www.cnn.com — pass the bare host, never both spellings. User-facing word: \"destination\" (never say \"target host\" to a user)."},"shortDomain":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"The link's OWN domain (its short-link host, e.g. zbrah.link) as hostnames. User-facing word: \"domain\" / \"short domain\"."},"clicks":{"type":"object","properties":{"op":{"type":"string","enum":["greaterThan","lessThan"]},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false,"description":"Total-click threshold: {op: greaterThan|lessThan, value: <whole number>}, e.g. {op: greaterThan, value: 100} for more than 100 clicks."},"uniqueClicks":{"type":"object","properties":{"op":{"type":"string","enum":["greaterThan","lessThan"]},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false,"description":"Unique-visitor (distinct) threshold, same shape as clicks."},"clicked":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-click recency window (1h|24h|7d|30d). Links never clicked match nothing."},"negate":{"type":"array","items":{"type":"string","enum":["query","status","created","edited","schedule","createdVia","hasCollection","attribution","clicks","uniqueClicks","clicked","shortDomain","targetHost"]},"description":"Filter names to INVERT, each still AND-combined. e.g. status:'active' + negate:['status'] means 'not active'; clicked:'30d' + negate:['clicked'] means 'not clicked in the last 30 days'."}},"additionalProperties":false}},"required":["type","name","filter"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["manual"]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["name"],"additionalProperties":false}]},"BulkCreateCollectionsInput":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["name"],"additionalProperties":false},"minItems":1,"maxItems":500}},"required":["items"],"additionalProperties":false},"UpdateCollectionInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000}},"additionalProperties":false},"HealthResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"api":{"type":"string","enum":["v1"]},"render":{"type":"string","enum":["ok"],"description":"Present when `deep=1` — the image rasterizer rendered."}},"required":["ok","api"]},"MeResponse":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]}},"required":["id","email","name"]},"accessibleSpaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","contributor","viewer"],"description":"The key owner's role in the space. `contributor` and `viewer` are collection-scoped roles: reads everywhere, writes only inside granted collections (viewer: none)."}},"required":["id","name","role"]},"description":"Spaces this API key can act on. An all-scope key returns every space the user is a member of; a selected-scope key returns only the allowlisted spaces."},"apiKey":{"type":"object","properties":{"id":{"type":"string","pattern":"^ak_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"prefix":{"type":"string","description":"First ~8 characters of the key, safe to log."}},"required":["id","prefix"]}},"required":["user","accessibleSpaces","apiKey"]},"ListDomainsResponse":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}}},"required":["domains"]},"Domain":{"type":"object","properties":{"id":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"hostname":{"type":"string","description":"Domain hostname for creating short links."},"kind":{"type":"string","enum":["custom","branded","platform"],"description":"What the domain is: `custom` — a domain the account owns and connected; `branded` — a host we operate carrying the account's own name, usable by this account alone; `platform` — a host we operate and share across accounts."},"tier":{"type":["string","null"],"enum":["free","premium","agency",null],"description":"Access tier for shared platform domains; `null` for custom and branded domains."}},"required":["id","hostname","kind","tier"]},"CreateLinkResponse":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"},"source":{"type":"string","enum":["auto","custom"],"description":"`custom` when the caller supplied `path`; `auto` when the path was allocated."},"targetReachable":{"type":["boolean","null"],"description":"Advisory reachability of `targetUrl`: `true` if it resolved to a live page, `false` if unreachable, `null` when not checked. Only probed when the request passes `?verify=true`. Never blocks creation — a link is always returned. (401/403 count as reachable.)"}},"required":["link","source","targetReachable"]},"Link":{"type":"object","properties":{"id":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"shortDomainId":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"hostname":{"type":"string","description":"Domain hostname for this short link."},"path":{"type":"string","description":"Path component for this short link."},"shortUrl":{"type":"string","format":"uri","description":"Canonical short link URL for display, copy, and navigation."},"targetUrl":{"type":"string","format":"uri"},"title":{"type":["string","null"]},"description":{"type":["string","null"],"description":"User-authored description (not the scraped page metadata)."},"isActive":{"type":"boolean","description":"Effective live status: the stored on/off switch combined with the schedule window, evaluated at request time — matches what the redirect edge serves and what the `?status` filter selects."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes when the link is off. `null` inherits the domain default, then the system default (a branded inactive page). `target_root` redirects to the destination's root domain; `url` redirects to an explicit URL."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled go-live instant; `null` = no opening edge. Set via the same field on create/update."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled turn-off instant; `null` = no closing edge."},"scheduleTimezone":{"type":["string","null"],"description":"IANA timezone the schedule was authored in — display only; the instants above decide liveness."},"showCountdownPage":{"type":["boolean","null"],"description":"Whether a not-yet-live link shows the visitor-facing countdown page instead of its fallback."},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":["string","null"],"enum":["web","import","api","chat","mcp",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Last edit; `null` = never edited since creation."},"clicks":{"type":"integer","description":"Lifetime click total. Present on list rows when the request used a click-based `sort` or `include=clicks`."},"lastClickedAt":{"type":["string","null"],"format":"date-time","description":"Most recent click; `null` = never clicked. Present alongside `clicks`."}},"required":["id","spaceId","shortDomainId","hostname","path","shortUrl","targetUrl","title","description","isActive","fallback","activatesAt","deactivatesAt","scheduleTimezone","showCountdownPage","createdBy","createdVia","createdAt","updatedAt"]},"ListLinksResponse":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/ListLinkRow"}},"nextCursor":{"type":["string","null"],"description":"Opaque cursor for the next page. `null` when there are no more pages."}},"required":["links","nextCursor"]},"ListLinkRow":{"type":"object","properties":{"id":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"shortDomainId":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"hostname":{"type":"string","description":"Domain hostname for this short link."},"path":{"type":"string","description":"Path component for this short link."},"shortUrl":{"type":"string","format":"uri","description":"Canonical short link URL for display, copy, and navigation."},"targetUrl":{"type":"string","format":"uri"},"title":{"type":["string","null"]},"description":{"type":["string","null"],"description":"User-authored description (not the scraped page metadata)."},"isActive":{"type":"boolean","description":"Effective live status: the stored on/off switch combined with the schedule window, evaluated at request time — matches what the redirect edge serves and what the `?status` filter selects."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes when the link is off. `null` inherits the domain default, then the system default (a branded inactive page). `target_root` redirects to the destination's root domain; `url` redirects to an explicit URL."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled go-live instant; `null` = no opening edge. Set via the same field on create/update."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled turn-off instant; `null` = no closing edge."},"scheduleTimezone":{"type":["string","null"],"description":"IANA timezone the schedule was authored in — display only; the instants above decide liveness."},"showCountdownPage":{"type":["boolean","null"],"description":"Whether a not-yet-live link shows the visitor-facing countdown page instead of its fallback."},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":["string","null"],"enum":["web","import","api","chat","mcp",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Last edit; `null` = never edited since creation."},"clicks":{"type":"integer","description":"Lifetime click total. Present on list rows when the request used a click-based `sort` or `include=clicks`."},"lastClickedAt":{"type":["string","null"],"format":"date-time","description":"Most recent click; `null` = never clicked. Present alongside `clicks`."}},"required":["id","spaceId","shortDomainId","hostname","path","shortUrl","targetUrl","title","description","isActive","fallback","activatesAt","deactivatesAt","scheduleTimezone","showCountdownPage","createdBy","createdVia","createdAt","updatedAt"]},"QueryLinksResponse":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"total":{"type":"integer","minimum":0,"description":"Total links matching the filter (uncapped; `links` is the page)."}},"required":["links","total"]},"QueryLinksInput":{"allOf":[{"$ref":"#/components/schemas/LinkFilter"},{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"description":"Max links to return (1–100, default 20)."},"offset":{"type":"integer","minimum":0,"description":"Result offset for paging (default 0)."}},"additionalProperties":false}],"description":"Link filter. All fields optional; dimensions AND-combine, arrays OR within a dimension. `shortDomain` is the link's own domain (say \"domain\"); `targetHost` is where it points (say \"destination\"). `negate` inverts the named structured dimensions."},"QueryAnalyticsResponse":{"type":"object","properties":{"configured":{"type":"boolean","description":"false = the analytics backend isn't configured for this space; `rows` is empty."},"tooLarge":{"type":"boolean","description":"true = the link scope was too large to resolve; relay the message, never report zero."},"veiled":{"type":"boolean","description":"true = the query narrowed by a location or referrer value that too few distinct visitors share, so no number is returned for it and `rows` is empty. Relay `message`; never report zero. The same query answers normally once more visitors share the value."},"range":{"type":"string","description":"The resolved time window."},"groupBy":{"type":["string","null"],"description":"The breakdown dimension, or null for a single total."},"measure":{"type":["string","null"]},"message":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"],"description":"The dimension value (or calendar day) for a breakdown row; null for a single total or a veiled row. On the `referrerDomain` dimension two keys are special, matching the dashboard's source taxonomy: `\"\"` is direct traffic (no referrer), and `\"QR Code\"` is QR scans — a scan is its own source, never blended into Direct. Both are filterable values."},"label":{"type":"string","description":"Human-readable name for `key` on the dimensions whose key is an id (`shortDomain`, `link`) — a hostname or a short link. Absent on every other dimension, where the key is already readable, and on an id whose row no longer exists."},"disclosure":{"type":"string","enum":["clear","veiled"],"description":"How much this row discloses. `clear` is a real value. `veiled` means the value's NAME is withheld until enough distinct visitors share it: the row's `key` is null, its `clicks` are exact, and its `uniqueClicks` is absent (the visitor count is the disclosure evidence and is withheld with the name). The reveal is live — the moment the value has its crowd, the same query names it. Never present a veiled row as a named value or as zero. Only the location dimensions (`city`, `region`, `country`) and `referrerDomain` gate; the field is absent everywhere else (browser, OS, device, domains, links, days), which never gate."},"veilId":{"type":"string","description":"Stable opaque id carried by every gated row, veiled and clear — a keyed derivation, never the value itself. Within one queried resource (a link, a collection, or the whole space) the same value keeps the same id across reads and windows, so a row can be followed through its reveal; across resources the ids are deliberately unrelated."},"level":{"type":"string","enum":["region","country"],"description":"On a `veiled` geo row whose coarser rung has its own crowd: the rung `context` names. Absent otherwise."},"context":{"type":"string","description":"On a `veiled` geo row: the deepest coarser place that has its own crowd, e.g. \"Capital Region, DK\" or \"DK\" — honest context for a masked name. Absent when nothing coarser cleared."},"clicks":{"type":"integer","minimum":0},"uniqueClicks":{"type":"integer","minimum":0,"description":"Distinct visitors, counted as distinct observed networks (a keyed hash of a shortened IP address) — not people. Several people behind one office or carrier connection can merge into one visitor; one person on two networks counts twice. Where present, the count of these network identities is exact. ABSENT on a `veiled` row: the visitor count is the evidence the veil gates on and is withheld with the name — never read the absence as zero."}},"required":["key","clicks"]}}},"required":["configured","tooLarge","veiled","range","groupBy","measure","rows"]},"LookupLinkResponse":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]},"GetLinkResponse":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]},"UpdateLinkResponse":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"},"pathChanged":{"type":"boolean","description":"`true` when the patch contained a `path` that differed from the current value."}},"required":["link","pathChanged"]},"DeleteLinkResponse":{"type":"object","properties":{"deletedLinkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},"required":["deletedLinkId"]},"BulkCreateLinksResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkCreateRowResult"}}},"required":["results"]},"BulkCreateRowResult":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer"},"success":{"type":"boolean","enum":[true]},"link":{"type":"object","properties":{"id":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"shortDomainId":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"hostname":{"type":"string","description":"Domain hostname for this short link."},"path":{"type":"string","description":"Path component for this short link."},"shortUrl":{"type":"string","format":"uri","description":"Canonical short link URL for display, copy, and navigation."},"targetUrl":{"type":"string","format":"uri"},"title":{"type":["string","null"]},"description":{"type":["string","null"],"description":"User-authored description. Present on bulk-update rows; bulk-create rows don't carry one."},"isActive":{"type":"boolean","description":"The stored on/off switch as written. Unlike single-link reads, bulk rows do not fold the schedule window into this value."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}]},"activatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled go-live instant; `null` = no opening edge."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled turn-off instant; `null` = no closing edge."},"scheduleTimezone":{"type":["string","null"]},"showCountdownPage":{"type":["boolean","null"]},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":["string","null"],"enum":["web","import","api","chat","mcp",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","spaceId","shortDomainId","hostname","path","shortUrl","targetUrl","title","isActive","fallback","activatesAt","deactivatesAt","scheduleTimezone","showCountdownPage","createdBy","createdVia","createdAt","updatedAt"]},"source":{"type":"string","enum":["auto","custom"],"description":"`custom` if the row supplied `path`, else `auto`."}},"required":["index","success","link","source"]},{"type":"object","properties":{"index":{"type":"integer"},"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine code. Per-row on create: `INVALID_URL`, `URL_TOO_LONG`, `INVALID_FALLBACK`, `PATH_TAKEN`, `PATH_TOO_SHORT`, `PATH_TOO_DEEP`, `PATH_INVALID_FORMAT`, `DOMAIN_NOT_FOUND`, `DOMAIN_NOT_ACCESSIBLE`, `DOMAIN_REQUIRES_UPGRADE`. Per-row on update: every code the single-link PATCH can return (`LINK_NOT_FOUND`, `INVALID_URL`, `URL_TOO_LONG`, `INVALID_FALLBACK`, `INVALID_SCHEDULE`, `COUNTDOWN_REQUIRES_ACTIVATION`, `PATH_*`, `COLLECTION_NOT_GRANTED`, `LINK_WRITE_FORBIDDEN`). Per-row on delete: `LINK_NOT_FOUND`, `LINK_DELETE_FORBIDDEN`. Request-wide failures (role, read-only plan, an unusable `collection`) reject the request with a single error envelope instead of per-row results."},"message":{"type":"string"},"details":{}},"required":["code","message"]},"targetUrl":{"type":"string","description":"The row's target URL, echoed so the caller can name the failed row."}},"required":["index","success","error"]}]},"BulkUpdateLinksResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkUpdateRowResult"}}},"required":["results"]},"BulkUpdateRowResult":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer"},"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"success":{"type":"boolean","enum":[true]},"link":{"type":"object","properties":{"id":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"shortDomainId":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"hostname":{"type":"string","description":"Domain hostname for this short link."},"path":{"type":"string","description":"Path component for this short link."},"shortUrl":{"type":"string","format":"uri","description":"Canonical short link URL for display, copy, and navigation."},"targetUrl":{"type":"string","format":"uri"},"title":{"type":["string","null"]},"description":{"type":["string","null"],"description":"User-authored description. Present on bulk-update rows; bulk-create rows don't carry one."},"isActive":{"type":"boolean","description":"The stored on/off switch as written. Unlike single-link reads, bulk rows do not fold the schedule window into this value."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}]},"activatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled go-live instant; `null` = no opening edge."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled turn-off instant; `null` = no closing edge."},"scheduleTimezone":{"type":["string","null"]},"showCountdownPage":{"type":["boolean","null"]},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":["string","null"],"enum":["web","import","api","chat","mcp",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","spaceId","shortDomainId","hostname","path","shortUrl","targetUrl","title","isActive","fallback","activatesAt","deactivatesAt","scheduleTimezone","showCountdownPage","createdBy","createdVia","createdAt","updatedAt"]},"pathChanged":{"type":"boolean"}},"required":["index","linkId","success","link","pathChanged"]},{"type":"object","properties":{"index":{"type":"integer"},"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine code. Per-row on create: `INVALID_URL`, `URL_TOO_LONG`, `INVALID_FALLBACK`, `PATH_TAKEN`, `PATH_TOO_SHORT`, `PATH_TOO_DEEP`, `PATH_INVALID_FORMAT`, `DOMAIN_NOT_FOUND`, `DOMAIN_NOT_ACCESSIBLE`, `DOMAIN_REQUIRES_UPGRADE`. Per-row on update: every code the single-link PATCH can return (`LINK_NOT_FOUND`, `INVALID_URL`, `URL_TOO_LONG`, `INVALID_FALLBACK`, `INVALID_SCHEDULE`, `COUNTDOWN_REQUIRES_ACTIVATION`, `PATH_*`, `COLLECTION_NOT_GRANTED`, `LINK_WRITE_FORBIDDEN`). Per-row on delete: `LINK_NOT_FOUND`, `LINK_DELETE_FORBIDDEN`. Request-wide failures (role, read-only plan, an unusable `collection`) reject the request with a single error envelope instead of per-row results."},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["index","linkId","success","error"]}]},"BulkDeleteLinksResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkDeleteRowResult"}}},"required":["results"]},"BulkDeleteRowResult":{"oneOf":[{"type":"object","properties":{"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"success":{"type":"boolean","enum":[true]}},"required":["linkId","success"]},{"type":"object","properties":{"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine code. Per-row on create: `INVALID_URL`, `URL_TOO_LONG`, `INVALID_FALLBACK`, `PATH_TAKEN`, `PATH_TOO_SHORT`, `PATH_TOO_DEEP`, `PATH_INVALID_FORMAT`, `DOMAIN_NOT_FOUND`, `DOMAIN_NOT_ACCESSIBLE`, `DOMAIN_REQUIRES_UPGRADE`. Per-row on update: every code the single-link PATCH can return (`LINK_NOT_FOUND`, `INVALID_URL`, `URL_TOO_LONG`, `INVALID_FALLBACK`, `INVALID_SCHEDULE`, `COUNTDOWN_REQUIRES_ACTIVATION`, `PATH_*`, `COLLECTION_NOT_GRANTED`, `LINK_WRITE_FORBIDDEN`). Per-row on delete: `LINK_NOT_FOUND`, `LINK_DELETE_FORBIDDEN`. Request-wide failures (role, read-only plan, an unusable `collection`) reject the request with a single error envelope instead of per-row results."},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["linkId","success","error"]}]},"ListQrVariantsResponse":{"type":"object","properties":{"qrVariants":{"type":"array","items":{"$ref":"#/components/schemas/QrVariant"}},"spaceDefaultStyle":{"allOf":[{"$ref":"#/components/schemas/QrVariantStyle"},{"description":"The space-wide default style — what a link with no saved variants renders. Null = the stock look."}]}},"required":["qrVariants","spaceDefaultStyle"]},"QrVariant":{"type":"object","properties":{"id":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"name":{"type":"string","maxLength":120},"style":{"$ref":"#/components/schemas/QrVariantStyle"},"effectiveStyle":{"type":["object","null"],"properties":{"backgroundShape":{"type":"string","enum":["square","circle"]},"dotType":{"type":"string","enum":["dot","random-dot","rounded","extra-rounded","vertical-line","horizontal-line","square","small-square","diamond","wave","hexagon","circuit","zebra-horizontal","zebra-vertical","blocks-horizontal","blocks-vertical","blobs","soft"]},"cornerSquareType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","center-circle"]},"cornerDotType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","diamond","hexagon","star","heart"]},"dotsColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerSquareColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerDotColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"dotsGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerSquareGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerDotGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"backgroundGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"branding":{"type":"object","properties":{"mode":{"type":"string","enum":["favicon","upload"]},"size":{"type":"string","enum":["small","large"]},"imageRef":{"type":"string","maxLength":2048,"format":"uri"},"mat":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"string","enum":["none"]}],"description":"Backing behind the mark: a hex color, or \"none\" so the code's background shows through. Omitted = #ffffff."}},"required":["mode","size"],"additionalProperties":false},"errorCorrectionLevel":{"type":"string","enum":["M","Q","H"]}},"additionalProperties":false,"description":"The style the code ACTUALLY renders with: the variant's own `style`, else the space default, else the stock look (null). Resolved server-side on reads, so it is present on the list response and omitted from create/update responses."},"signals":{"$ref":"#/components/schemas/QrSignals"},"imageUrls":{"$ref":"#/components/schemas/QrImageUrls"},"archivedAt":{"type":["string","null"],"format":"date-time","description":"Non-null when the variant is archived: its history stays readable, future scans of its prints attribute to nothing, and the prints keep redirecting. PATCH `archived` to flip."},"createdBy":{"type":["string","null"],"pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","linkId","name","style","signals","imageUrls","archivedAt","createdBy","createdAt","updatedAt"]},"QrVariantStyle":{"type":["object","null"],"properties":{"backgroundShape":{"type":"string","enum":["square","circle"]},"dotType":{"type":"string","enum":["dot","random-dot","rounded","extra-rounded","vertical-line","horizontal-line","square","small-square","diamond","wave","hexagon","circuit","zebra-horizontal","zebra-vertical","blocks-horizontal","blocks-vertical","blobs","soft"]},"cornerSquareType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","center-circle"]},"cornerDotType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","diamond","hexagon","star","heart"]},"dotsColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerSquareColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerDotColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"dotsGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerSquareGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerDotGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"backgroundGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"branding":{"type":"object","properties":{"mode":{"type":"string","enum":["favicon","upload"]},"size":{"type":"string","enum":["small","large"]},"imageRef":{"type":"string","maxLength":2048,"format":"uri"},"mat":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"string","enum":["none"]}],"description":"Backing behind the mark: a hex color, or \"none\" so the code's background shows through. Omitted = #ffffff."}},"required":["mode","size"],"additionalProperties":false},"errorCorrectionLevel":{"type":"string","enum":["M","Q","H"]}},"additionalProperties":false,"description":"The variant's OWN saved style, or null when it inherits the space default. This is the editing value; render from `effectiveStyle`."},"QrSignals":{"type":"object","additionalProperties":{"type":"string"},"description":"The variant's signal map (key → value) — free-form human strings such as `City: Nashville`. Signals never ride the QR payload: the printed code carries identity only, and each scan records the variant's values as they stand at scan time — editing a value applies to future scans without reprinting. Signals must describe placements and campaigns (a menu, a poster, a table), never a person: a value that identifies one recipient turns scan analytics into a read receipt, which is against the product's privacy posture and, for EU audiences, likely your own GDPR obligations. Signal KEYS are link-level columns: every live code on a link answers the same keys with its own values. A write that would leave one code's keys out of step is rejected (`SIGNALS_UNBALANCED`), so this map must use exactly the link's existing keys; add or remove keys for every code together (the dashboard's QR studio does this in one save). A link's first live code defines the key set."},"QrImageUrls":{"type":["object","null"],"properties":{"png":{"type":"string","format":"uri"},"svg":{"type":"string","format":"uri"}},"required":["png","svg"],"description":"The design's stable public image URLs; null until first materialization (e.g. no file storage configured). POST the link's `/qr/export` endpoint to materialize on demand."},"CreateQrVariantResponse":{"type":"object","properties":{"qrVariant":{"$ref":"#/components/schemas/QrVariant"}},"required":["qrVariant"]},"GetQrVariantResponse":{"type":"object","properties":{"qrVariant":{"$ref":"#/components/schemas/QrVariant"}},"required":["qrVariant"]},"UpdateQrVariantResponse":{"type":"object","properties":{"qrVariant":{"$ref":"#/components/schemas/QrVariant"}},"required":["qrVariant"]},"DeleteQrVariantResponse":{"type":"object","properties":{"deletedQrVariantId":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"QR variant id (prefixed ULID)."}},"required":["deletedQrVariantId"]},"QrExportResponse":{"type":"object","properties":{"export":{"type":"object","properties":{"imageUrls":{"allOf":[{"$ref":"#/components/schemas/QrImageUrls"},{"description":"Stable public image URLs for the design — key-free, CDN-served, safe to embed in an <img> tag or hand to third parties. Saving the design rewrites the same files in place, so each URL always serves the latest saved look (CDN propagation: usually under a minute, up to a few minutes). For a copy frozen in time, download the file instead."}]},"variantId":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"The design behind the URLs. Always present: a link with no live variant mints its Default before the design resolves, so every export carries identity."},"variantName":{"type":["string","null"]}},"required":["imageUrls","variantId","variantName"]}},"required":["export"]},"CreateCollectionResponse":{"type":"object","properties":{"collection":{"$ref":"#/components/schemas/Collection"},"rulesSummary":{"type":"string","description":"Plain-language echo of the compiled membership. Present only for smart collections (e.g. \"Destination is any of cnn.com and Status is active\")."}},"required":["collection"]},"Collection":{"type":"object","properties":{"id":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["manual","smart"],"description":"Collection kind: `manual` (hand-picked membership) or `smart` (membership computed live from saved rules). The API creates both (POST with `type: \"smart\"` and a `filter`)."},"rules":{"type":["array","null"],"items":{},"description":"A smart collection's COMPILED rules: an opaque read-only mirror of the `filter` it was created with, not a shape to author or round-trip. `null` for manual collections. Rule editing is not supported over the API; recreate the collection or edit in the dashboard."},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":"string","enum":["web","import","api","chat","mcp"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","spaceId","name","description","type","rules","createdBy","createdVia","createdAt","updatedAt"]},"ListCollectionsResponse":{"type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/components/schemas/CollectionWithCount"}}},"required":["collections"]},"CollectionWithCount":{"allOf":[{"$ref":"#/components/schemas/Collection"},{"type":"object","properties":{"linkCount":{"type":"integer","minimum":0},"uniqueDomains":{"type":"array","items":{"type":"string"},"description":"Distinct destination sites among member links (root domains; subdomains of one site collapse), capped at a short display list."},"clicks":{"type":"integer","minimum":0,"description":"Total clicks across the collection's current members."},"summedUniqueClicks":{"type":"integer","minimum":0,"description":"Per-link unique visitors, summed. A visitor who clicked several member links counts once per link, so this can exceed the collection's true deduplicated unique count."}},"required":["linkCount","uniqueDomains","clicks","summedUniqueClicks"]}]},"BulkCreateCollectionsResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkCreateCollectionRowResult"}}},"required":["results"]},"BulkCreateCollectionRowResult":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer"},"success":{"type":"boolean","enum":[true]},"collection":{"type":"object","properties":{"id":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["manual"]},"rules":{"type":"null"},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":"string","enum":["web","import","api","chat","mcp"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","spaceId","name","description","type","rules","createdBy","createdVia","createdAt","updatedAt"]}},"required":["index","success","collection"]},{"type":"object","properties":{"index":{"type":"integer"},"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine code. The request body's own validation happens before any row is attempted (422), and request-wide failures (role, read-only plan, `TIER_FEATURE_REQUIRED`, `COLLECTION_LIMIT_REACHED`) reject the request with a single error envelope, so per-row errors are reserved for future row-level outcomes."},"message":{"type":"string"},"details":{}},"required":["code","message"]},"name":{"type":"string","description":"The row's requested name, echoed for failed rows."}},"required":["index","success","error"]}]},"CollectionWithCountResponse":{"type":"object","properties":{"id":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["manual","smart"],"description":"Collection kind: `manual` (hand-picked membership) or `smart` (membership computed live from saved rules). The API creates both."},"rules":{"type":["array","null"],"items":{},"description":"A smart collection's COMPILED rules: an opaque read-only mirror of the `filter` it was created with, not a shape to author or round-trip. `null` for manual collections."},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":"string","enum":["web","import","api","chat","mcp"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"linkCount":{"type":"integer","minimum":0},"uniqueDomains":{"type":"array","items":{"type":"string"},"description":"Distinct destination sites among member links (root domains; subdomains of one site collapse), capped at a short display list."},"clicks":{"type":"integer","minimum":0,"description":"Total clicks across the collection's current members."},"summedUniqueClicks":{"type":"integer","minimum":0,"description":"Per-link unique visitors, summed. A visitor who clicked several member links counts once per link, so this can exceed the collection's true deduplicated unique count."}},"required":["id","spaceId","name","description","type","rules","createdBy","createdVia","createdAt","updatedAt","linkCount","uniqueDomains","clicks","summedUniqueClicks"]},"DeleteCollectionResponse":{"type":"object","properties":{"deletedCollectionId":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},"required":["deletedCollectionId"]},"ListLinksInCollectionResponse":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/LinkInCollectionRow"}},"nextCursor":{"type":["string","null"]}},"required":["links","nextCursor"]},"LinkInCollectionRow":{"type":"object","properties":{"id":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"shortDomainId":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"hostname":{"type":"string","description":"Domain hostname for this short link."},"path":{"type":"string","description":"Path component for this short link."},"shortUrl":{"type":"string","format":"uri","description":"Canonical short link URL for display, copy, and navigation."},"targetUrl":{"type":"string","format":"uri"},"title":{"type":["string","null"]},"description":{"type":["string","null"],"description":"User-authored description (not the scraped page metadata)."},"isActive":{"type":"boolean","description":"Effective live status: the stored on/off switch combined with the schedule window, evaluated at request time — matches what the redirect edge serves and what the `?status` filter selects."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes when the link is off. `null` inherits the domain default, then the system default (a branded inactive page). `target_root` redirects to the destination's root domain; `url` redirects to an explicit URL."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled go-live instant; `null` = no opening edge. Set via the same field on create/update."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"Scheduled turn-off instant; `null` = no closing edge."},"scheduleTimezone":{"type":["string","null"],"description":"IANA timezone the schedule was authored in — display only; the instants above decide liveness."},"showCountdownPage":{"type":["boolean","null"],"description":"Whether a not-yet-live link shows the visitor-facing countdown page instead of its fallback."},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":["string","null"],"enum":["web","import","api","chat","mcp",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Last edit; `null` = never edited since creation."},"clicks":{"type":"integer","description":"Lifetime click total. Present on list rows when the request used a click-based `sort` or `include=clicks`."},"lastClickedAt":{"type":["string","null"],"format":"date-time","description":"Most recent click; `null` = never clicked. Present alongside `clicks`."}},"required":["id","spaceId","shortDomainId","hostname","path","shortUrl","targetUrl","title","description","isActive","fallback","activatesAt","deactivatesAt","scheduleTimezone","showCountdownPage","createdBy","createdVia","createdAt","updatedAt"]},"AddLinksToCollectionResponse":{"type":"object","properties":{"added":{"type":"integer","minimum":0},"alreadyMember":{"type":"integer","minimum":0}},"required":["added","alreadyMember"]},"RemoveLinksFromCollectionResponse":{"type":"object","properties":{"removed":{"type":"integer","minimum":0}},"required":["removed"]},"ConvertSmartToManualResponse":{"type":"object","properties":{"collection":{"type":"object","properties":{"id":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"spaceId":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["manual"]},"rules":{"type":"null"},"createdBy":{"type":"string","pattern":"^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"createdVia":{"type":"string","enum":["web","import","api","chat","mcp"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","spaceId","name","description","type","rules","createdBy","createdVia","createdAt","updatedAt"]},"materialized":{"type":"integer","minimum":0,"description":"Number of current matching links captured in the collection."}},"required":["collection","materialized"]}},"parameters":{}},"paths":{"/api/v1/health":{"get":{"operationId":"getHealth","summary":"Liveness probe","description":"Returns `{ ok: true, api: 'v1' }`. Public — no auth. Use for uptime monitoring and to verify the API surface is reachable. With `?deep=1` it also exercises the QR image rasterizer and returns `render: 'ok'` (500 with `render: 'failed'` when the renderer can't load). A passing deep probe is served from a short per-instance cache; failures always re-probe.","tags":["System"],"parameters":[{"schema":{"type":"string","description":"Set to `1` to run the deep render probe."},"required":false,"description":"Set to `1` to run the deep render probe.","name":"deep","in":"query"}],"responses":{"200":{"description":"Service is reachable (and, with deep=1, rendering works).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"Deep probe only: the image rasterizer failed to load or render."}}}},"/api/v1/me":{"get":{"operationId":"getCurrentUser","summary":"Identify the caller","description":"Returns the user the API key acts as, the spaces the key is authorized for, and the key's own metadata. Useful for client-side key introspection: \"who am I, what can I do?\"","tags":["System"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Caller identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"The key's owner is on a plan without API access (`API_ACCESS_REQUIRED`). Every authenticated endpoint can return this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/domains":{"get":{"operationId":"listDomains","summary":"List available domains","description":"Returns the enabled short domains this space can use. Pass a returned `hostname` or `id` as the `domain` field when creating a link, or omit `domain` to use the space's default domain.","tags":["Domains"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"responses":{"200":{"description":"Available domains.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links":{"post":{"operationId":"createLink","summary":"Create a link","description":"Creates a short link in the named space. `domain` is an optional hostname or `dom_*` id (e.g. \"zlnk.to\", from `GET …/domains`); omit it to use the space's default domain. `collection` is an optional `col_*` id or exact collection name; duplicate names require an id. Rule-based collections returned by the API do not accept explicit link additions. When `path` is omitted, Zebra allocates one under the requested namespace, or the root namespace by default. Links can be scheduled at creation: `activatesAt` / `deactivatesAt` set the live window (the link turns on and off at those instants with no further calls), and `showCountdownPage` opts a not-yet-live link into a visitor-facing countdown page.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"When `true`, probe the target once after creating the link and report `targetReachable` in the response. Adds a network round-trip; off by default. Never blocks creation."},"required":false,"description":"When `true`, probe the target once after creating the link and report `targetReachable` in the response. Adds a network round-trip; off by default. Never blocks creation.","name":"verify","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"minimal":{"summary":"Auto-allocate on the default domain","value":{"targetUrl":"https://example.com"}},"withOptions":{"summary":"Custom path, domain, and collection","value":{"targetUrl":"https://example.com","path":"launch","domain":"zlnk.to","collection":"Launch links","title":"Launch page"}},"scheduled":{"summary":"Scheduled: live for one week, countdown before launch","value":{"targetUrl":"https://example.com/sale","activatesAt":"2026-08-01T08:00:00Z","deactivatesAt":"2026-08-08T08:00:00Z","scheduleTimezone":"Europe/Copenhagen","showCountdownPage":true}}},"schema":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The destination URL the short link redirects to."},"path":{"type":"string","maxLength":128,"description":"Custom short-link path. Omit to auto-allocate one, which is the default and the right choice for most links. When set, it is an address rather than a summary: the bare word someone could repeat from memory and type without looking, such as `heineken` or `launch`. What the link is for belongs in `title`, not here. The maximum length is a storage bound, not a target, and short paths are worth more than descriptive ones."},"candidates":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":3,"description":"Ranked alternatives to `path` — up to 3 names, best first (set `path` or `candidates`, never both). The first that is valid and free becomes the link's path, decided in the same transaction as the create; `choice` in the response says which won (1 = first). When every candidate is taken or invalid, the create fails with each name's reason. Same naming rules as `path`: bare address words, not summaries."},"namespace":{"type":"string","maxLength":128,"description":"Namespace prefix for auto-allocated paths (e.g. `promo` yields `promo/x7k…`). Ignored when `path` is set."},"title":{"type":"string","maxLength":200,"description":"Display title for dashboards and lists."},"description":{"type":["string","null"],"maxLength":2000,"description":"User-authored description (distinct from the scraped page metadata). `null` clears it."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Normally left out — Zebra fetches it from the destination in the background shortly after creation. Supply it only to override; a supplied value is never overwritten by the background fetch."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false}],"description":"Where a visitor goes while the link is off. Omit to inherit the domain default, then the system default. `target_root` redirects to the destination's root domain; `url` to an explicit URL."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"When the link goes live (ISO 8601 timestamp or epoch ms). Before this instant the link is off and visitors get its fallback (or the countdown page). `null` clears it; omit to leave unchanged."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"When the link turns off (ISO 8601 timestamp or epoch ms). After this instant visitors get the link's fallback. Must be after `activatesAt` when both are set. `null` clears it; omit to leave unchanged."},"scheduleTimezone":{"type":["string","null"],"maxLength":64,"description":"IANA timezone (e.g. `Europe/Copenhagen`) used only to display the schedule in the picker. The instants above are absolute and decide liveness on their own."},"showCountdownPage":{"type":["boolean","null"],"description":"Show visitors a countdown page (HTTP 200) instead of the fallback while the link is not yet live. Requires `activatesAt`."},"domain":{"type":"string","minLength":1,"maxLength":253,"description":"Short domain to create the link on: a hostname or `dom_…` id from `GET …/domains`. Omit to use the space's default domain."},"collection":{"type":"string","minLength":1,"maxLength":200,"description":"Collection to add the link to: a `col_…` id or exact collection name (duplicate names require the id)."}},"required":["targetUrl"],"additionalProperties":false}}}},"responses":{"201":{"description":"Link created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only (no active subscription).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed or the path, domain, collection, or URL was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Creation draws on three budgets: the space's per-minute API budget, its per-minute link-creation budget, and the plan's monthly link allowance. `error.details` says which (`scope`) and how much is left (`remaining`); per-minute rejections set `Retry-After`, the monthly allowance does not (it resets with the billing period).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"listLinks","summary":"List links","description":"Returns links in the space. Each row includes canonical `shortUrl` for display, copy, and navigation, plus `hostname` and `path` fields for callers that store URL components separately. Order via `sort` (default `creation-date-desc`); click-based sorts order by the space's click analytics. Keyset pagination via the opaque `cursor` query param — pass back the `nextCursor` from the prior response to advance (a cursor is only valid under the sort that issued it). Defaults to 50 per page, clamped to 1000. Pass `include=clicks` to get `clicks` and `lastClickedAt` on every row (click-based sorts include them automatically).","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^dom_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Filter to a single short domain (dom_* id)."},"required":false,"description":"Filter to a single short domain (dom_* id).","name":"shortDomain","in":"query"},{"schema":{"type":"string","enum":["active","inactive"],"description":"Filter by link status."},"required":false,"description":"Filter by link status.","name":"status","in":"query"},{"schema":{"type":"string","enum":["creation-date-desc","creation-date-asc","edit-date-desc","edit-date-asc","clicks-desc","clicks-asc","recent-clicks-desc","recent-clicks-asc"],"description":"List order (default `creation-date-desc`)."},"required":false,"description":"List order (default `creation-date-desc`).","name":"sort","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a prior response. Only valid with the same `sort` it was issued under."},"required":false,"description":"Opaque pagination cursor from a prior response. Only valid with the same `sort` it was issued under.","name":"cursor","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","description":"Page size, 1–1000 (default 50; server clamps)."},"required":false,"description":"Page size, 1–1000 (default 50; server clamps).","name":"limit","in":"query"},{"schema":{"type":"string","enum":["clicks"],"description":"Extra row data. `clicks` adds `clicks` and `lastClickedAt` to every row."},"required":false,"description":"Extra row data. `clicks` adds `clicks` and `lastClickedAt` to every row.","name":"include","in":"query"}],"responses":{"200":{"description":"Paginated list of links.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLinksResponse"}}}},"400":{"description":"Invalid cursor, sort, or limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/query":{"post":{"operationId":"queryLinks","summary":"Query links by filter","description":"Find links by any combination of filters — destination host, short domain, status, click thresholds, date windows, attribution, and more. POST (not GET) because of the nested and array-valued filters. An empty body matches every link. Results page via `limit`/`offset` and report the true `total`. `negate` inverts named structured dimensions, so this returns the same links as a smart collection built from the same filter. Weighs more than a plain read against the per-minute rate budget.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"examples":{"byDestination":{"summary":"Links pointing at a destination","value":{"targetHost":["cnn.com"],"limit":20}},"staleLinks":{"summary":"Active links not clicked in the last 30 days","value":{"status":"active","clicked":"30d","negate":["clicked"]}}},"schema":{"$ref":"#/components/schemas/QueryLinksInput"}}}},"responses":{"200":{"description":"Matching links plus the true total.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryLinksResponse"}}}},"400":{"description":"Unknown domain in the filter, or invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed (e.g. `query` in `negate`, out-of-range limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/analytics/query":{"post":{"operationId":"queryAnalytics","summary":"Query click analytics","description":"Filter and group CLICK analytics over a scoped set of links — the click counterpart to /links/query. POST because of the nested/array-valued filters. An empty body returns whole-space, all-time totals. Omit `groupBy` for a single total; set it for a breakdown (one row per value), ranked by `measure` (clicks or uniqueClicks). A too-large scope or an unconfigured backend is a flag in the 200 body, never a 4xx. Requires the ANALYTICS_VIEW plan feature; weighs more than a plain read against the per-minute rate budget.","tags":["Analytics"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"examples":{"topCountriesThisWeek":{"summary":"Top countries in the last 7 days","value":{"groupBy":"country","range":"7d"}},"apiLinksByBrowser":{"summary":"Clicks by browser on active links created through the API","value":{"status":"active","createdVia":"api","range":"30d","groupBy":"browser"}},"botTraffic":{"summary":"Automated traffic only, by bot type","value":{"isBot":true,"groupBy":"botType"}}},"schema":{"$ref":"#/components/schemas/QueryAnalyticsInput"}}}},"responses":{"200":{"description":"Aggregate rows, or a configured/tooLarge flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryAnalyticsResponse"}}}},"400":{"description":"Unknown domain in the filter, or invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"The space's plan does not include analytics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The `linkId` scope names a link that does not exist in this space (`LINK_NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Body failed validation (`VALIDATION_FAILED`), or the scope conflicts (`SCOPE_CONFLICT`: `linkId` or `collectionId` combined with each other or with attribute filters).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Click reporting is catching up (`ANALYTICS_TEMPORARILY_UNAVAILABLE`). Sets `Retry-After`; retry after that many seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/lookup":{"get":{"operationId":"lookupLink","summary":"Resolve a short URL to its link","description":"Resolves a short link's identity to exactly one link — for acting on a link you only have the short URL for. Pass `url` (a full short URL or `host/path`), or `domain`+`key`, or a bare `key` when the space uses a single domain. Deterministic, never fuzzy: it returns the one match or a 404. A link on a domain since disabled still resolves. A bare `key` while the space uses more than one domain returns `AMBIGUOUS_DOMAIN` (the candidate domains ride in `details.domains`).","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","description":"A full short URL or `host/path` (e.g. `zbrah.link/launch`). Mutually exclusive with `domain`/`key`."},"required":false,"description":"A full short URL or `host/path` (e.g. `zbrah.link/launch`). Mutually exclusive with `domain`/`key`.","name":"url","in":"query"},{"schema":{"type":"string","description":"Short-domain hostname or `dom_*` id. Pairs with `key`."},"required":false,"description":"Short-domain hostname or `dom_*` id. Pairs with `key`.","name":"domain","in":"query"},{"schema":{"type":"string","description":"The link's path/key (with or without a leading slash). Resolves without `domain` only when the space uses a single domain."},"required":false,"description":"The link's path/key (with or without a leading slash). Resolves without `domain` only when the space uses a single domain.","name":"key","in":"query"}],"responses":{"200":{"description":"The resolved link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupLinkResponse"}}}},"400":{"description":"Missing/conflicting query, unparseable `url`, or `AMBIGUOUS_DOMAIN` (a bare key while the space uses more than one domain).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"No link matches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/{linkId}":{"get":{"operationId":"getLink","summary":"Get a single link","description":"Returns one link with canonical `shortUrl` for display, copy, and navigation, plus `hostname` and `path` fields for callers that store URL components separately. A linkId that exists in a different space returns 404.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"}],"responses":{"200":{"description":"Link found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"updateLink","summary":"Update a link","description":"Patches the named link. Every body field is optional — omitting one leaves that field unchanged; nullable fields treat `null` as \"clear\" (e.g. `title: null` clears the title). Scheduling: `activatesAt` / `deactivatesAt` set or move the live window (`null` clears an edge); the link flips at those instants with no further calls. A linkId that exists in a different space returns 404 (existence is not leaked).","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"retarget":{"summary":"Point the link somewhere else","value":{"targetUrl":"https://example.com/v2"}},"schedule":{"summary":"Turn off automatically at end of month","value":{"deactivatesAt":"2026-08-31T22:00:00Z"}},"clearSchedule":{"summary":"Clear the schedule window","value":{"activatesAt":null,"deactivatesAt":null}}},"schema":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"New destination URL."},"title":{"type":["string","null"],"maxLength":200,"description":"Display title. `null` clears it."},"description":{"type":["string","null"],"maxLength":2000,"description":"User-authored description (distinct from the scraped page metadata). `null` clears it."},"isActive":{"type":"boolean","description":"Master on/off switch. A link is live only while `isActive` is true AND inside its schedule window (if one is set)."},"path":{"type":"string","maxLength":128,"description":"Move the link to a new short path. The old short URL stops resolving immediately — anything already shared or printed with it breaks."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Replaces the stored value; the background fetch never overwrites what you set."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes while the link is off. `null` restores inheritance (domain default, then system default)."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"When the link goes live (ISO 8601 timestamp or epoch ms). Before this instant the link is off and visitors get its fallback (or the countdown page). `null` clears it; omit to leave unchanged."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"When the link turns off (ISO 8601 timestamp or epoch ms). After this instant visitors get the link's fallback. Must be after `activatesAt` when both are set. `null` clears it; omit to leave unchanged."},"scheduleTimezone":{"type":["string","null"],"maxLength":64,"description":"IANA timezone (e.g. `Europe/Copenhagen`) used only to display the schedule in the picker. The instants above are absolute and decide liveness on their own."},"showCountdownPage":{"type":["boolean","null"],"description":"Show visitors a countdown page (HTTP 200) instead of the fallback while the link is not yet live. Requires `activatesAt`."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Link updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only — no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed or the path or URL was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"deleteLink","summary":"Delete a link","description":"Permanently deletes the named link. A linkId in a different space returns 404.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"}],"responses":{"200":{"description":"Link deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteLinkResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/bulk":{"post":{"operationId":"bulkCreateLinks","summary":"Create many links in one request","description":"Creates up to 250 links. Each row gets its own result; a malformed URL or unavailable custom path fails only that row. Set `collection` to a `col_*` id or exact collection name to add every created link to that collection; duplicate names require an id. Rule-based collections returned by the API do not accept explicit link additions.\n\nBulk creation validates URL shape and path availability only. It does not probe each target URL, so no `targetReachable` field is returned. `title` is used when supplied. Rows accept neither `description` nor the schedule fields — create those links singly, or PATCH them (singly or in bulk) after creation.\n\nThe batch counts atomically against the space's link-volume limits: a batch that would cross the per-minute or monthly cap is rejected whole with HTTP 429 and zero links created. Per-minute rejections carry a `Retry-After` header; `error.details.remaining` reports the headroom left in the window so a smaller batch can be sized.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The destination URL the short link redirects to."},"path":{"type":"string","maxLength":128,"description":"Custom short-link path. Omit to auto-allocate one, which is the default and the right choice for most links. When set, it is an address rather than a summary: the bare word someone could repeat from memory and type without looking, such as `heineken` or `launch`. What the link is for belongs in `title`, not here. The maximum length is a storage bound, not a target, and short paths are worth more than descriptive ones."},"candidates":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":3,"description":"Ranked alternatives to `path` — up to 3 names, best first (set `path` or `candidates`, never both). The first that is valid and free becomes the link's path, decided in the same transaction as the create; `choice` in the response says which won (1 = first). When every candidate is taken or invalid, the create fails with each name's reason. Same naming rules as `path`: bare address words, not summaries."},"namespace":{"type":"string","maxLength":128,"description":"Namespace prefix for auto-allocated paths (e.g. `promo` yields `promo/x7k…`). Ignored when `path` is set."},"title":{"type":"string","maxLength":200,"description":"Display title for dashboards and lists."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Normally left out — Zebra fetches it from the destination in the background shortly after creation. Supply it only to override; a supplied value is never overwritten by the background fetch."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false}],"description":"Where a visitor goes while the link is off. Omit to inherit the domain default, then the system default. `target_root` redirects to the destination's root domain; `url` to an explicit URL."},"domain":{"type":"string","minLength":1,"maxLength":253,"description":"Short domain to create the link on: a hostname or `dom_…` id from `GET …/domains`. Omit to use the space's default domain."}},"required":["targetUrl"],"additionalProperties":false},"minItems":1,"maxItems":250},"collection":{"type":"string","minLength":1,"maxLength":200}},"required":["items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Per-row results. HTTP 200 when every row succeeded or every row failed on its own merits; HTTP 207 (Multi-Status) when the batch was partially successful. Inspect each row's `success` field to dispatch on the outcome. A request-wide failure (role, read-only plan, an unusable `collection`) is not a per-row outcome: it returns a single error envelope with that error's own status (usually 402 or 403).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateLinksResponse"}}}},"207":{"description":"Per-row results. HTTP 200 when every row succeeded or every row failed on its own merits; HTTP 207 (Multi-Status) when the batch was partially successful. Inspect each row's `success` field to dispatch on the outcome. A request-wide failure (role, read-only plan, an unusable `collection`) is not a per-row outcome: it returns a single error envelope with that error's own status (usually 402 or 403).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateLinksResponse"}}}},"400":{"description":"Body wasn't valid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request body failed schema validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`) — either the batch would cross the space's link-volume limits (rejected whole, zero links created), or the per-minute API budget ran out. `error.details` carries `scope` and `remaining`; per-minute rejections also set a `Retry-After` header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"bulkUpdateLinks","summary":"Patch many links in one request","description":"Updates up to 500 links. Each `updates[]` row carries a `linkId` and the partial fields to patch, using the same body fields as single-link PATCH. Rows fail independently with per-row error envelopes.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"updates":{"type":"array","items":{"type":"object","properties":{"targetUrl":{"type":"string","maxLength":2048,"format":"uri","description":"New destination URL."},"title":{"type":["string","null"],"maxLength":200,"description":"Display title. `null` clears it."},"description":{"type":["string","null"],"maxLength":2000,"description":"User-authored description (distinct from the scraped page metadata). `null` clears it."},"isActive":{"type":"boolean","description":"Master on/off switch. A link is live only while `isActive` is true AND inside its schedule window (if one is set)."},"path":{"type":"string","maxLength":128,"description":"Move the link to a new short path. The old short URL stops resolving immediately — anything already shared or printed with it breaks."},"metadata":{"type":"object","properties":{"siteName":{"type":"string","maxLength":300},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"description":"Scraped page metadata (site name, page title, page description) to store with the link. Replaces the stored value; the background fetch never overwrites what you set."},"fallback":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["target_root"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","url"],"additionalProperties":false},{"type":"null"}],"description":"Where a visitor goes while the link is off. `null` restores inheritance (domain default, then system default)."},"activatesAt":{"type":["string","null"],"format":"date-time","description":"When the link goes live (ISO 8601 timestamp or epoch ms). Before this instant the link is off and visitors get its fallback (or the countdown page). `null` clears it; omit to leave unchanged."},"deactivatesAt":{"type":["string","null"],"format":"date-time","description":"When the link turns off (ISO 8601 timestamp or epoch ms). After this instant visitors get the link's fallback. Must be after `activatesAt` when both are set. `null` clears it; omit to leave unchanged."},"scheduleTimezone":{"type":["string","null"],"maxLength":64,"description":"IANA timezone (e.g. `Europe/Copenhagen`) used only to display the schedule in the picker. The instants above are absolute and decide liveness on their own."},"showCountdownPage":{"type":["boolean","null"],"description":"Show visitors a countdown page (HTTP 200) instead of the fallback while the link is not yet live. Requires `activatesAt`."},"linkId":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},"required":["linkId"],"additionalProperties":false},"minItems":1,"maxItems":500}},"required":["updates"],"additionalProperties":false}}}},"responses":{"200":{"description":"Per-row results. HTTP 200 when every row succeeded or every row failed on its own merits; HTTP 207 (Multi-Status) when the batch was partially successful. Inspect each row's `success` field to dispatch on the outcome. A request-wide failure (role, read-only plan, an unusable `collection`) is not a per-row outcome: it returns a single error envelope with that error's own status (usually 402 or 403).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateLinksResponse"}}}},"207":{"description":"Per-row results. HTTP 200 when every row succeeded or every row failed on its own merits; HTTP 207 (Multi-Status) when the batch was partially successful. Inspect each row's `success` field to dispatch on the outcome. A request-wide failure (role, read-only plan, an unusable `collection`) is not a per-row outcome: it returns a single error envelope with that error's own status (usually 402 or 403).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateLinksResponse"}}}},"400":{"description":"Body wasn't valid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request body failed schema validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"bulkDeleteLinks","summary":"Delete many links in one request","description":"Deletes up to 500 links by id. Rows fail independently: an id that is missing or belongs to a different space returns `LINK_NOT_FOUND` for that row only, and a contributor deleting links they didn't create gets `LINK_DELETE_FORBIDDEN` per row; the rest still delete. Deletion is permanent; clicks already recorded are unaffected.","tags":["Links"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"linkIds":{"type":"array","items":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"minItems":1,"maxItems":500}},"required":["linkIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Per-row results. HTTP 200 when every row succeeded or every row failed on its own merits; HTTP 207 (Multi-Status) when the batch was partially successful. Inspect each row's `success` field to dispatch on the outcome. A request-wide failure (role, read-only plan, an unusable `collection`) is not a per-row outcome: it returns a single error envelope with that error's own status (usually 402 or 403).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteLinksResponse"}}}},"207":{"description":"Per-row results. HTTP 200 when every row succeeded or every row failed on its own merits; HTTP 207 (Multi-Status) when the batch was partially successful. Inspect each row's `success` field to dispatch on the outcome. A request-wide failure (role, read-only plan, an unusable `collection`) is not a per-row outcome: it returns a single error envelope with that error's own status (usually 402 or 403).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteLinksResponse"}}}},"400":{"description":"Body wasn't valid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request body failed schema validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/{linkId}/qr-variants":{"get":{"operationId":"listQrVariants","summary":"List a link's QR variants","description":"Returns the link's named QR designs in display order, plus the space default style. Every link owns at least a `Default` variant (minted at creation); the FIRST variant is the link's effective default — what renders when no `variant` is specified anywhere. Each variant carries its own `style` (null = inherits the space default), the `effectiveStyle` it actually renders with, and its stable public `imageUrls`. Fetch a rendered code from the link's `/qr/image` endpoint, or export it for a public URL.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"}],"responses":{"200":{"description":"The link's QR variants.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListQrVariantsResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createQrVariant","summary":"Create a QR variant","description":"Adds a named design to the link. Names are unique per link, compared trimmed and case-insensitively, archived codes included. `style` is the sparse design vocabulary (canonical JSON); omit it (or send null) for a design that renders the space default look.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"style":{"type":["object","null"],"properties":{"backgroundShape":{"type":"string","enum":["square","circle"]},"dotType":{"type":"string","enum":["dot","random-dot","rounded","extra-rounded","vertical-line","horizontal-line","square","small-square","diamond","wave","hexagon","circuit","zebra-horizontal","zebra-vertical","blocks-horizontal","blocks-vertical","blobs","soft"]},"cornerSquareType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","center-circle"]},"cornerDotType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","diamond","hexagon","star","heart"]},"dotsColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerSquareColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerDotColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"dotsGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerSquareGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerDotGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"backgroundGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"branding":{"type":"object","properties":{"mode":{"type":"string","enum":["favicon","upload"]},"size":{"type":"string","enum":["small","large"]},"imageRef":{"type":"string","maxLength":2048,"format":"uri"},"mat":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"string","enum":["none"]}],"description":"Backing behind the mark: a hex color, or \"none\" so the code's background shows through. Omitted = #ffffff."}},"required":["mode","size"],"additionalProperties":false},"errorCorrectionLevel":{"type":"string","enum":["M","Q","H"]}},"additionalProperties":false},"signals":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":120}}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"QR variant created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQrVariantResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only (no active subscription).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed: `VALIDATION_FAILED` (body shape), `INVALID_NAME`, `INVALID_STYLE`, `INVALID_SIGNALS`, `QR_VARIANT_CONFLICT` (`details.field` is `name` when another code on the link already has the name, `id` when a staged id is taken), or `SIGNALS_UNBALANCED` (the new code's signal keys must match its live siblings').","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/{linkId}/qr-variants/{variantId}":{"get":{"operationId":"getQrVariant","summary":"Get a QR variant","description":"Returns one named design — its own `style` (null when it inherits the space default), the `effectiveStyle` it actually renders with, its signal map, and stable public `imageUrls`.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"},{"schema":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"QR variant id (prefixed ULID)."},"required":true,"description":"QR variant id (prefixed ULID).","name":"variantId","in":"path"}],"responses":{"200":{"description":"QR variant found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetQrVariantResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link or QR variant not found (a variant on a different link reads as 404).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"updateQrVariant","summary":"Update a QR variant","description":"Patches the named design. Omit a field to leave it unchanged. `style: null` clears the design back to the space default look; `signals` replaces the whole map and must use exactly the link's existing signal keys — keys are link-level columns shared by every live code, so a map missing a key or adding a new one is rejected (`SIGNALS_UNBALANCED`); `archived` flips the lifecycle (true ends the variant's reporting story, false unarchives). Editing a signal on a version that already has recorded scans mints the next plane version rather than rewriting recorded meaning. The response omits `effectiveStyle` (a read-only resolved field); re-read the variant to see it.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"},{"schema":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"QR variant id (prefixed ULID)."},"required":true,"description":"QR variant id (prefixed ULID).","name":"variantId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"style":{"type":["object","null"],"properties":{"backgroundShape":{"type":"string","enum":["square","circle"]},"dotType":{"type":"string","enum":["dot","random-dot","rounded","extra-rounded","vertical-line","horizontal-line","square","small-square","diamond","wave","hexagon","circuit","zebra-horizontal","zebra-vertical","blocks-horizontal","blocks-vertical","blobs","soft"]},"cornerSquareType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","center-circle"]},"cornerDotType":{"type":"string","enum":["dot","square","extra-rounded","classy","inpoint","outpoint","diamond","hexagon","star","heart"]},"dotsColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerSquareColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cornerDotColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"dotsGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerSquareGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"cornerDotGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"backgroundGradient":{"type":"object","properties":{"type":{"type":"string","enum":["linear","radial"]},"rotation":{"type":"number","minimum":0,"maximum":360},"from":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"to":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"midpoint":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["type","from","to"],"additionalProperties":false},"branding":{"type":"object","properties":{"mode":{"type":"string","enum":["favicon","upload"]},"size":{"type":"string","enum":["small","large"]},"imageRef":{"type":"string","maxLength":2048,"format":"uri"},"mat":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"string","enum":["none"]}],"description":"Backing behind the mark: a hex color, or \"none\" so the code's background shows through. Omitted = #ffffff."}},"required":["mode","size"],"additionalProperties":false},"errorCorrectionLevel":{"type":"string","enum":["M","Q","H"]}},"additionalProperties":false},"signals":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":120}},"archived":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"QR variant updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQrVariantResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link or QR variant not found (a variant on a different link reads as 404).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed: `VALIDATION_FAILED` (body shape), `INVALID_NAME`, `INVALID_STYLE`, `INVALID_SIGNALS`, `SIGNALS_UNBALANCED`, or `QR_VARIANT_CONFLICT` with `details.field` `name` when another code on the link, archived codes included, already has the name (compared trimmed and case-insensitively).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"deleteQrVariant","summary":"Delete a QR variant","description":"Deletes the named design. A link with zero remaining variants still renders its default code.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"},{"schema":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"QR variant id (prefixed ULID)."},"required":true,"description":"QR variant id (prefixed ULID).","name":"variantId","in":"path"}],"responses":{"200":{"description":"QR variant deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteQrVariantResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link or QR variant not found (a variant on a different link reads as 404).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/{linkId}/qr/image":{"get":{"operationId":"getLinkQrImage","summary":"Get a link's QR code as an image","description":"Renders the link's code at any size/format — the endpoint a publishing pipeline pairs with link creation. Without `variant`, the link's effective default design renders: its first live (unarchived) variant, else the space default, else the stock look (what the studio shows first). The image always encodes the link's canonical short URL. Authenticated and rendered per request — for a key-free URL to embed or hand off, use the design's stable `imageUrls` (variant endpoints / `/qr/export`).","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"},{"schema":{"type":"string","enum":["png","svg"],"description":"Image format. Default `png`."},"required":false,"description":"Image format. Default `png`.","name":"format","in":"query"},{"schema":{"type":["number","null"],"description":"PNG edge length in pixels (ignored for SVG). Clamped to 64–2048; default 1024."},"required":false,"description":"PNG edge length in pixels (ignored for SVG). Clamped to 64–2048; default 1024.","name":"size","in":"query"},{"schema":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Render this named design instead of the effective default."},"required":false,"description":"Render this named design instead of the effective default.","name":"variant","in":"query"}],"responses":{"200":{"description":"The rendered code. Sends an `ETag`; a matching `If-None-Match` returns 304 without re-rendering.","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string"}}}},"304":{"description":"Not Modified: the request's `If-None-Match` matched the current `ETag`; no body."},"400":{"description":"Malformed request: bad link/variant id in the URL (`INVALID_LINK_ID`, `INVALID_QR_VARIANT_ID`) or an unknown `format` (`INVALID_FORMAT`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link or QR variant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The code could not be rendered (e.g. an uploaded mark is no longer reachable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/{linkId}/qr-variants/{variantId}/image":{"get":{"operationId":"getQrVariantImage","summary":"Get a QR variant as an image","description":"Renders one named design at any size/format, encoding the link's canonical short URL. Live: restyling the variant in the studio changes what it renders next. Authenticated — for a key-free URL to embed or hand off, use the variant's stable `imageUrls`.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"},{"schema":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"QR variant id (prefixed ULID)."},"required":true,"description":"QR variant id (prefixed ULID).","name":"variantId","in":"path"},{"schema":{"type":"string","enum":["png","svg"],"description":"Image format. Default `png`."},"required":false,"description":"Image format. Default `png`.","name":"format","in":"query"},{"schema":{"type":["number","null"],"description":"PNG edge length in pixels (ignored for SVG). Clamped to 64–2048; default 1024."},"required":false,"description":"PNG edge length in pixels (ignored for SVG). Clamped to 64–2048; default 1024.","name":"size","in":"query"}],"responses":{"200":{"description":"The rendered code. Sends an `ETag`; a matching `If-None-Match` returns 304 without re-rendering.","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string"}}}},"304":{"description":"Not Modified: the request's `If-None-Match` matched the current `ETag`; no body."},"400":{"description":"Malformed request: bad link/variant id in the URL (`INVALID_LINK_ID`, `INVALID_QR_VARIANT_ID`) or an unknown `format` (`INVALID_FORMAT`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link or QR variant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The code could not be rendered (e.g. an uploaded mark is no longer reachable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/links/{linkId}/qr/export":{"post":{"operationId":"exportLinkQrImages","summary":"Get a design's stable public image URLs","description":"Resolves a design, refreshes its stable public files, and returns their URLs — key-free, CDN-served, <img>-embeddable, one PNG and one SVG per design. The URLs are permanent and always serve the design's latest saved look: saving in the studio rewrites the same files in place (also returned as `imageUrls` on the variant endpoints, so most callers never need this endpoint after the first materialization). Need a copy frozen in time? Download the file. Without `variant`, the link's effective default design exports — its first live (unarchived) variant, else the space default/stock look. The image encodes only the link's public short URL. Rewriting the files is a write, so this endpoint needs a key with `links:write`; a read-only key gets the same URLs from `imageUrls` on the variant endpoints.","tags":["QR"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Link id (prefixed ULID)."},"required":true,"description":"Link id (prefixed ULID).","name":"linkId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"variant":{"type":"string","pattern":"^qrv_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}},"additionalProperties":false}}}},"responses":{"201":{"description":"Files refreshed; the URLs are live immediately.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrExportResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. Either the API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`) — a read-only key is refused on write endpoints (POST / PATCH / DELETE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Link or QR variant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"File storage is not configured on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The code could not be rendered or stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/collections":{"post":{"operationId":"createCollection","summary":"Create a collection","description":"Creates a collection. Default (`type` omitted or `manual`) is an empty manual group; add links with `POST /collections/{collectionId}/links`. Pass `type:\"smart\"` with a `filter` (the LinkFilter vocabulary) to create a LIVE, rule-based collection whose membership stays current — its contents match a `queryLinks` call with the same filter. A smart body needs at least one filter and returns a `rulesSummary`.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"manual":{"summary":"Manual collection","value":{"name":"Launch links"}},"smart":{"summary":"Smart collection: everything pointing at cnn.com","value":{"type":"smart","name":"CNN links","filter":{"targetHost":["cnn.com"]}}}},"schema":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["smart"]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"filter":{"type":"object","properties":{"query":{"type":"string","maxLength":200,"description":"Free text matched against each link's short path, title, and destination URL."},"status":{"type":"string","enum":["active","inactive"],"description":"active = live right now; inactive = off (manually or by schedule). Schedule-aware."},"created":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Creation-time window: within the last 1h, 24h, 7d, or 30d."},"edited":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-edit window (1h|24h|7d|30d). Creation counts as the initial edit."},"createdVia":{"type":"string","enum":["web","import","chat","api","mcp"],"description":"How the link was created: web, import, chat, api, or mcp."},"hasCollection":{"type":"boolean","description":"true = in at least one collection; false = uncollected."},"schedule":{"type":"string","enum":["upcoming","completed"],"description":"upcoming = has an activation/deactivation still to fire; completed = schedule fully in the past. Unscheduled links match neither."},"attribution":{"type":"string","enum":["utm","signals","any"],"description":"Which attribution the link CARRIES: utm = a utm_* param on its destination URL; signals = a QR code carries signals; any = carries either (spoken to a user as \"Either\")."},"targetHost":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"Where the link POINTS, its destination host (e.g. cnn.com), as hostnames. A leading `www.` is ignored on both sides, so cnn.com matches www.cnn.com — pass the bare host, never both spellings. User-facing word: \"destination\" (never say \"target host\" to a user)."},"shortDomain":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"The link's OWN domain (its short-link host, e.g. zbrah.link) as hostnames. User-facing word: \"domain\" / \"short domain\"."},"clicks":{"type":"object","properties":{"op":{"type":"string","enum":["greaterThan","lessThan"]},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false,"description":"Total-click threshold: {op: greaterThan|lessThan, value: <whole number>}, e.g. {op: greaterThan, value: 100} for more than 100 clicks."},"uniqueClicks":{"type":"object","properties":{"op":{"type":"string","enum":["greaterThan","lessThan"]},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false,"description":"Unique-visitor (distinct) threshold, same shape as clicks."},"clicked":{"type":"string","enum":["1h","24h","7d","30d"],"description":"Last-click recency window (1h|24h|7d|30d). Links never clicked match nothing."},"negate":{"type":"array","items":{"type":"string","enum":["query","status","created","edited","schedule","createdVia","hasCollection","attribution","clicks","uniqueClicks","clicked","shortDomain","targetHost"]},"description":"Filter names to INVERT, each still AND-combined. e.g. status:'active' + negate:['status'] means 'not active'; clicked:'30d' + negate:['clicked'] means 'not clicked in the last 30 days'."}},"additionalProperties":false}},"required":["type","name","filter"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["manual"]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["name"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Collection created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCollectionResponse"}}}},"400":{"description":"A smart filter named a domain the space doesn't have (`UNKNOWN_DOMAIN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only, collection limit reached, or tier doesn't include the collections feature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed, or a smart body produced an empty rule set (`EMPTY_RULES`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"listCollections","summary":"List collections","description":"Returns every collection in the space (the count is capped by the space's plan limit), with each collection's current `linkCount`. Smart collections calculate `linkCount` from their current matching links. Order via `sort` (default `creation-date-desc`; same vocabulary as the link lists); click-based sorts use the collection's current links.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","enum":["creation-date-desc","creation-date-asc","edit-date-desc","edit-date-asc","clicks-desc","clicks-asc","recent-clicks-desc","recent-clicks-asc"],"description":"Collection order (default `creation-date-desc`)."},"required":false,"description":"Collection order (default `creation-date-desc`).","name":"sort","in":"query"}],"responses":{"200":{"description":"Collections in the space.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCollectionsResponse"}}}},"400":{"description":"Invalid sort.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/collections/bulk":{"post":{"operationId":"bulkCreateCollections","summary":"Create many collections in one request","description":"Creates up to 500 normal collections in one request. Names do not have to be unique within a space. The collection cap is enforced all-or-nothing: if the batch would push the space over its limit, none are created (`COLLECTION_LIMIT_REACHED`).","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["name"],"additionalProperties":false},"minItems":1,"maxItems":500}},"required":["items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Per-row results, HTTP 200. Today every reachable failure is either request-body validation (422) or a request-wide rejection (single error envelope, 402/403), so a 200 means every row was created; 207 (Multi-Status) is reserved for future row-level outcomes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateCollectionsResponse"}}}},"207":{"description":"Per-row results, HTTP 200. Today every reachable failure is either request-body validation (422) or a request-wide rejection (single error envelope, 402/403), so a 200 means every row was created; 207 (Multi-Status) is reserved for future row-level outcomes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateCollectionsResponse"}}}},"400":{"description":"Body wasn't valid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Request body failed schema validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/collections/{collectionId}":{"get":{"operationId":"getCollection","summary":"Get one collection","description":"Returns one collection, including its current `linkCount`. A collectionId in a different space returns 404.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"}],"responses":{"200":{"description":"Collection details.","content":{"application/json":{"schema":{"type":"object","properties":{"collection":{"$ref":"#/components/schemas/CollectionWithCountResponse"}},"required":["collection"]}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"updateCollection","summary":"Update a collection","description":"Updates `name` or `description`. Rule editing is not supported by the public API.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Collection updated.","content":{"application/json":{"schema":{"type":"object","properties":{"collection":{"$ref":"#/components/schemas/CollectionWithCountResponse"}},"required":["collection"]}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"deleteCollection","summary":"Delete a collection","description":"Permanently deletes the collection. Links in the collection are not deleted.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"}],"responses":{"200":{"description":"Collection deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCollectionResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found (or in a different space).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/collections/{collectionId}/links":{"get":{"operationId":"listCollectionLinks","summary":"List links in a collection","description":"Returns links in the collection. Smart collections are evaluated against the space's current links at request time. Order via `sort` (default `creation-date-desc`; same vocabulary as the space link list). Keyset pagination uses `cursor` and `limit` (1–1000, default 50; server clamps); a cursor is only valid under the sort that issued it. Pass `include=clicks` for `clicks`/`lastClickedAt` on every row.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"},{"schema":{"type":"string","enum":["creation-date-desc","creation-date-asc","edit-date-desc","edit-date-asc","clicks-desc","clicks-asc","recent-clicks-desc","recent-clicks-asc"],"description":"List order (default `creation-date-desc`)."},"required":false,"description":"List order (default `creation-date-desc`).","name":"sort","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["clicks"],"description":"Extra row data. `clicks` adds `clicks` and `lastClickedAt` to every row."},"required":false,"description":"Extra row data. `clicks` adds `clicks` and `lastClickedAt` to every row.","name":"include","in":"query"}],"responses":{"200":{"description":"Paginated list of links.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLinksInCollectionResponse"}}}},"400":{"description":"Invalid cursor, sort, limit, or `include` value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"addCollectionLinks","summary":"Add links to a collection","description":"Adds the listed links to the collection. Re-adding a link that is already in the collection counts as `alreadyMember`, not an error. Smart collections reject explicit membership changes.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"linkIds":{"type":"array","items":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"minItems":1,"maxItems":500}},"required":["linkIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Links added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddLinksToCollectionResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed, the collection rejects explicit membership changes, or a link is outside the space.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"removeCollectionLinks","summary":"Remove links from a collection","description":"Removes the listed links from the collection. Links that are not in the collection are no-ops. Smart collections reject explicit membership changes.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"linkIds":{"type":"array","items":{"type":"string","pattern":"^lnk_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"},"minItems":1,"maxItems":500}},"required":["linkIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Links removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveLinksFromCollectionResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation failed or the collection rejects explicit membership changes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/spaces/{spaceId}/collections/{collectionId}/convert-to-manual":{"post":{"operationId":"convertCollectionToManual","summary":"Convert a smart collection to manual","description":"Converts a smart collection into a fixed collection containing its current matching links. The collection no longer changes automatically as link state changes. Rejects collections that are already fixed.","tags":["Collections"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Space id (prefixed ULID)."},"required":true,"description":"Space id (prefixed ULID).","name":"spaceId","in":"path"},{"schema":{"type":"string","pattern":"^col_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$","description":"Collection id (prefixed ULID)."},"required":true,"description":"Collection id (prefixed ULID).","name":"collectionId","in":"path"}],"responses":{"200":{"description":"Conversion succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertSmartToManualResponse"}}}},"401":{"description":"Missing or malformed API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Space is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden. The API key is not authorized for the requested space (`SPACE_NOT_ACCESSIBLE`; also returned when the key's owner is not a member of it), or its scope is too narrow for this operation (`INSUFFICIENT_SCOPE`; a read-only key is refused on write endpoints). Write endpoints can additionally refuse on the owner's role in the space: `LINK_WRITE_FORBIDDEN`, `LINK_DELETE_FORBIDDEN`, `COLLECTION_FORBIDDEN`, and `COLLECTION_NOT_GRANTED` (a collection-scoped member acting outside their granted collections). `WORKSPACE_NOT_MEMBER` can appear only when membership was revoked mid-request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Collection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Collection is already fixed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited (`RATE_LIMITED`). Every call draws on the space's per-minute API budget (heavy reads draw more). `error.details` carries `scope`, `remaining`, and `retryAfterSeconds`, and the response sets a `Retry-After` header — wait that long and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}