{"openapi":"3.1.0","info":{"title":"UnuZero API v1","version":"1.0.0","description":"Public API for UnuZero (unuze.ro): links, products, stats and webhooks. See /docs/api for the full guide, curl examples, and webhook signature verification (RO)."},"servers":[{"url":"https://app.unuze.ro/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/me":{"get":{"summary":"Current API key context","description":"Organization, plan and remaining quotas for the calling API key.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthenticated","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/links":{"get":{"summary":"List links","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"meta":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"Unauthenticated","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limited","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"summary":"Create a link","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Link"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Validation error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"402":{"description":"Quota exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/links/{id}":{"get":{"summary":"Get a link","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Link"}},"required":["data"],"additionalProperties":false}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"summary":"Update a link","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkBody"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Link"}},"required":["data"],"additionalProperties":false}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"summary":"Delete a link","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/links/bulk":{"post":{"summary":"Create up to 100 links in one call","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"links":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/CreateLinkBody"}}},"required":["links"]}}}},"responses":{"201":{"description":"Created (partial success possible, see meta.failed)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"meta":{"type":"object","properties":{"failed":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"error":{"type":"string"}},"required":["index","error"],"additionalProperties":false}}},"required":["failed"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}}},"/products":{"get":{"summary":"List products","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Create a product","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"],"additionalProperties":false}}}}}}},"/products/{id}":{"get":{"summary":"Get a product","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a product","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductBody"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"],"additionalProperties":false}}}}}}},"/products/{id}/variants":{"post":{"summary":"Create one link per channel from the product's canonical URL","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVariantsBody"}}}},"responses":{"201":{"description":"Created (partial success possible)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"created":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"skipped":{"type":"array","items":{"type":"object","properties":{"channelKey":{"type":"string"},"reason":{"type":"string"}},"required":["channelKey","reason"],"additionalProperties":false}}},"required":["created","skipped"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}}}}},"/stats":{"get":{"summary":"Analytics (same aggregation the dashboard uses)","parameters":[{"in":"query","name":"scope","schema":{"type":"string","enum":["org","brand","product","link","campaign"]},"required":true},{"in":"query","name":"id","schema":{"type":"string"}},{"in":"query","name":"from","schema":{"type":"string","description":"YYYY-MM-DD"},"required":true,"description":"YYYY-MM-DD"},{"in":"query","name":"to","schema":{"type":"string","description":"YYYY-MM-DD"},"required":true,"description":"YYYY-MM-DD"},{"in":"query","name":"compare","schema":{"description":"year: the same dates one year earlier (plans with at least 365 days of history)","type":"string","enum":["previous","year","none"]},"description":"year: the same dates one year earlier (plans with at least 365 days of history)"},{"in":"query","name":"channel","schema":{"description":"Channel key; repeat the param for several","type":"string"},"description":"Channel key; repeat the param for several"},{"in":"query","name":"campaign","schema":{"description":"Campaign id; repeatable","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Campaign id; repeatable"},{"in":"query","name":"link","schema":{"description":"Link id; repeatable","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Link id; repeatable"},{"in":"query","name":"tag","schema":{"description":"Link tag; repeatable","type":"string"},"description":"Link tag; repeatable"},{"in":"query","name":"brand","schema":{"description":"Brand id; repeatable","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Brand id; repeatable"},{"in":"query","name":"source","schema":{"description":"Click source; repeatable","type":"string","enum":["direct","qr","nfc"]},"description":"Click source; repeatable"},{"in":"query","name":"device","schema":{"description":"mobile, desktop, tablet, other; repeatable. Like os, browser and lang: a value under 5 human clicks with the other filters is not applied (privacy, see filtering.foldedTech)","type":"string"},"description":"mobile, desktop, tablet, other; repeatable. Like os, browser and lang: a value under 5 human clicks with the other filters is not applied (privacy, see filtering.foldedTech)"},{"in":"query","name":"os","schema":{"description":"Normalized OS key; repeatable","type":"string"},"description":"Normalized OS key; repeatable"},{"in":"query","name":"browser","schema":{"description":"Normalized browser key; repeatable","type":"string"},"description":"Normalized browser key; repeatable"},{"in":"query","name":"lang","schema":{"description":"Primary language subtag (ro, en); repeatable","type":"string"},"description":"Primary language subtag (ro, en); repeatable"},{"in":"query","name":"referrer","schema":{"description":"Referrer host; repeatable","type":"string"},"description":"Referrer host; repeatable"},{"in":"query","name":"refType","schema":{"description":"Referrer source type; repeatable","type":"string","enum":["search","social","email","messaging","ai","other","direct"]},"description":"Referrer source type; repeatable"},{"in":"query","name":"country","schema":{"description":"ISO 3166-1 alpha-2; repeatable","type":"string"},"description":"ISO 3166-1 alpha-2; repeatable"},{"in":"query","name":"region","schema":{"description":"Romanian county code (CJ, B); repeatable","type":"string"},"description":"Romanian county code (CJ, B); repeatable"},{"in":"query","name":"city","schema":{"description":"COUNTRY|REGION|City; repeatable. Cities under 10 human clicks with the other filters are not applied (privacy)","type":"string"},"description":"COUNTRY|REGION|City; repeatable. Cities under 10 human clicks with the other filters are not applied (privacy)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResult"}}}}}}},"/conversions":{"post":{"summary":"Report a conversion (order or lead); idempotent on externalId","description":"Returns 201 for a new externalId and 200 with the existing record for a repeated one. Scope: conversions:write.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionInput"}}}},"responses":{"200":{"description":"Existing conversion (repeated externalId)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"],"additionalProperties":false}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversion"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Validation error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Plan does not include conversions, or missing scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Buyer personal data is not accepted","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"get":{"summary":"List conversions","description":"Scope: conversions:read.","parameters":[{"in":"query","name":"from","schema":{"description":"ISO 8601, inclusive","type":"string"},"description":"ISO 8601, inclusive"},{"in":"query","name":"to","schema":{"description":"ISO 8601, inclusive","type":"string"},"description":"ISO 8601, inclusive"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversion"}},"meta":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"403":{"description":"Plan does not include conversions, or missing scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/webhooks":{"get":{"summary":"List webhooks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Create a webhook (secret shown once)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"orgId":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["link.created","link.updated","link.status_changed","link.health_changed","report.ready","domain.status_changed","stats.anomaly_detected"]}},"active":{"type":"boolean"},"lastSuccessAt":{"type":["string","null"]},"firstFailureAt":{"type":["string","null"]},"disabledAt":{"type":["string","null"]},"createdAt":{"type":"string"},"secret":{"type":"string"}},"required":["id","orgId","url","events","active","lastSuccessAt","firstFailureAt","disabledAt","createdAt","secret"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}}}}},"/webhooks/{id}":{"delete":{"summary":"Delete a webhook","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"schemas":{"CreateLinkBody":{"type":"object","properties":{"brandId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationUrl":{"type":"string"},"domainId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string","minLength":2,"maxLength":64},{"type":"null"}]},"channelKey":{"type":["string","null"]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"utm":{"anyOf":[{"$ref":"#/components/schemas/Utm"},{"type":"null"}]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"notes":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"maxClicks":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"fallbackUrl":{"type":["string","null"]},"password":{"anyOf":[{"type":"string","minLength":4},{"type":"null"}]},"humanCheck":{"type":"boolean"},"attributionParam":{"type":"boolean"}},"required":["brandId","destinationUrl"]},"Utm":{"type":"object","properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"}}},"UpdateLinkBody":{"type":"object","properties":{"destinationUrl":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"notes":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"maxClicks":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"fallbackUrl":{"type":["string","null"]},"password":{"anyOf":[{"type":"string","minLength":4},{"type":"null"}]},"clearPassword":{"type":"boolean"},"humanCheck":{"type":"boolean"},"attributionParam":{"type":"boolean"}}},"CreateProductBody":{"type":"object","properties":{"brandId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"sku":{"type":["string","null"]},"gtin":{"type":["string","null"]},"canonicalUrl":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["brandId","name"]},"UpdateProductBody":{"type":"object","properties":{"name":{"type":"string","minLength":1},"sku":{"type":["string","null"]},"gtin":{"type":["string","null"]},"canonicalUrl":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},"CreateVariantsBody":{"type":"object","properties":{"channelKeys":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string"}},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["channelKeys"]},"ConversionInput":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":128,"description":"Your order/lead id; unique per organization"},"type":{"type":"string","enum":["order","lead"]},"occurredAt":{"description":"ISO 8601; default now","type":"string"},"value":{"description":"At most 2 decimals","type":"number","minimum":0},"currency":{"description":"ISO 4217, uppercase; default RON","type":"string","minLength":3,"maxLength":3},"source":{"type":"string","enum":["api","woocommerce","shopify"]},"attribution":{"type":"object","properties":{"token":{"description":"Value of the uz_att query parameter","type":"string"},"linkId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"shortUrl":{"type":"string"},"utm":{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200}}}}},"items":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":100},"gtin":{"type":"string"},"name":{"type":"string","maxLength":200},"quantity":{"type":"number","exclusiveMinimum":0},"price":{"type":"number","minimum":0}},"required":["quantity","price"]}}},"required":["externalId","type"],"description":"Buyer personal data (email, phone, name, address, customer...) is rejected with 422."},"CreateWebhookBody":{"type":"object","properties":{"url":{"type":"string"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["link.created","link.updated","link.status_changed","link.health_changed","report.ready","domain.status_changed","stats.anomaly_detected"]}}},"required":["url","events"]},"Problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"detail_ro":{"type":"string"},"instance":{"type":"string"},"issues":{"type":"array","items":{}},"code":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","title","status","detail","detail_ro","instance"],"additionalProperties":false,"description":"RFC 9457 application/problem+json error body."},"Link":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"orgId":{"type":"string"},"brandId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"channelKey":{"type":["string","null"]},"domainId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"domainHostname":{"type":"string"},"slug":{"type":"string"},"shortUrl":{"type":"string"},"destinationUrl":{"type":"string"},"utm":{"$ref":"#/components/schemas/UtmOutput"},"status":{"type":"string","enum":["pending","active","warned","disabled","archived","expired"]},"safetyState":{"type":"string"},"expiresAt":{"type":["string","null"]},"maxClicks":{"type":["number","null"]},"fallbackUrl":{"type":["string","null"]},"hasPassword":{"type":"boolean"},"humanCheck":{"type":"boolean"},"attributionParam":{"type":"boolean"},"notes":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"archivedAt":{"type":["string","null"]}},"required":["id","orgId","brandId","productId","campaignId","channelKey","domainId","domainHostname","slug","shortUrl","destinationUrl","utm","status","safetyState","expiresAt","maxClicks","fallbackUrl","hasPassword","humanCheck","attributionParam","notes","tags","createdAt","updatedAt","archivedAt"],"additionalProperties":false},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"orgId":{"type":"string"},"brandId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"sku":{"type":["string","null"]},"gtin":{"type":["string","null"]},"canonicalUrl":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"archivedAt":{"type":["string","null"]}},"required":["id","orgId","brandId","name","sku","gtin","canonicalUrl","imageUrl","tags","archivedAt"],"additionalProperties":false},"StatsResult":{"type":"object","properties":{"scope":{"type":"string","enum":["org","brand","product","link","campaign"]},"id":{"type":["string","null"]},"from":{"type":"string"},"to":{"type":"string"},"timezone":{"type":"string"},"compare":{"type":"string","enum":["previous","year","none"]},"compareRange":{"description":"The comparison window actually used; null without comparison","anyOf":[{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},{"type":"null"}]},"kpi":{"type":"object","properties":{"humanClicks":{"type":"object","properties":{"value":{"type":"number"},"previousValue":{"type":["number","null"]},"changePct":{"type":["number","null"]}},"required":["value","previousValue","changePct"],"additionalProperties":false},"qrScans":{"type":"object","properties":{"value":{"type":"number"},"previousValue":{"type":["number","null"]},"changePct":{"type":["number","null"]}},"required":["value","previousValue","changePct"],"additionalProperties":false},"uniqueVisitorsAvgPerDay":{"type":"object","properties":{"value":{"type":"number"},"previousValue":{"type":["number","null"]},"changePct":{"type":["number","null"]}},"required":["value","previousValue","changePct"],"additionalProperties":false},"totalRequests":{"type":"object","properties":{"value":{"type":"number"},"previousValue":{"type":["number","null"]},"changePct":{"type":["number","null"]}},"required":["value","previousValue","changePct"],"additionalProperties":false},"filteredRequests":{"type":"object","properties":{"value":{"type":"number"},"previousValue":{"type":["number","null"]},"changePct":{"type":["number","null"]}},"required":["value","previousValue","changePct"],"additionalProperties":false},"filterRatePct":{"type":"object","properties":{"value":{"type":"number"},"previousValue":{"type":["number","null"]},"changePct":{"type":["number","null"]}},"required":["value","previousValue","changePct"],"additionalProperties":false}},"required":["humanClicks","qrScans","uniqueVisitorsAvgPerDay","totalRequests","filteredRequests","filterRatePct"],"additionalProperties":false},"series":{"type":"object","properties":{"granularity":{"type":"string","enum":["hour","day","week","month"],"description":"Hourly up to 2 days, daily up to 92, weekly up to 400, monthly above"},"points":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","description":"YYYY-MM-DD (day; week and month: first day of the bucket in the range) or YYYY-MM-DDTHH:00 (hour), org timezone"},"end":{"description":"Week and month buckets: last day of the bucket in the range","type":"string"},"human":{"type":"number"},"filtered":{"type":"number"}},"required":["bucket","human","filtered"],"additionalProperties":false}},"previousPoints":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","description":"YYYY-MM-DD (day; week and month: first day of the bucket in the range) or YYYY-MM-DDTHH:00 (hour), org timezone"},"end":{"description":"Week and month buckets: last day of the bucket in the range","type":"string"},"human":{"type":"number"},"filtered":{"type":"number"}},"required":["bucket","human","filtered"],"additionalProperties":false}},{"type":"null"}]}},"required":["granularity","points","previousPoints"],"additionalProperties":false},"daily":{"description":"Per-day human QR scans and unique visitors (always day granularity), zero-filled over the range.","type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"qr":{"type":"number"},"unique":{"type":"number"}},"required":["day","qr","unique"],"additionalProperties":false}},"previousPoints":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"qr":{"type":"number"},"unique":{"type":"number"}},"required":["day","qr","unique"],"additionalProperties":false}},{"type":"null"}]}},"required":["points","previousPoints"],"additionalProperties":false},"channels":{"type":"array","items":{"type":"object","properties":{"channelKey":{"type":"string"},"label":{"type":"string"},"human":{"type":"number"},"previousHuman":{"type":["number","null"]},"changePct":{"type":["number","null"]},"isQr":{"type":"boolean"},"qrCount":{"type":"number"}},"required":["channelKey","label","human","previousHuman","changePct","isQr","qrCount"],"additionalProperties":false}},"links":{"type":"array","items":{"type":"object","properties":{"linkId":{"type":"string"},"slug":{"type":"string"},"shortUrl":{"type":"string"},"channelKey":{"type":["string","null"]},"human":{"type":"number"},"qrCount":{"type":"number"},"uniquePerDay":{"type":"number","description":"Sum over days of the daily unique human visitors of the link"},"previousHuman":{"description":"Human clicks in the previous period; null without compare=previous","type":["number","null"]},"changePct":{"type":["number","null"]},"previousQr":{"type":["number","null"]},"filtered":{"type":"number","description":"Filtered (non-human) requests in the period"},"destinationUrl":{"description":"Truncated to 300 characters; null for a deleted link","type":["string","null"]},"campaignId":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"productId":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["pending","active","warned","disabled","expired","archived"]},{"type":"null"}]},"createdAt":{"type":["string","null"]}},"required":["linkId","slug","shortUrl","channelKey","human","qrCount","uniquePerDay","previousHuman","changePct","previousQr","filtered","destinationUrl","campaignId","campaignName","productId","status","createdAt"],"additionalProperties":false},"description":"Up to 1000 links by human clicks. With compare=previous it also lists links that had clicks in the previous period but none now. See linksTruncated."},"products":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"name":{"type":"string"},"human":{"type":"number"}},"required":["productId","name","human"],"additionalProperties":false}},"geo":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"count":{"type":"number"}},"required":["country","count"],"additionalProperties":false}},"judete":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"},"previousCount":{"description":"Null without compare=previous","type":["number","null"]}},"required":["code","name","count","previousCount"],"additionalProperties":false}},"unknownRo":{"type":"number","description":"Romanian requests without a resolved county"}},"required":["countries","judete","unknownRo"],"additionalProperties":false},"tech":{"type":"object","properties":{"device":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"],"additionalProperties":false}},"os":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"],"additionalProperties":false}},"browser":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"],"additionalProperties":false}},"app":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"],"additionalProperties":false},"description":"Normalized in-app source of human clicks (e.g. facebook, instagram)"},"lang":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"],"additionalProperties":false}}},"required":["device","os","browser","app","lang"],"additionalProperties":false,"description":"Human clicks by normalized technical family. Privacy by design: categories with fewer than 5 clicks in the range are grouped under the key \"other\"."},"referrers":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"count":{"type":"number"},"previousCount":{"description":"Null without compare=previous","type":["number","null"]}},"required":["host","count","previousCount"],"additionalProperties":false}},"heatmap":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"string"}},"hours":{"type":"array","items":{"type":"number"}},"values":{"type":"array","items":{"type":"array","items":{"type":"number"}},"description":"values[weekday][hour], weekday 0 = Monday"}},"required":["rows","hours","values"],"additionalProperties":false},"bots":{"type":"object","properties":{"byClass":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string","enum":["human","preview","scanner","ai_agent","bot"]},"count":{"type":"number"}},"required":["class","count"],"additionalProperties":false}},"byName":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string","enum":["human","preview","scanner","ai_agent","bot"]},"botName":{"type":"string"},"count":{"type":"number"}},"required":["class","botName","count"],"additionalProperties":false}}},"required":["byClass","byName"],"additionalProperties":false},"quality":{"type":"object","properties":{"human":{"type":"object","properties":{"high":{"type":"number"},"medium":{"type":"number"},"low":{"type":"number"},"unknown":{"type":"number","description":"Clicks recorded before classifier v2"}},"required":["high","medium","low","unknown"],"additionalProperties":false,"description":"Human clicks by classifier confidence"},"filteredBySignal":{"type":"array","items":{"type":"object","properties":{"signal":{"type":"string"},"count":{"type":"number"}},"required":["signal","count"],"additionalProperties":false},"description":"Top 10 signals behind filtered (non-human) requests"}},"required":["human","filteredBySignal"],"additionalProperties":false,"description":"Data quality: how sure the classifier is, and why requests were filtered"},"qrPlacements":{"type":"array","items":{"type":"object","properties":{"placement":{"type":"string"},"channelKey":{"type":["string","null"]},"count":{"type":"number"}},"required":["placement","channelKey","count"],"additionalProperties":false}},"annotations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"time":{"type":["string","null"]},"text":{"type":"string"},"channelKey":{"type":["string","null"]}},"required":["id","date","time","text","channelKey"],"additionalProperties":false}},"revenue":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","description":"ISO 4217; currencies are never mixed in one block"},"totals":{"type":"object","properties":{"orders":{"type":"number"},"leads":{"type":"number"},"value":{"type":"number"}},"required":["orders","leads","value"],"additionalProperties":false},"byLink":{"type":"array","items":{"type":"object","properties":{"linkId":{"type":"string"},"slug":{"type":"string"},"orders":{"type":"number"},"leads":{"type":"number"},"value":{"type":"number"}},"required":["linkId","orders","value"],"additionalProperties":false}},"byChannel":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"orders":{"type":"number"},"value":{"type":"number"}},"required":["channel","orders","value"],"additionalProperties":false}},"byCampaign":{"type":"array","items":{"type":"object","properties":{"campaignId":{"type":"string"},"orders":{"type":"number"},"value":{"type":"number"}},"required":["campaignId","orders","value"],"additionalProperties":false}},"byProduct":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"name":{"type":"string"},"orders":{"type":"number"},"value":{"type":"number"}},"required":["productId","orders","value"],"additionalProperties":false}},"byDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"orders":{"type":"number"},"value":{"type":"number"}},"required":["day","orders","value"],"additionalProperties":false}}},"required":["currency","totals","byLink","byChannel","byCampaign","byProduct","byDay"],"additionalProperties":false}},{"type":"null"}],"description":"Revenue from reported conversions, one block per currency. Null when the plan has no conversions or there are none in the period."},"truncatedByPlan":{"type":"boolean"},"brands":{"type":"array","items":{"type":"object","properties":{"brandId":{"type":"string"},"name":{"type":"string"},"human":{"type":"number"},"previousHuman":{"type":["number","null"]},"changePct":{"type":["number","null"]},"qrCount":{"type":"number"}},"required":["brandId","name","human","previousHuman","changePct","qrCount"],"additionalProperties":false},"description":"Per-brand totals, sorted by human clicks. Only for scope=org (empty otherwise)."},"channelsUnassigned":{"anyOf":[{"type":"object","properties":{"human":{"type":"number"},"previousHuman":{"type":["number","null"]},"qrCount":{"type":"number"}},"required":["human","previousHuman","qrCount"],"additionalProperties":false},{"type":"null"}],"description":"Links without a channel (the \"Fără canal\" row); null when there are none"},"linksInScope":{"type":"number","description":"Number of links in the requested scope and filters"},"linksTruncated":{"type":"boolean","description":"True when links was cut at 1000 rows"},"today":{"type":"string","description":"YYYY-MM-DD in the organization timezone"},"generatedAt":{"type":"string","description":"ISO 8601 timestamp of when the result was computed"}},"required":["scope","id","from","to","timezone","compare","kpi","series","channels","links","products","geo","tech","referrers","heatmap","bots","quality","qrPlacements","annotations","revenue","truncatedByPlan","brands","channelsUnassigned","linksInScope","linksTruncated","today","generatedAt"],"additionalProperties":false,"description":"Analytics result for a scope and date range. Tech categories with fewer than 5 clicks are grouped under \"other\"."},"Conversion":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string"},"type":{"type":"string","enum":["order","lead"]},"occurredAt":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":"string"},"source":{"type":"string","enum":["api","woocommerce","shopify"]},"attribution":{"type":"object","properties":{"mode":{"type":"string","enum":["click","link","utm","none"]},"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"brandId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"channel":{"type":["string","null"]},"ruleId":{"type":["string","null"]},"variant":{"type":["string","null"]}},"required":["mode","linkId","campaignId","brandId","productId","channel","ruleId","variant"],"additionalProperties":false},"utm":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"items":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","type","occurredAt","value","currency","source","attribution","utm","items","createdAt"],"additionalProperties":false},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"orgId":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["link.created","link.updated","link.status_changed","link.health_changed","report.ready","domain.status_changed","stats.anomaly_detected"]}},"active":{"type":"boolean"},"lastSuccessAt":{"type":["string","null"]},"firstFailureAt":{"type":["string","null"]},"disabledAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","orgId","url","events","active","lastSuccessAt","firstFailureAt","disabledAt","createdAt"],"additionalProperties":false},"UtmOutput":{"type":"object","properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"}},"additionalProperties":false}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"unz_..."}}}}