{"openapi":"3.1.0","info":{"title":"OneLence API","version":"2026-10-01","description":"Programmatic access to one OneLence workspace: decisions, signals, evidence, analytics, sites and tracking setup.\n\nAuthenticate with an OAuth access token issued for this API, or a personal access token from Settings → Developer, as `Authorization: Bearer <token>`.\n\nSites are addressed by domain or id (`/sites/example.com/overview`). Windows take `start` and `end` as dates or ISO 8601 date-times; the default is the last 30 days.\n\nLists return `{ object: \"list\", data, has_more, next_cursor }`; pass `cursor` to get the next page.\n\nWrites apply directly. Add `?dry_run=true` to preview a change, and an `Idempotency-Key` header to make retries safe.\n\nDecisions come only from the briefing and source decisions. Values are observed for the stated window; null means unknown, not zero."},"servers":[{"url":"https://api.onelence.com/v1"}],"externalDocs":{"description":"Settings → Developer","url":"https://onelence.com/dash/settings/developer"},"tags":[{"name":"Account"},{"name":"Sites"},{"name":"Tracking"},{"name":"Analytics"},{"name":"Affiliates"},{"name":"Decisions"},{"name":"Sources"},{"name":"Signals"},{"name":"Evidence"},{"name":"Changes"},{"name":"Context"},{"name":"Billing"}],"paths":{"/account":{"get":{"operationId":"account_get","summary":"Account","description":"The connected workspace, your role, the plan and what it unlocks, AI credit usage and links to the dashboard.","tags":["Account"],"security":[{"oauth2":["account:read"]},{"bearerToken":[]}],"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"account"},"workspace":{"type":"object","properties":{"id":{"type":"number"},"role":{"type":"string"}},"required":["id","role"],"additionalProperties":false},"connection":{"type":"object","properties":{"app":{"anyOf":[{"type":"string"},{"type":"null"}]},"via":{"type":"string","enum":["oauth","personal_access_token"]},"scopes":{"type":"array","items":{"type":"string"}}},"required":["app","via","scopes"],"additionalProperties":false},"subscription":{"type":"object","properties":{"active":{"type":"boolean"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"trial":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"string"}},"locked_capabilities":{"type":"array","items":{"type":"string"}}},"required":["active","plan","status","trial","capabilities","locked_capabilities"],"additionalProperties":false},"ai_credits":{"anyOf":[{"type":"object","properties":{"used":{"anyOf":[{"type":"number"},{"type":"null"}]},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"allocated":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["used","remaining","allocated"],"additionalProperties":false},{"type":"null"}]},"links":{"type":"object","properties":{"dashboard":{"type":"string"},"billing":{"type":"string"},"connected_apps":{"type":"string"}},"required":["dashboard","billing","connected_apps"],"additionalProperties":false}},"required":["object","workspace","connection","subscription","ai_credits","links"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"account:read","x-onelence-capability":"account.get"}},"/team/members":{"get":{"operationId":"team_members_list","summary":"Team members","description":"Active members of the workspace with their role.","tags":["Account"],"security":[{"oauth2":["account:read"]},{"bearerToken":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"team_member"},"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string"},"joined_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","email","role","joined_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"account:read","x-onelence-capability":"team_members.list"}},"/sites":{"get":{"operationId":"sites_list","summary":"List sites","description":"The websites registered in this workspace. `default` marks the site used when none is given.","tags":["Sites"],"security":[{"oauth2":["account:read"]},{"bearerToken":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"site"},"id":{"type":"string"},"domain":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"default":{"type":"boolean"}},"required":["object","id","domain","status","default"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"account:read","x-onelence-capability":"sites.list"},"post":{"operationId":"sites_create","summary":"Register a site","description":"Adds a website to this workspace so it can send tracking data. Owners and admins only; limited by the plan's site capacity.","tags":["Sites"],"security":[{"oauth2":["tracking:write"]},{"bearerToken":[]}],"parameters":[{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":253,"description":"Domain such as example.com."}},"additionalProperties":false,"required":["domain"]}}}},"responses":{"200":{"description":"With dry_run=true: what would change. Nothing is applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"site"},"id":{"type":"string"},"domain":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"default":{"type":"boolean"}},"required":["object","id","domain","status","default"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:write","x-onelence-capability":"sites.create","x-onelence-admin-only":true}},"/sites/{site}":{"get":{"operationId":"sites_get","summary":"Get a site","description":"One registered site by domain or id.","tags":["Sites"],"security":[{"oauth2":["account:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"site"},"id":{"type":"string"},"domain":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"default":{"type":"boolean"}},"required":["object","id","domain","status","default"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"account:read","x-onelence-capability":"sites.get"}},"/sites/{site}/integrations":{"get":{"operationId":"sites_integrations","summary":"Integration health","description":"Whether the site received tracking events in the last 48 hours, whether Stripe is connected, and the ad platforms, search consoles and store or CMS plugins connected to it with their last sync.","tags":["Sites"],"security":[{"oauth2":["account:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"integrations"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"tracking":{"type":"object","properties":{"status":{"type":"string","enum":["receiving_events","no_recent_events"]},"events_last_48h":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["status","events_last_48h"],"additionalProperties":false},"stripe":{"type":"object","properties":{"status":{"type":"string","enum":["connected","not_connected"]},"account":{"anyOf":[{"type":"string"},{"type":"null"}]},"livemode":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","account","livemode"],"additionalProperties":false},"connections":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"service":{"type":"string","enum":["google_ads","meta_ads","microsoft_ads","tiktok_ads","linkedin_ads","google_search_console","bing_webmaster","shopify","wordpress"]},"status":{"type":"string","enum":["connected","sync_error","expired"]},"account":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_sync_status":{"anyOf":[{"type":"string"},{"type":"null"}]},"included_in_analysis":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"attention":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["service","status","account","currency","last_synced_at","last_sync_status","included_in_analysis","attention"],"additionalProperties":false}},{"type":"null"}]}},"required":["object","site","tracking","stripe","connections"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"account:read","x-onelence-capability":"sites.integrations"}},"/sites/{site}/tracking-status":{"get":{"operationId":"tracking_status","summary":"Tracking status","description":"Whether a site is receiving tracking events (optionally one event name) and conversions in the last N minutes, with a hint when not. Use it after installing or changing tracking.","tags":["Tracking"],"security":[{"oauth2":["tracking:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"event_name","in":"query","required":false,"description":"Only count this event name, exactly as the SDK sends it.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"minutes","in":"query","required":false,"description":"Look-back window in minutes (default 60).","schema":{"type":"integer","minimum":5,"maximum":10080}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"tracking_status"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"status":{"type":"string","enum":["receiving","no_events"]},"window_minutes":{"type":"number"},"since":{"type":"string"},"events":{"type":"number"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"matching_events":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"type":"number"},"last_event":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","occurred_at"],"additionalProperties":false},{"type":"null"}]},"hint":{"type":"string"}},"required":["object","site","status","window_minutes","since","events","event_name","matching_events","conversions","last_event","hint"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:read","x-onelence-capability":"tracking.status"}},"/sites/{site}/install-instructions":{"get":{"operationId":"tracking_install_instructions","summary":"Install instructions","description":"Everything needed to install OneLence tracking in a website: the browser-safe publishable key, site id and host, npm and script snippets, the server-side conversion endpoint and a step-by-step guide for coding agents. Secret keys are never returned; the team manages them in OneLence under Settings → API keys.","tags":["Tracking"],"security":[{"oauth2":["tracking:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"install_instructions"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"publishable_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"browser":{"type":"object","properties":{"package":{"type":"string","const":"@crelora/mark"},"npm_snippet":{"type":"string"},"script_snippet":{"type":"string"},"track_example":{"type":"string"}},"required":["package","npm_snippet","script_snippet","track_example"],"additionalProperties":false},"server_conversions":{"type":"object","properties":{"endpoint":{"type":"string"},"auth_header":{"type":"string","const":"x-secret-key"},"secret_env_var":{"type":"string","const":"ONELENCE_SECRET_KEY"},"example_body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secret_key_location":{"type":"string"}},"required":["endpoint","auth_header","secret_env_var","example_body","secret_key_location"],"additionalProperties":false},"agent_guide":{"type":"string"},"rules":{"type":"array","items":{"type":"string"}}},"required":["object","site","publishable_key","browser","server_conversions","agent_guide","rules"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:read","x-onelence-capability":"tracking.install_instructions"}},"/sites/{site}/measurement":{"get":{"operationId":"measurement_get","summary":"Goal and funnel","description":"What a site optimizes for (revenue, conversions or visitors) and the funnel in effect for it: each step, what it counts and whether it is the site's own funnel, the workspace default or OneLence's.","tags":["Tracking"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"measurement"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"analytics_goal":{"type":"string","enum":["revenue","conversions","visitors"]},"analytics_goal_set":{"type":"boolean"},"funnel":{"type":"object","properties":{"origin":{"type":"string","enum":["site","workspace","default"]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"enabled":{"type":"boolean"},"counts":{"type":"string","enum":["all_visitors","configured_event","signup_events","checkout_events","all_conversions","not_configured"]},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"counted_from":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","label","enabled","counts","event","counted_from"],"additionalProperties":false}}},"required":["origin","steps"],"additionalProperties":false}},"required":["object","site","analytics_goal","analytics_goal_set","funnel"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"measurement.get"}},"/sites/{site}/test-events":{"post":{"operationId":"tracking_send_test_event","summary":"Send a test event","description":"Sends one test event for a site through the same ingest path as its tracking, flagged internal like staff and QA traffic (it can still show in the events list). Then verify tracking with that event name: if it arrives, ingest accepts the site and its key. It does not show that the site's own pages send events. Default event name ol_test_event.","tags":["Tracking"],"security":[{"oauth2":["tracking:write"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"event_name":{"description":"Default ol_test_event.","type":"string","pattern":"^[a-z0-9_.:-]{1,120}$"}},"additionalProperties":false}}}},"responses":{"200":{"description":"With dry_run=true: what would change. Nothing is applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"test_event_receipt"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"event_name":{"type":"string"},"sent_at":{"type":"string"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_step":{"type":"string"}},"required":["object","site","event_name","sent_at","request_id","next_step"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:write","x-onelence-capability":"tracking.send_test_event"}},"/sites/{site}/overview":{"get":{"operationId":"analytics_overview","summary":"Performance overview","description":"Visitors, conversions, conversion rate, observed revenue, top sources and channels and a time series for a window, optionally narrowed to one dimension value and compared with the previous period of the same length.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"bucket","in":"query","required":false,"description":"Time series granularity (default auto).","schema":{"type":"string","enum":["auto","hour","day","week","month"]}},{"name":"filter_dimension","in":"query","required":false,"description":"Narrow to one value of a dimension, e.g. source, channel, campaign, country, entry (landing page) or page.","schema":{"type":"string","enum":["country","region","city","hostname","page","entry","source","channel","campaign","keyword","affiliate","browser","os","device"]}},{"name":"filter_value","in":"query","required":false,"description":"The value to keep, e.g. google, /pricing or DE. Requires filter_dimension.","schema":{"type":"string","minLength":1,"maxLength":240}},{"name":"compare","in":"query","required":false,"description":"previous_period adds the same-length window right before, with changes (default none).","schema":{"type":"string","enum":["none","previous_period"]}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"overview"},"note":{"type":"string"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"filter":{"anyOf":[{"type":"object","properties":{"dimension":{"type":"string","enum":["country","region","city","hostname","page","entry","source","channel","campaign","keyword","affiliate","browser","os","device"]},"value":{"type":"string"}},"required":["dimension","value"],"additionalProperties":false},{"type":"null"}]},"totals":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"observed_revenue":{"type":"object","properties":{"state":{"type":"string","enum":["measured","incomplete","unavailable"]},"amount":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","amount","currency"],"additionalProperties":false}},"required":["visitors","conversions","conversion_rate_pct","observed_revenue"],"additionalProperties":false},"returning_visitors":{"anyOf":[{"type":"object","properties":{"repeat_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["repeat_rate","status"],"additionalProperties":false},{"type":"null"}]},"top_sources":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["name","visitors","conversions"],"additionalProperties":false}},"top_channels":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["name","visitors","conversions"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["date","visitors","conversions"],"additionalProperties":false}},"series_truncated":{"type":"boolean"},"comparison":{"anyOf":[{"type":"object","properties":{"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"totals":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"observed_revenue":{"type":"object","properties":{"state":{"type":"string","enum":["measured","incomplete","unavailable"]},"amount":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","amount","currency"],"additionalProperties":false}},"required":["visitors","conversions","conversion_rate_pct","observed_revenue"],"additionalProperties":false},"changes":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["visitors","conversions","conversion_rate_pct"]},"current":{"anyOf":[{"type":"number"},{"type":"null"}]},"previous":{"anyOf":[{"type":"number"},{"type":"null"}]},"change":{"anyOf":[{"type":"number"},{"type":"null"}]},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["metric","current","previous","change","change_pct"],"additionalProperties":false}}},"required":["window","totals","changes"],"additionalProperties":false},{"type":"null"}]}},"required":["object","note","site","window","filter","totals","returning_visitors","top_sources","top_channels","series","series_truncated","comparison"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"analytics.overview"}},"/sites/{site}/breakdowns/{dimension}":{"get":{"operationId":"analytics_breakdown","summary":"Breakdown","description":"Visitors and conversions split by one dimension (source, channel, campaign, keyword, affiliate, entry/landing page, page, hostname, country, region, city, device, browser, os), largest first. Row names can be used as filter_value with that dimension. A visitor counts in every row they appear in, so rows can add up to more than the site's visitors. compare=previous_period adds each row's previous-period values.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"dimension","in":"path","required":true,"schema":{"type":"string","enum":["country","region","city","hostname","page","entry","source","channel","campaign","keyword","affiliate","browser","os","device"]}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"filter_dimension","in":"query","required":false,"description":"Narrow to one value of a dimension, e.g. source, channel, campaign, country, entry (landing page) or page.","schema":{"type":"string","enum":["country","region","city","hostname","page","entry","source","channel","campaign","keyword","affiliate","browser","os","device"]}},{"name":"filter_value","in":"query","required":false,"description":"The value to keep, e.g. google, /pricing or DE. Requires filter_dimension.","schema":{"type":"string","minLength":1,"maxLength":240}},{"name":"compare","in":"query","required":false,"description":"previous_period adds each row's visitors and conversions in the same-length window right before, with the percent change (default none). A row absent from that window counts 0 there, or has unknown (null) previous values when that window held more rows than one read returns.","schema":{"type":"string","enum":["none","previous_period"]}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"previous_visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"visitors_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"previous_conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["name","visitors","conversions"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"dimension":{"type":"string","enum":["country","region","city","hostname","page","entry","source","channel","campaign","keyword","affiliate","browser","os","device"]},"filter":{"anyOf":[{"type":"object","properties":{"dimension":{"type":"string","enum":["country","region","city","hostname","page","entry","source","channel","campaign","keyword","affiliate","browser","os","device"]},"value":{"type":"string"}},"required":["dimension","value"],"additionalProperties":false},{"type":"null"}]},"names_hidden":{"type":"boolean"},"comparison":{"anyOf":[{"type":"object","properties":{"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false}},"required":["window"],"additionalProperties":false},{"type":"null"}]}},"required":["object","data","has_more","next_cursor","note","site","window","dimension","filter","names_hidden","comparison"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"analytics.breakdown"}},"/sites/{site}/funnel":{"get":{"operationId":"analytics_funnel","summary":"Funnel","description":"Visitors reaching each configured funnel step in the window.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"funnel"},"note":{"type":"string"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"steps":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["label","visitors"],"additionalProperties":false}}},"required":["object","note","site","window","steps"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"analytics.funnel"}},"/sites/{site}/live":{"get":{"operationId":"analytics_live","summary":"Live","description":"Active visitors, events and conversions in the last few minutes. complete is false when the window held more activity than one snapshot reads, so the counts are lower bounds.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"minutes","in":"query","required":false,"description":"Look-back in minutes (default 30).","schema":{"type":"integer","minimum":5,"maximum":240}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"live"},"note":{"type":"string"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window_minutes":{"type":"number"},"active_visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"events":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"complete":{"type":"boolean"}},"required":["object","note","site","window_minutes","active_visitors","events","conversions","complete"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"analytics.live"}},"/conversions":{"get":{"operationId":"conversions_list","summary":"Conversions","description":"Conversions newest first with type, value, attribution method, affiliate and coupon, and the total for the window. Pass site to keep one site's conversions; without it, the whole workspace. Visitor identities are never included.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"query","required":false,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"conversion"},"id":{"type":"string"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"anyOf":[{"type":"string"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"attribution":{"anyOf":[{"type":"string"},{"type":"null"}]},"affiliate":{"anyOf":[{"type":"string"},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","occurred_at","type","value","currency","attribution","affiliate","coupon"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"total":{"type":"number"},"attribution":{"type":"string","enum":["available","unavailable"]},"site":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},{"type":"null"}]}},"required":["object","data","has_more","next_cursor","window","total","attribution","site"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"conversions.list"}},"/sites/{site}/events":{"get":{"operationId":"events_list","summary":"Events","description":"Tracked events on a site, newest first, with their name and page path. Filter by an exact event name. Visitor ids and event properties are not returned.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"event_name","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"event"},"id":{"type":"string"},"name":{"type":"string"},"occurred_at":{"type":"string"},"page_path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","name","occurred_at","page_path"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["object","data","has_more","next_cursor","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"events.list"}},"/sites/{site}/ai-visibility":{"get":{"operationId":"ai_visibility_get","summary":"AI visibility","description":"How AI assistants (ChatGPT, Claude, Perplexity, Gemini and others) read the site and send visitors: a score, platforms, top pages, the previous period and suggested actions with steps. With AI answers set up, also what the engines answer for the questions the site tracks: which brands they name before or instead of it, and the pages they cite.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"ai_visibility"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"has_data":{"type":"boolean"},"crawler_coverage":{"type":"string","enum":["observed","not_recorded"]},"bot_pool":{"anyOf":[{"type":"object","properties":{"used_up":{"type":"boolean"},"renews_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["used_up","renews_at","note"],"additionalProperties":false},{"type":"null"}]},"ai_crawlers_not_kept":{"anyOf":[{"type":"array","items":{"type":"string","enum":["answers","indexing","training"]}},{"type":"null"}]},"score":{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"max":{"type":"number"},"grade":{"anyOf":[{"type":"string","enum":["leading","strong","emerging","weak","barely_visible"]},{"type":"null"}]},"early":{"type":"boolean"}},"required":["value","max","grade","early"],"additionalProperties":false},"totals":{"type":"object","properties":{"answer_fetches":{"type":"number"},"ai_search_crawls":{"type":"number"},"training_crawls":{"type":"number"},"ai_visitors":{"type":"number"},"ai_conversions":{"type":"number"},"ai_visitor_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages_fetched_for_answers":{"type":"number"},"active_platforms":{"type":"number"}},"required":["answer_fetches","ai_search_crawls","training_crawls","ai_visitors","ai_conversions","ai_visitor_share","pages_fetched_for_answers","active_platforms"],"additionalProperties":false},"platforms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"answer_fetches":{"type":"number"},"ai_search_crawls":{"type":"number"},"training_crawls":{"type":"number"},"visitors":{"type":"number"},"conversions":{"type":"number"},"last_seen":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","company","status","answer_fetches","ai_search_crawls","training_crawls","visitors","conversions","last_seen"],"additionalProperties":false}},"top_pages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"answer_fetches":{"type":"number"},"ai_visitors":{"type":"number"},"conversions":{"type":"number"}},"required":["path","status","answer_fetches","ai_visitors","conversions"],"additionalProperties":false}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"confidence":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}]},"observed":{"type":"array","items":{"type":"string"}},"interpretation":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"string"}},"check":{"anyOf":[{"type":"string"},{"type":"null"}]},"pages":{"type":"array","items":{"type":"string"}},"robots_txt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","title","confidence","effort","observed","interpretation","steps","check","pages","robots_txt"],"additionalProperties":false}},"previous":{"type":"object","properties":{"window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"score":{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"max":{"type":"number"},"grade":{"anyOf":[{"type":"string","enum":["leading","strong","emerging","weak","barely_visible"]},{"type":"null"}]},"early":{"type":"boolean"}},"required":["value","max","grade","early"],"additionalProperties":false},"totals":{"type":"object","properties":{"answer_fetches":{"type":"number"},"ai_search_crawls":{"type":"number"},"training_crawls":{"type":"number"},"ai_visitors":{"type":"number"},"ai_conversions":{"type":"number"},"ai_visitor_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"pages_fetched_for_answers":{"type":"number"},"active_platforms":{"type":"number"}},"required":["answer_fetches","ai_search_crawls","training_crawls","ai_visitors","ai_conversions","ai_visitor_share","pages_fetched_for_answers","active_platforms"],"additionalProperties":false}},"required":["window","score","totals"],"additionalProperties":false},"answers":{"type":"object","properties":{"state":{"type":"string","enum":["ready","waiting_for_first_run","not_set_up","not_available","not_readable"]},"run":{"anyOf":[{"type":"object","properties":{"started_at":{"type":"string"},"week_of":{"type":"string"},"engines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"status":{"type":"string","enum":["completed","partial"]}},"required":["started_at","week_of","engines","status"],"additionalProperties":false},{"type":"null"}]},"totals":{"anyOf":[{"type":"object","properties":{"answered":{"type":"number"},"named":{"type":"number"},"linked":{"type":"number"},"no_answer":{"type":"number"}},"required":["answered","named","linked","no_answer"],"additionalProperties":false},{"type":"null"}]},"engines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"answered":{"type":"number"},"named":{"type":"number"},"linked":{"type":"number"},"no_answer":{"type":"number"}},"required":["id","name","answered","named","linked","no_answer"],"additionalProperties":false}},"trend":{"type":"array","items":{"type":"object","properties":{"week_of":{"type":"string"},"started_at":{"type":"string"},"answered":{"type":"number"},"named":{"type":"number"},"linked":{"type":"number"},"no_answer":{"type":"number"}},"required":["week_of","started_at","answered","named","linked","no_answer"],"additionalProperties":false}},"share_of_voice":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["site","competitor","other"]},"answers":{"type":"number"},"first_place":{"type":"number"}},"required":["name","role","answers","first_place"],"additionalProperties":false}},"questions":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string"},"page_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"names_brand":{"type":"boolean"},"recent":{"type":"object","properties":{"answered":{"type":"number"},"named":{"type":"number"},"linked":{"type":"number"},"no_answer":{"type":"number"}},"required":["answered","named","linked","no_answer"],"additionalProperties":false},"answers":{"type":"array","items":{"type":"object","properties":{"engine":{"type":"string"},"engine_name":{"type":"string"},"status":{"type":"string","enum":["answered","no_answer","failed","skipped"]},"named":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"position":{"anyOf":[{"type":"number"},{"type":"null"}]},"linked":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"brands_ahead":{"type":"array","items":{"type":"string"}}},"required":["engine","engine_name","status","named","position","linked","brands_ahead"],"additionalProperties":false}}},"required":["question","page_path","names_brand","recent","answers"],"additionalProperties":false}},"cited_domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"role":{"type":"string","enum":["site","competitor","third_party"]},"answers":{"type":"number"},"answers_naming_competitors_only":{"type":"number"},"pages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"answers":{"type":"number"}},"required":["url","title","answers"],"additionalProperties":false}}},"required":["domain","role","answers","answers_naming_competitors_only","pages"],"additionalProperties":false}},"note":{"type":"string"},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","run","totals","engines","trend","share_of_voice","questions","cited_domains","note","next_step"],"additionalProperties":false}},"required":["object","site","window","has_data","crawler_coverage","bot_pool","ai_crawlers_not_kept","score","totals","platforms","top_pages","actions","previous","answers"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"ai_visibility.get"}},"/sites/{site}/bot-traffic":{"get":{"operationId":"bot_traffic_get","summary":"Bot traffic","description":"Bots, crawlers and AI agents visiting the site: visitors and events by traffic class and category, the most active identified crawlers with identification confidence, and a daily series.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"bot_traffic"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"classes":{"type":"array","items":{"type":"object","properties":{"visitors":{"type":"number"},"events":{"type":"number"},"class":{"type":"string"}},"required":["visitors","events","class"],"additionalProperties":false}},"categories":{"type":"array","items":{"type":"object","properties":{"visitors":{"type":"number"},"events":{"type":"number"},"category":{"type":"string"}},"required":["visitors","events","category"],"additionalProperties":false}},"crawlers":{"type":"array","items":{"type":"object","properties":{"visitors":{"type":"number"},"events":{"type":"number"},"id":{"type":"string"},"category":{"anyOf":[{"type":"string"},{"type":"null"}]},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["visitors","events","id","category","confidence"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"class":{"type":"string"},"visitors":{"type":"number"}},"required":["date","class","visitors"],"additionalProperties":false}},"bot_pool":{"anyOf":[{"type":"object","properties":{"used_up":{"type":"boolean"},"renews_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["used_up","renews_at","note"],"additionalProperties":false},{"type":"null"}]},"not_kept":{"anyOf":[{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"kept":{"type":"boolean"},"visits":{"type":"number"}},"required":["category","kept","visits"],"additionalProperties":false}},"bots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"visits":{"type":"number"}},"required":["id","category","visits"],"additionalProperties":false}},"note":{"type":"string"}},"required":["categories","bots","note"],"additionalProperties":false},{"type":"null"}]},"note":{"type":"string"}},"required":["object","site","window","classes","categories","crawlers","series","bot_pool","not_kept","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"bot_traffic.get"}},"/sites/{site}/partner-discovery":{"get":{"operationId":"partner_discovery_list","summary":"Find affiliate partners","description":"New affiliate partners for the site: sites and creators OneLence found in search results and backlink data (research_finds, from research runs started in OneLence), and partners from the OneLence catalog ranked by fit with its business, market and partner mix (or the filters passed). Current partners, and partners that were dismissed or declined, are left out; each find shows why it is worth a look. Contact details are not returned.","tags":["Affiliates"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"verticals","in":"query","required":false,"schema":{"maxItems":30,"type":"array","items":{"type":"string","enum":["fashion_apparel","beauty_personal_care","health_wellness","fitness_sports","food_beverage","home_garden","electronics_tech","software_saas","marketing_business_services","finance_insurance","travel_hospitality","education_learning","parenting_kids","pets","gaming_entertainment","automotive","creator_economy","sustainability","luxury"]}}},{"name":"countries","in":"query","required":false,"description":"ISO country codes, for example DE or US.","schema":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2}$"}}},{"name":"languages","in":"query","required":false,"description":"ISO language codes, for example de or en.","schema":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2}$"}}},{"name":"partner_types","in":"query","required":false,"schema":{"maxItems":30,"type":"array","items":{"type":"string","enum":["coupon_deal","cashback_loyalty","offerwall","ugc_creator","influencer_social","blog_review","comparison","community","podcast_newsletter","partner_referral","other"]}}},{"name":"commission_models","in":"query","required":false,"schema":{"maxItems":10,"type":"array","items":{"type":"string","enum":["cps","cpl","cpa","cpc","flat_fee","hybrid"]}}},{"name":"q","in":"query","required":false,"description":"Search partner names, domains and descriptions.","schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","required":false,"description":"Matches to return (default 20).","schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"partner_discovery"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"brief":{"type":"object","properties":{"offer_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"verticals":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"source":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["values","source"],"additionalProperties":false},"countries":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"source":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["values","source"],"additionalProperties":false},"languages":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"source":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["values","source"],"additionalProperties":false},"partner_types":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"source":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["values","source"],"additionalProperties":false},"commission_models":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"source":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["values","source"],"additionalProperties":false},"missing":{"type":"array","items":{"type":"string"}}},"required":["offer_type","verticals","countries","languages","partner_types","commission_models","missing"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"partner_match"},"id":{"type":"string"},"name":{"type":"string"},"website_domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"partner_types":{"type":"array","items":{"type":"string"}},"verticals":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"commission_models":{"type":"array","items":{"type":"string"}},"audience_size":{"anyOf":[{"type":"string"},{"type":"null"}]},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"profile_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["network","profile_url"],"additionalProperties":false}},"fit":{"type":"object","properties":{"score":{"type":"number"},"tier":{"anyOf":[{"type":"string","enum":["strong","good","possible","weak","insufficient_profile"]},{"type":"null"}]},"assessed_share":{"type":"number"},"components":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["match","partial","mismatch","partner_unknown","brief_missing"]},{"type":"null"}]}},"required":["component","status"],"additionalProperties":false}}},"required":["score","tier","assessed_share","components"],"additionalProperties":false},"shortlist_status":{"anyOf":[{"type":"string","enum":["saved","contacted","replied","dismissed"]},{"type":"null"}]},"profile_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"profile_verified_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","name","website_domain","description","partner_types","verticals","countries","languages","commission_models","audience_size","networks","fit","shortlist_status","profile_source","profile_verified_at","last_seen_at"],"additionalProperties":false}},"research_finds":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"research_find"},"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"platform":{"type":"string"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"partner_types":{"type":"array","items":{"type":"string"}},"strength":{"anyOf":[{"type":"string","enum":["strong","medium","light"]},{"type":"null"}]},"opportunities":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"competitors":{"type":"array","items":{"type":"string"}},"backlinks":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["kind","competitors","backlinks"],"additionalProperties":false}},"verification":{"anyOf":[{"type":"string","enum":["unverified","affiliate_signals","no_affiliate_signals","unreachable"]},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["new","saved","contacted","replied"]},{"type":"null"}]},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","name","kind","platform","domain","url","partner_types","strength","opportunities","verification","status","last_seen_at"],"additionalProperties":false}},"last_research_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"catalog_size":{"type":"number"},"excluded_existing_partners":{"type":"number"},"excluded_dismissed":{"type":"number"},"note":{"type":"string"},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","site","brief","data","research_finds","last_research_at","catalog_size","excluded_existing_partners","excluded_dismissed","note","next_step"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"partner_discovery.list"}},"/sites/{site}/partner-discovery/{partner_id}/status":{"post":{"operationId":"partner_discovery_set_status","summary":"Set a found partner's status","description":"Saves a partner found for a site, moves it through recruiting (contacted, replied, declined), dismisses it, or clears its status, as on the Discover page. Pass the partner's id and its object type (partner_match or research_find) from the find-partners read. Dismissed and declined partners leave that list; cleared puts a partner back as new. OneLence contacts no one. Owners and admins only.","tags":["Affiliates"],"security":[{"oauth2":["workspace:write"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"partner_id","in":"path","required":true,"description":"id of the partner_match or research_find.","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)$"}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["partner_match","research_find"],"description":"The object type the partner was returned as."},"status":{"type":"string","enum":["saved","contacted","replied","declined","dismissed","cleared"]},"no_answer":{"description":"With declined: the partner never answered the follow-ups.","type":"boolean"}},"additionalProperties":false,"required":["type","status"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"partner_status_receipt"},"partner_id":{"type":"string"},"type":{"type":"string","enum":["partner_match","research_find"]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","partner_id","type","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"workspace:write","x-onelence-capability":"partner_discovery.set_status","x-onelence-admin-only":true}},"/sites/{site}/seo-opportunities":{"get":{"operationId":"seo_opportunities_list","summary":"SEO opportunities","description":"SEO candidates from the canonical workspace projection, with disposition, reason, Work action state, and suggested next step. The summary includes evidence readiness, search metrics, and connection state. Without dates, the window is the latest 28 days Search Console reports (it lags about 2 days).","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"lane","in":"query","required":false,"schema":{"type":"string","enum":["grow_proven_pages","recover_visibility","fix_search_leakage","create_new_coverage","needs_evidence"]}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"seo_opportunity"},"id":{"type":"string"},"kind":{"type":"string"},"page":{"anyOf":[{"type":"string"},{"type":"null"}]},"query":{"anyOf":[{"type":"string"},{"type":"null"}]},"topic":{"anyOf":[{"type":"string"},{"type":"null"}]},"lane":{"type":"string","enum":["grow_proven_pages","recover_visibility","fix_search_leakage","create_new_coverage","needs_evidence"]},"search_potential":{"type":"string","enum":["high","medium","low","missing"]},"page_value":{"type":"string","enum":["high","medium","low","missing"]},"confidence":{"type":"string","enum":["high","medium","low","missing"]},"urgency":{"type":"string","enum":["high","medium","low","missing"]},"effort":{"anyOf":[{"type":"string"},{"type":"null"}]},"page_visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"page_conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"title":{"type":"string"},"why":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}]},"focus_queries":{"type":"array","items":{"type":"string"}},"conflicts":{"type":"array","items":{"type":"string"}},"disposition":{"type":"string","enum":["ready_to_plan","check_first","explore_only","in_work","excluded"]},"primary_reason":{"type":"string"},"candidate_fingerprint":{"type":"string"},"action_state":{"type":"string","enum":["opportunity","evaluation","work","none","unavailable"]}},"required":["object","id","kind","page","query","topic","lane","search_potential","page_value","confidence","urgency","effort","page_visitors","page_conversions","title","why","next_step","focus_queries","conflicts","disposition","primary_reason","candidate_fingerprint","action_state"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"type":"object","properties":{"state":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"data_through":{"anyOf":[{"type":"string"},{"type":"null"}]},"google_connected":{"type":"boolean"},"bing_connected":{"type":"boolean"},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"impressions":{"anyOf":[{"type":"number"},{"type":"null"}]},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}]},"average_position":{"anyOf":[{"type":"number"},{"type":"null"}]},"lanes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"candidate_readiness":{"type":"string"},"candidate_empty_state":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","reason","data_through","google_connected","bing_connected","clicks","impressions","ctr","average_position","lanes","candidate_readiness","candidate_empty_state"],"additionalProperties":false}},"required":["object","data","has_more","next_cursor","summary"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"seo_opportunities.list"}},"/sites/{site}/seo-opportunities/{opportunity_id}":{"get":{"operationId":"seo_opportunities_get","summary":"SEO opportunity","description":"One SEO opportunity from the opportunities list, with the brief the SEO page shows: what to do, the page and query it targets, what to change and check, why now, the facts behind it with where each comes from, and any blockers. Pass the same window as the list, if any.","tags":["Analytics"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"opportunity_id","in":"path","required":true,"description":"The opportunity id from the SEO opportunities list.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"seo_opportunity"},"id":{"type":"string"},"kind":{"type":"string"},"page":{"anyOf":[{"type":"string"},{"type":"null"}]},"query":{"anyOf":[{"type":"string"},{"type":"null"}]},"topic":{"anyOf":[{"type":"string"},{"type":"null"}]},"lane":{"type":"string","enum":["grow_proven_pages","recover_visibility","fix_search_leakage","create_new_coverage","needs_evidence"]},"search_potential":{"type":"string","enum":["high","medium","low","missing"]},"page_value":{"type":"string","enum":["high","medium","low","missing"]},"confidence":{"type":"string","enum":["high","medium","low","missing"]},"urgency":{"type":"string","enum":["high","medium","low","missing"]},"effort":{"anyOf":[{"type":"string"},{"type":"null"}]},"page_visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"page_conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"title":{"type":"string"},"why":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}]},"focus_queries":{"type":"array","items":{"type":"string"}},"conflicts":{"type":"array","items":{"type":"string"}},"disposition":{"type":"string","enum":["ready_to_plan","check_first","explore_only","in_work","excluded"]},"primary_reason":{"type":"string"},"candidate_fingerprint":{"type":"string"},"action_state":{"type":"string","enum":["opportunity","evaluation","work","none","unavailable"]},"brief":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["ready","blocked","research_missing"]},"heading":{"type":"string"},"target":{"anyOf":[{"type":"string"},{"type":"null"}]},"focus_query":{"anyOf":[{"type":"string"},{"type":"null"}]},"do_this":{"type":"string"},"now":{"type":"string"},"change":{"type":"string"},"check":{"type":"string"},"why_now":{"type":"string"},"facts":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"basis":{"type":"string"},"as_of":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["label","value","basis","as_of"],"additionalProperties":false}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["state","heading","target","focus_query","do_this","now","change","check","why_now","facts","blockers"],"additionalProperties":false},{"type":"null"}]}},"required":["object","id","kind","page","query","topic","lane","search_potential","page_value","confidence","urgency","effort","page_visitors","page_conversions","title","why","next_step","focus_queries","conflicts","disposition","primary_reason","candidate_fingerprint","action_state","brief"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"seo_opportunities.get"}},"/sites/{site}/seo-opportunities/{opportunity_id}/choice":{"post":{"operationId":"seo_opportunities_choose","summary":"Choose what to do with an SEO opportunity","description":"Plans an SEO opportunity (plan_to_do, optionally with a plan: the change, URLs and the metric to watch), reports it as already done (already_did, with what was changed, where and when), or closes it (will_not_do, with a reason), as on the SEO page. It goes to SEO Work in OneLence; nothing changes on the site or in Search Console, and it cannot be undone from here. Pass the candidate_fingerprint and the window the opportunity was read with. Some opportunities need a plan for every choice, as on the SEO page; without one the choice is refused with param plan. Owners and admins only.","tags":["Analytics"],"security":[{"oauth2":["workspace:write"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"opportunity_id","in":"path","required":true,"description":"The opportunity id from the SEO opportunities list.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"candidate_fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"candidate_fingerprint from the same read; a changed opportunity is refused."},"choice":{"type":"string","enum":["plan_to_do","already_did","will_not_do"]},"plan":{"description":"The planned change. Optional with plan_to_do (without it, OneLence plans the suggested next step), but some opportunities need it for every choice.","type":"object","properties":{"intended_change":{"type":"string","minLength":3,"maxLength":4000,"description":"What will be changed."},"affected_urls":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"query_scope":{"description":"The search queries it targets.","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"expected_metric":{"type":"string","enum":["clicks","impressions","ctr","position"],"description":"The metric to watch after the change."},"window_days":{"anyOf":[{"type":"number","const":7},{"type":"number","const":28}],"description":"How long to watch it."}},"required":["intended_change","affected_urls","expected_metric","window_days"],"additionalProperties":false},"application":{"description":"Required with already_did.","type":"object","properties":{"description":{"type":"string","minLength":3,"maxLength":5000,"description":"What was changed."},"affected_urls":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"query_scope":{"description":"The search queries it targets.","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"applied_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When the change went live (ISO 8601)."},"before_value":{"type":"string","maxLength":3000},"after_value":{"type":"string","maxLength":3000},"external_reference":{"description":"A link to the change, such as a commit or CMS revision.","type":"string","maxLength":2000}},"required":["description","affected_urls","applied_at"],"additionalProperties":false},"reason":{"description":"Why, for will_not_do.","type":"string","maxLength":1000},"start":{"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","type":"string","maxLength":40},"end":{"description":"Window end, inclusive for a date. Defaults to now.","type":"string","maxLength":40}},"additionalProperties":false,"required":["candidate_fingerprint","choice"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"seo_choice_receipt"},"opportunity_id":{"type":"string"},"choice":{"type":"string","enum":["plan_to_do","already_did","will_not_do"]},"work_item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["object","opportunity_id","choice","work_item","replayed"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"workspace:write","x-onelence-capability":"seo_opportunities.choose","x-onelence-admin-only":true}},"/affiliates":{"get":{"operationId":"affiliates_list","summary":"Affiliates","description":"Affiliate partners with their referral and coupon codes, clicks, conversions and conversion rate. Partners and their tracked clicks and conversions. Partner Decisions are in the decision list (type=affiliate).","tags":["Affiliates"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"query","required":false,"description":"Only partners on this site. Without it, the whole workspace.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"status","in":"query","required":false,"description":"For example active or paused.","schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"start","in":"query","required":false,"description":"Count clicks and conversions from this date (YYYY-MM-DD) or ISO 8601 date-time. Without start, there is no lower bound; without either, all time.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Count up to this date (inclusive) or ISO 8601 date-time. Without end, there is no upper bound.","schema":{"type":"string","maxLength":40}},{"name":"compare","in":"query","required":false,"description":"previous_period adds each partner's clicks and conversions in the same-length window right before start, with the percent change (default none). Needs start.","schema":{"type":"string","enum":["none","previous_period"]}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"affiliate"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"coupon_codes":{"type":"array","items":{"type":"string"}},"metrics_state":{"type":"string","enum":["available","unavailable"]},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"previous_clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"clicks_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"previous_conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["object","id","name","status","site_id","code","coupon_codes","metrics_state","clicks","conversions","conversion_rate_pct","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"comparison":{"anyOf":[{"type":"object","properties":{"window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"required":["window"],"additionalProperties":false},{"type":"null"}]},"active":{"type":"number"},"limit":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"type":"string"}},"required":["object","data","has_more","next_cursor","window","comparison","active","limit","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"affiliates.list"}},"/affiliates/{affiliate_id}":{"get":{"operationId":"affiliates_get","summary":"Affiliate","description":"One affiliate partner by id or referral code, with codes and its clicks and conversions (all time, or in the window passed).","tags":["Affiliates"],"security":[{"oauth2":["analytics:read"]},{"bearerToken":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"description":"The partner id from the affiliates list, or its referral code.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"start","in":"query","required":false,"description":"Count clicks and conversions from this date (YYYY-MM-DD) or ISO 8601 date-time. Without start, there is no lower bound; without either, all time.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Count up to this date (inclusive) or ISO 8601 date-time. Without end, there is no upper bound.","schema":{"type":"string","maxLength":40}},{"name":"compare","in":"query","required":false,"description":"previous_period adds each partner's clicks and conversions in the same-length window right before start, with the percent change (default none). Needs start.","schema":{"type":"string","enum":["none","previous_period"]}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"affiliate"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"coupon_codes":{"type":"array","items":{"type":"string"}},"metrics_state":{"type":"string","enum":["available","unavailable"]},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"previous_clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"clicks_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"previous_conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"comparison":{"anyOf":[{"type":"object","properties":{"window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"required":["window"],"additionalProperties":false},{"type":"null"}]}},"required":["object","id","name","status","site_id","code","coupon_codes","metrics_state","clicks","conversions","conversion_rate_pct","created_at","window","comparison"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"analytics:read","x-onelence-capability":"affiliates.get"}},"/sites/{site}/briefing":{"get":{"operationId":"decisions_briefing","summary":"Briefing","description":"What to scale, hold or stop on a site, with reasons, evidence and limits, data sufficiency and exceptional alerts. Only the briefing and source decisions state Decisions (scale, hold, stop); never infer one from analytics, signals or evidence.","tags":["Decisions"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"limit_per_posture","in":"query","required":false,"description":"Decisions returned per posture (default 5); counts always cover all.","schema":{"type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"briefing"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},"data_status":{"type":"object","properties":{"enough_data":{"type":"boolean"},"suggested_collect_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["enough_data","suggested_collect_days","visitors","conversions"],"additionalProperties":false},"counts":{"type":"object","properties":{"scale":{"type":"number"},"hold":{"type":"number"},"stop":{"type":"number"}},"required":["scale","hold","stop"],"additionalProperties":false},"decisions":{"type":"object","properties":{"scale":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"decision"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["source","affiliate"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","type","channel","role"],"additionalProperties":false},"decision":{"type":"object","properties":{"state":{"type":"string","enum":["available","unavailable"]},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","posture","confidence"],"additionalProperties":false},"primary_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"context":{"type":"array","items":{"type":"string"}},"evidence":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"completeness":{"anyOf":[{"type":"string"},{"type":"null"}]},"reliability":{"anyOf":[{"type":"string"},{"type":"null"}]},"observed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"reviewed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["summary","completeness","reliability","observed","reviewed","missing","blockers"],"additionalProperties":false},"readiness":{"type":"object","properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","message"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}},"consequence":{"anyOf":[{"type":"object","properties":{"primary_risk":{"anyOf":[{"type":"string"},{"type":"null"}]},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}]},"time_horizon_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"if_ignored":{"anyOf":[{"type":"string"},{"type":"null"}]},"if_followed":{"anyOf":[{"type":"string"},{"type":"null"}]},"financial":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["primary_risk","risk_level","time_horizon_days","if_ignored","if_followed","financial"],"additionalProperties":false},{"type":"null"}]},"next_step":{"type":"object","properties":{"recommended_action":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorization":{"anyOf":[{"type":"string","enum":["authorized","review_required","unavailable"]},{"type":"null"}]},"required_review_steps":{"type":"array","items":{"type":"string"}}},"required":["recommended_action","authorization","required_review_steps"],"additionalProperties":false},"metrics":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"traffic_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","conversions","conversion_rate","traffic_share","quality_score"],"additionalProperties":false},"analysis_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"timezone":{"type":"string"}},"required":["start","end","timezone"],"additionalProperties":false},{"type":"null"}]}},"required":["object","source","decision","primary_reason","reasons","context","evidence","readiness","limitations","consequence","next_step","metrics","analysis_window"],"additionalProperties":false}},"hold":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"decision"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["source","affiliate"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","type","channel","role"],"additionalProperties":false},"decision":{"type":"object","properties":{"state":{"type":"string","enum":["available","unavailable"]},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","posture","confidence"],"additionalProperties":false},"primary_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"context":{"type":"array","items":{"type":"string"}},"evidence":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"completeness":{"anyOf":[{"type":"string"},{"type":"null"}]},"reliability":{"anyOf":[{"type":"string"},{"type":"null"}]},"observed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"reviewed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["summary","completeness","reliability","observed","reviewed","missing","blockers"],"additionalProperties":false},"readiness":{"type":"object","properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","message"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}},"consequence":{"anyOf":[{"type":"object","properties":{"primary_risk":{"anyOf":[{"type":"string"},{"type":"null"}]},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}]},"time_horizon_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"if_ignored":{"anyOf":[{"type":"string"},{"type":"null"}]},"if_followed":{"anyOf":[{"type":"string"},{"type":"null"}]},"financial":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["primary_risk","risk_level","time_horizon_days","if_ignored","if_followed","financial"],"additionalProperties":false},{"type":"null"}]},"next_step":{"type":"object","properties":{"recommended_action":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorization":{"anyOf":[{"type":"string","enum":["authorized","review_required","unavailable"]},{"type":"null"}]},"required_review_steps":{"type":"array","items":{"type":"string"}}},"required":["recommended_action","authorization","required_review_steps"],"additionalProperties":false},"metrics":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"traffic_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","conversions","conversion_rate","traffic_share","quality_score"],"additionalProperties":false},"analysis_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"timezone":{"type":"string"}},"required":["start","end","timezone"],"additionalProperties":false},{"type":"null"}]}},"required":["object","source","decision","primary_reason","reasons","context","evidence","readiness","limitations","consequence","next_step","metrics","analysis_window"],"additionalProperties":false}},"stop":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"decision"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["source","affiliate"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","type","channel","role"],"additionalProperties":false},"decision":{"type":"object","properties":{"state":{"type":"string","enum":["available","unavailable"]},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","posture","confidence"],"additionalProperties":false},"primary_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"context":{"type":"array","items":{"type":"string"}},"evidence":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"completeness":{"anyOf":[{"type":"string"},{"type":"null"}]},"reliability":{"anyOf":[{"type":"string"},{"type":"null"}]},"observed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"reviewed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["summary","completeness","reliability","observed","reviewed","missing","blockers"],"additionalProperties":false},"readiness":{"type":"object","properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","message"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}},"consequence":{"anyOf":[{"type":"object","properties":{"primary_risk":{"anyOf":[{"type":"string"},{"type":"null"}]},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}]},"time_horizon_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"if_ignored":{"anyOf":[{"type":"string"},{"type":"null"}]},"if_followed":{"anyOf":[{"type":"string"},{"type":"null"}]},"financial":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["primary_risk","risk_level","time_horizon_days","if_ignored","if_followed","financial"],"additionalProperties":false},{"type":"null"}]},"next_step":{"type":"object","properties":{"recommended_action":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorization":{"anyOf":[{"type":"string","enum":["authorized","review_required","unavailable"]},{"type":"null"}]},"required_review_steps":{"type":"array","items":{"type":"string"}}},"required":["recommended_action","authorization","required_review_steps"],"additionalProperties":false},"metrics":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"traffic_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","conversions","conversion_rate","traffic_share","quality_score"],"additionalProperties":false},"analysis_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"timezone":{"type":"string"}},"required":["start","end","timezone"],"additionalProperties":false},{"type":"null"}]}},"required":["object","source","decision","primary_reason","reasons","context","evidence","readiness","limitations","consequence","next_step","metrics","analysis_window"],"additionalProperties":false}}},"required":["scale","hold","stop"],"additionalProperties":false},"context_sources":{"type":"object","properties":{"acquisition":{"type":"number"},"owned":{"type":"number"},"utility":{"type":"number"}},"required":["acquisition","owned","utility"],"additionalProperties":false},"alerts":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["source","message","severity"],"additionalProperties":false}},"attribution_confidence":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","site","window","data_status","counts","decisions","context_sources","alerts","attribution_confidence","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"decisions.briefing"}},"/sites/{site}/priorities":{"get":{"operationId":"priorities_list","summary":"Priorities","description":"Today's focus: the few things to look at first on a site (decisions to review, tracking or evidence to fix, signals), ranked, each with why it comes first and a safe next step.","tags":["Decisions"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"description":"Items to return (default 5).","schema":{"type":"integer","minimum":1,"maximum":10}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"priority"},"id":{"type":"string"},"rank":{"type":"number"},"kind":{"type":"string","enum":["decision","tracking","evidence","business_context","access","signal"]},"tone":{"type":"string","enum":["good","warn","bad","info"]},"title":{"type":"string"},"why_now":{"anyOf":[{"type":"string"},{"type":"null"}]},"effect":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}]},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"signal_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","rank","kind","tone","title","why_now","effect","next_step","source_id","signal_id","url"],"additionalProperties":false}},"note":{"type":"string"}},"required":["object","data","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"priorities.list"}},"/sites/{site}/decisions":{"get":{"operationId":"decisions_list","summary":"List decisions","description":"Every source Decision on a site, scale first, then hold, then stop, each in priority order. Filter by posture or source type. Only the briefing and source decisions state Decisions (scale, hold, stop); never infer one from analytics, signals or evidence.","tags":["Decisions"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"posture","in":"query","required":false,"schema":{"type":"string","enum":["scale","hold","stop"]}},{"name":"type","in":"query","required":false,"description":"affiliate = partner sources only.","schema":{"type":"string","enum":["source","affiliate"]}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"decision"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["source","affiliate"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","type","channel","role"],"additionalProperties":false},"decision":{"type":"object","properties":{"state":{"type":"string","enum":["available","unavailable"]},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","posture","confidence"],"additionalProperties":false},"primary_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"context":{"type":"array","items":{"type":"string"}},"evidence":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"completeness":{"anyOf":[{"type":"string"},{"type":"null"}]},"reliability":{"anyOf":[{"type":"string"},{"type":"null"}]},"observed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"reviewed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["summary","completeness","reliability","observed","reviewed","missing","blockers"],"additionalProperties":false},"readiness":{"type":"object","properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","message"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}},"consequence":{"anyOf":[{"type":"object","properties":{"primary_risk":{"anyOf":[{"type":"string"},{"type":"null"}]},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}]},"time_horizon_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"if_ignored":{"anyOf":[{"type":"string"},{"type":"null"}]},"if_followed":{"anyOf":[{"type":"string"},{"type":"null"}]},"financial":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["primary_risk","risk_level","time_horizon_days","if_ignored","if_followed","financial"],"additionalProperties":false},{"type":"null"}]},"next_step":{"type":"object","properties":{"recommended_action":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorization":{"anyOf":[{"type":"string","enum":["authorized","review_required","unavailable"]},{"type":"null"}]},"required_review_steps":{"type":"array","items":{"type":"string"}}},"required":["recommended_action","authorization","required_review_steps"],"additionalProperties":false},"metrics":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"traffic_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","conversions","conversion_rate","traffic_share","quality_score"],"additionalProperties":false},"analysis_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"timezone":{"type":"string"}},"required":["start","end","timezone"],"additionalProperties":false},{"type":"null"}]}},"required":["object","source","decision","primary_reason","reasons","context","evidence","readiness","limitations","consequence","next_step","metrics","analysis_window"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string"},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false}},"required":["object","data","has_more","next_cursor","note","window"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"decisions.list"}},"/sites/{site}/decisions/{source_id}":{"get":{"operationId":"decisions_get","summary":"Source decision","description":"One source's Decision with its reasons, evidence, limitations and next review step. Only the briefing and source decisions state Decisions (scale, hold, stop); never infer one from analytics, signals or evidence.","tags":["Decisions"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"source_id","in":"path","required":true,"description":"Source id from the briefing.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"source_decision"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"source_id":{"type":"string"},"locked":{"type":"boolean"},"decision":{"anyOf":[{"type":"object","properties":{"object":{"type":"string","const":"decision"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["source","affiliate"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","type","channel","role"],"additionalProperties":false},"decision":{"type":"object","properties":{"state":{"type":"string","enum":["available","unavailable"]},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","posture","confidence"],"additionalProperties":false},"primary_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"context":{"type":"array","items":{"type":"string"}},"evidence":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"completeness":{"anyOf":[{"type":"string"},{"type":"null"}]},"reliability":{"anyOf":[{"type":"string"},{"type":"null"}]},"observed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"reviewed":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"currency":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["summary","completeness","reliability","observed","reviewed","missing","blockers"],"additionalProperties":false},"readiness":{"type":"object","properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","message"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}},"consequence":{"anyOf":[{"type":"object","properties":{"primary_risk":{"anyOf":[{"type":"string"},{"type":"null"}]},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}]},"time_horizon_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"if_ignored":{"anyOf":[{"type":"string"},{"type":"null"}]},"if_followed":{"anyOf":[{"type":"string"},{"type":"null"}]},"financial":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["primary_risk","risk_level","time_horizon_days","if_ignored","if_followed","financial"],"additionalProperties":false},{"type":"null"}]},"next_step":{"type":"object","properties":{"recommended_action":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorization":{"anyOf":[{"type":"string","enum":["authorized","review_required","unavailable"]},{"type":"null"}]},"required_review_steps":{"type":"array","items":{"type":"string"}}},"required":["recommended_action","authorization","required_review_steps"],"additionalProperties":false},"metrics":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"traffic_share":{"anyOf":[{"type":"number"},{"type":"null"}]},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","conversions","conversion_rate","traffic_share","quality_score"],"additionalProperties":false},"analysis_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"timezone":{"type":"string"}},"required":["start","end","timezone"],"additionalProperties":false},{"type":"null"}]}},"required":["object","source","decision","primary_reason","reasons","context","evidence","readiness","limitations","consequence","next_step","metrics","analysis_window"],"additionalProperties":false},{"type":"null"}]},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]}},"required":["id","name","posture"],"additionalProperties":false}}},"required":["object","site","source_id","locked","decision","variants"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"decisions.get"}},"/sites/{site}/decisions/{source_id}/feedback":{"post":{"operationId":"decisions_feedback","summary":"Give feedback on a Decision","description":"Tells OneLence whether a source's current Decision was useful, already acted on, not relevant or based on wrong data. Pass the posture the Decision showed; if it changed since, read it again first.","tags":["Decisions"],"security":[{"oauth2":["workspace:write"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"source_id","in":"path","required":true,"description":"source.id of the Decision.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["scale","hold","stop"],"description":"The posture the Decision showed."},"feedback":{"type":"string","enum":["useful","already_acted","not_relevant","data_wrong"]},"note":{"type":"string","maxLength":500},"start":{"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","type":"string","maxLength":40},"end":{"description":"Window end, inclusive for a date. Defaults to now.","type":"string","maxLength":40}},"additionalProperties":false,"required":["decision","feedback"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"decision_feedback"},"source_id":{"type":"string"},"decision":{"type":"string","enum":["scale","hold","stop"]},"feedback":{"type":"string","enum":["useful","already_acted","not_relevant","data_wrong"]},"status":{"type":"string","enum":["created","updated","unchanged"]},"recorded_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","source_id","decision","feedback","status","recorded_at"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"workspace:write","x-onelence-capability":"decisions.feedback"}},"/sites/{site}/sources":{"get":{"operationId":"sources_list","summary":"List sources","description":"The traffic sources on a site with visitors, conversions and, for sources on the decision board, their posture. Context sources (owned, utility) have no Decision. A visitor who arrived from several sources counts under each. Without start and end, counts cover the last 30 completed UTC days (see window).","tags":["Sources"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"group","in":"query","required":false,"schema":{"type":"string","enum":["decision","acquisition","owned","utility"]}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["source","affiliate"]}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"source"},"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["source","affiliate"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"group":{"type":"string","enum":["decision","acquisition","owned","utility"]},"posture":{"anyOf":[{"type":"string","enum":["scale","hold","stop"]},{"type":"null"}]},"metrics":{"type":"object","properties":{"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"traffic_share":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["visitors","conversions","conversion_rate","traffic_share"],"additionalProperties":false}},"required":["object","id","name","type","channel","role","group","posture","metrics"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false}},"required":["object","data","has_more","next_cursor","window"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"sources.list"}},"/sites/{site}/source-comparison":{"get":{"operationId":"source_comparisons_get","summary":"Compare two sources","description":"Two sources side by side for one window: visitors, conversions, conversion rate, observed revenue and their Decision and signal state. It ranks nothing and is not a Decision.","tags":["Sources"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"a","in":"query","required":true,"description":"First source id or name, for example from the sources list.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"b","in":"query","required":true,"description":"Second source id or name.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"source_comparison"},"site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},"disposition":{"type":"string","enum":["comparable","incomparable"]},"availability":{"type":"string","enum":["available","partial","unavailable"]},"title":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"window":{"type":"object","properties":{"start":{"type":"string"},"end_exclusive":{"type":"string"}},"required":["start","end_exclusive"],"additionalProperties":false},"a":{"type":"object","properties":{"name":{"type":"string"},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"observed_revenue":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"decision":{"anyOf":[{"type":"string"},{"type":"null"}]},"signals":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","visitors","conversions","conversion_rate","observed_revenue","decision","signals"],"additionalProperties":false},"b":{"type":"object","properties":{"name":{"type":"string"},"visitors":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversion_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"observed_revenue":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"decision":{"anyOf":[{"type":"string"},{"type":"null"}]},"signals":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","visitors","conversions","conversion_rate","observed_revenue","decision","signals"],"additionalProperties":false},"metrics":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"a":{"type":"string"},"b":{"type":"string"},"delta":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["label","a","b","delta"],"additionalProperties":false}},"limitations":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}},"required":["object","site","disposition","availability","title","summary","window","a","b","metrics","limitations","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"source_comparisons.get"}},"/sites/{site}/signals":{"get":{"operationId":"signals_list","summary":"Signals","description":"Material observed changes, active first, then recent. Filter by group or by a source id. Signals are observations, not Decisions.","tags":["Signals"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"group","in":"query","required":false,"description":"active = still holding; recent = ended in the last weeks. Default both.","schema":{"type":"string","enum":["active","recent"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","expired","retracted","superseded"]}},{"name":"source_id","in":"query","required":false,"description":"Only signals about this source.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"include_suppressed","in":"query","required":false,"description":"Include signals the team suppressed (default false).","schema":{"type":"boolean"}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"signal"},"id":{"type":"string"},"kind":{"type":"string","const":"observation"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"object","properties":{"kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","id","label"],"additionalProperties":false},"source_ids":{"type":"array","items":{"type":"string"}},"metric":{"type":"string"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"type":"string"},{"type":"null"}]},"materiality":{"anyOf":[{"type":"string"},{"type":"null"}]},"stability":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","expired","retracted","superseded"]},"group":{"type":"string","enum":["active","recent"]},"current_window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"comparison_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"current":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false},"comparison":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false},"change":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false},"relative_change":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false}},"required":["object","id","kind","title","summary","subject","source_ids","metric","unit","direction","materiality","stability","status","group","current_window","comparison_window","current","comparison","change","relative_change"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string"},"state":{"type":"string","enum":["available","empty","unavailable"]},"truncated":{"type":"boolean"}},"required":["object","data","has_more","next_cursor","note","state","truncated"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"signals.list"}},"/sites/{site}/signals/{signal_id}":{"get":{"operationId":"signals_get","summary":"Signal","description":"One signal by id, including suppressed ones.","tags":["Signals"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"signal_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"signal"},"id":{"type":"string"},"kind":{"type":"string","const":"observation"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"object","properties":{"kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","id","label"],"additionalProperties":false},"source_ids":{"type":"array","items":{"type":"string"}},"metric":{"type":"string"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"type":"string"},{"type":"null"}]},"materiality":{"anyOf":[{"type":"string"},{"type":"null"}]},"stability":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","expired","retracted","superseded"]},"group":{"type":"string","enum":["active","recent"]},"current_window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"comparison_window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"current":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false},"comparison":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false},"change":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false},"relative_change":{"type":"object","properties":{"state":{"type":"string","enum":["measured","missing","unavailable","not_applicable"]},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","value","currency"],"additionalProperties":false}},"required":["object","id","kind","title","summary","subject","source_ids","metric","unit","direction","materiality","stability","status","group","current_window","comparison_window","current","comparison","change","relative_change"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"signals.get"}},"/sites/{site}/evidence-items":{"get":{"operationId":"evidence_list","summary":"Evidence gaps","description":"Missing or partial evidence behind sources, campaigns and partners, who needs to act and a link to it. action is null when OneLence offers no step to take now; url is null when the item has no page. Filter by source, entity type or work bucket.","tags":["Evidence"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Window start: a date (YYYY-MM-DD) or ISO 8601 date-time. Defaults to 30 days before end.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Window end, inclusive for a date. Defaults to now.","schema":{"type":"string","maxLength":40}},{"name":"source_id","in":"query","required":false,"description":"Only work items for this source.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","enum":["source","campaign","affiliate_partner"]}},{"name":"bucket","in":"query","required":false,"description":"operator_action_required = someone must act.","schema":{"type":"string","enum":["operator_action_required","collecting_or_unresolved","system_unavailable","conflict_requiring_review"]}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"evidence_item"},"entity":{"type":"object","properties":{"type":{"type":"string"},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["type","id","source_id","name"],"additionalProperties":false},"bucket":{"anyOf":[{"type":"string","enum":["operator_action_required","collecting_or_unresolved","system_unavailable","conflict_requiring_review"]},{"type":"null"}]},"needs":{"type":"array","items":{"type":"object","properties":{"evidence":{"type":"string"},"availability":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["evidence","availability","reason","owner"],"additionalProperties":false}},"action":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["label","description"],"additionalProperties":false},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","entity","bucket","needs","action","url"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string"},"summary":{"type":"object","properties":{"total":{"anyOf":[{"type":"number"},{"type":"null"}]},"ready":{"anyOf":[{"type":"number"},{"type":"null"}]},"partial":{"anyOf":[{"type":"number"},{"type":"null"}]},"missing":{"anyOf":[{"type":"number"},{"type":"null"}]},"blocked":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["total","ready","partial","missing","blocked"],"additionalProperties":false}},"required":["object","data","has_more","next_cursor","note","summary"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"evidence.list"}},"/sites/{site}/changes":{"get":{"operationId":"changes_list","summary":"Recorded changes","description":"Business changes the team recorded on a site (budget, offer, pricing, tracking, creative, campaign, partner, email, social post, launch, TV or radio, outdoor, influencer, press, event), newest first, and whether the period after each can be observed yet. Each row includes the category, end date, picture, link and markets when they were recorded, and the target the change was recorded on. Pass start and end for the changes made in a period.","tags":["Changes"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"start","in":"query","required":false,"description":"Only changes made on or after this date (YYYY-MM-DD) or ISO 8601 date-time. Without it, every change.","schema":{"type":"string","maxLength":40}},{"name":"end","in":"query","required":false,"description":"Only changes made up to this date (inclusive) or ISO 8601 date-time.","schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 10, max 24).","schema":{"type":"integer","minimum":1,"maximum":24}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"recorded_change"},"id":{"type":"string"},"label":{"type":"string"},"occurred_at":{"type":"string"},"timezone":{"type":"string"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["source","source_family","source_set","portfolio"]},"label":{"type":"string"}},"required":["kind","label"],"additionalProperties":false},"observation_scope":{"type":"string","enum":["target","portfolio"]},"affected_sources":{"type":"array","items":{"type":"string"}},"family":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"type":"string","enum":["budget_change","campaign_change","creative_change","partner_change","email_campaign","social_post","pricing_change","offer_change","tracking_change","site_launch","tv_radio_ad","outdoor_ad","influencer_campaign","press_coverage","event_sponsorship","other"]},{"type":"null"}]},"ends_on":{"anyOf":[{"type":"string"},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"link_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"markets":{"type":"array","items":{"type":"string"}},"quantified_change":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"recorded_at":{"type":"string"},"observation_state":{"type":"string","enum":["not_eligible","observation_pending","observation_ready","insufficient_evidence","dependency_unavailable"]}},"required":["object","id","label","occurred_at","timezone","target","observation_scope","affected_sources","family","category","ends_on","image_url","link_url","markets","quantified_change","note","recorded_at","observation_state"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string"},"unreadable":{"type":"number"}},"required":["object","data","has_more","next_cursor","note","unreadable"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"changes.list"},"post":{"operationId":"changes_create","summary":"Record a change","description":"Records a change the team made outside OneLence (budget, offer, pricing, tracking, creative, campaign, partner, email, social post, launch, or offline activity such as a TV or radio ad, billboard, influencer campaign, press coverage or event), on one source or the whole site, so OneLence can observe the period after it. Offline activity is recorded on the whole site only. Optional ends_on, image_url, link_url and markets are stored with the change when they are sent. It changes nothing on ad platforms.","tags":["Changes"],"security":[{"oauth2":["workspace:write"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120,"description":"What changed, in a few words, e.g. \"Raised the TikTok budget\"."},"occurred_on":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Local date of the change (YYYY-MM-DD)."},"time":{"description":"Local time (HH:MM). Default 12:00.","type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":80,"description":"IANA time zone, e.g. Europe/Rome."},"source_id":{"description":"The source it was made on (from the sources list). Without it, the whole site.","type":"string","minLength":1,"maxLength":300},"family":{"type":"string","enum":["budget_change","campaign_change","creative_change","partner_change","email_campaign","social_post","pricing_change","offer_change","tracking_change","site_launch","tv_radio_ad","outdoor_ad","influencer_campaign","press_coverage","event_sponsorship","other"]},"ends_on":{"description":"Last local date the change ran through (YYYY-MM-DD), from the start date through 730 days after it.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"image_url":{"description":"https address of a picture, at most 2048 characters, without a username or password.","type":"string","maxLength":2048},"link_url":{"description":"https address for the change, at most 2048 characters, without a username or password.","type":"string","maxLength":2048},"markets":{"description":"One to 30 different two-letter country codes, such as IT or DE.","maxItems":30,"type":"array","items":{"type":"string"}},"quantified_change":{"type":"object","properties":{"metric":{"type":"string","enum":["commission_rate","budget","spend_cap","price","discount_rate","other"]},"metric_label":{"description":"Required when metric is other.","type":"string","minLength":1,"maxLength":80},"change":{"type":"string","enum":["from_to","set_to","delta"]},"before":{"type":"string","pattern":"^-?\\d{1,16}(?:\\.\\d{1,6})?$"},"after":{"type":"string","pattern":"^-?\\d{1,16}(?:\\.\\d{1,6})?$"},"delta":{"type":"string","pattern":"^-?\\d{1,16}(?:\\.\\d{1,6})?$"},"unit":{"type":"string","enum":["currency","percent_rate","percentage_points","relative_percent","count"]},"currency":{"description":"ISO code, for unit currency.","type":"string","pattern":"^[A-Z]{3}$"},"period":{"type":"string","enum":["day","week","month"]}},"required":["metric","change","unit"],"additionalProperties":false},"note":{"type":"string","maxLength":1000}},"additionalProperties":false,"required":["label","occurred_on","timezone"]}}}},"responses":{"200":{"description":"With dry_run=true: what would change. Nothing is applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"recorded_change_receipt"},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["created","existing"]},"label":{"type":"string"},"occurred_at":{"type":"string"},"timezone":{"type":"string"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["source","source_family","source_set","portfolio"]},"label":{"type":"string"}},"required":["kind","label"],"additionalProperties":false},"family":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantified_change":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string"}},"required":["object","id","status","label","occurred_at","timezone","target","family","quantified_change","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"workspace:write","x-onelence-capability":"changes.create"}},"/sites/{site}/business-context":{"get":{"operationId":"business_context_get","summary":"Business context","description":"What the team told OneLence about the business (offer, sales cycle, order value, margin and acquisition-cost targets), for a site or the workspace default. These are entered values, not measurements.","tags":["Context"],"security":[{"oauth2":["account:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"business_context"},"scope":{"type":"string","enum":["site","workspace","none"]},"site":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},{"type":"null"}]},"note":{"type":"string"},"offer_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"market_familiarity":{"anyOf":[{"type":"string"},{"type":"null"}]},"conversion_readiness":{"anyOf":[{"type":"string"},{"type":"null"}]},"growth_mode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sales_cycle":{"anyOf":[{"type":"string"},{"type":"null"}]},"price_point":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"average_order_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"annual_contract_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"gross_margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptable_cac":{"anyOf":[{"type":"number"},{"type":"null"}]},"lead_to_customer_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"payback_window_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"learning_budget":{"anyOf":[{"type":"number"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","scope","site","note","offer_type","market_familiarity","conversion_readiness","growth_mode","sales_cycle","price_point","currency","average_order_value","annual_contract_value","gross_margin_pct","acceptable_cac","lead_to_customer_rate_pct","payback_window_days","learning_budget","notes","updated_at"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"account:read","x-onelence-capability":"business_context.get"}},"/business-context":{"patch":{"operationId":"business_context_update","summary":"Update the business context","description":"Changes the workspace's business context (offer, sales cycle, order value, margin and acquisition-cost targets, notes). Only the fields passed change; each replaces the stored value and null clears one. Previous values are not kept. Owners and admins only.","tags":["Context"],"security":[{"oauth2":["workspace:write"]},{"bearerToken":[]}],"parameters":[{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"offer_type":{"anyOf":[{"type":"string","maxLength":180},{"type":"null"}]},"market_familiarity":{"type":"string","enum":["low","medium","high","unknown"]},"conversion_readiness":{"type":"string","enum":["low","medium","high","unknown"]},"growth_mode":{"type":"string","enum":["education","trust","curiosity","performance","unknown"]},"sales_cycle":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"price_point":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Za-z]{3}$"},{"type":"null"}]},"average_order_value":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"annual_contract_value":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"gross_margin_pct":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":100},{"type":"null"}]},"acceptable_cac":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"lead_to_customer_rate_pct":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":100},{"type":"null"}]},"payback_window_days":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"learning_budget":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":800},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"business_context"},"scope":{"type":"string","enum":["site","workspace","none"]},"site":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"}},"required":["id","domain"],"additionalProperties":false},{"type":"null"}]},"note":{"type":"string"},"offer_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"market_familiarity":{"anyOf":[{"type":"string"},{"type":"null"}]},"conversion_readiness":{"anyOf":[{"type":"string"},{"type":"null"}]},"growth_mode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sales_cycle":{"anyOf":[{"type":"string"},{"type":"null"}]},"price_point":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"average_order_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"annual_contract_value":{"anyOf":[{"type":"number"},{"type":"null"}]},"gross_margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptable_cac":{"anyOf":[{"type":"number"},{"type":"null"}]},"lead_to_customer_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"payback_window_days":{"anyOf":[{"type":"number"},{"type":"null"}]},"learning_budget":{"anyOf":[{"type":"number"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","scope","site","note","offer_type","market_familiarity","conversion_readiness","growth_mode","sales_cycle","price_point","currency","average_order_value","annual_contract_value","gross_margin_pct","acceptable_cac","lead_to_customer_rate_pct","payback_window_days","learning_budget","notes","updated_at"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"workspace:write","x-onelence-capability":"business_context.update","x-onelence-admin-only":true}},"/sites/{site}/campaign-contexts":{"get":{"operationId":"campaign_contexts_list","summary":"Campaign contexts","description":"Campaigns the team described on a site: objective, promise, audience, landing page and the spend they entered.","tags":["Context"],"security":[{"oauth2":["decisions:read"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"source_key","in":"query","required":false,"description":"Only campaigns on this source.","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"campaign_context"},"id":{"type":"string"},"source_key":{"type":"string"},"source_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"type":{"type":"string","enum":["unknown","ad_campaign","organic_post","referral_placement","email_send","community_post","partner_placement","other"]},"objective":{"type":"string","enum":["unknown","awareness","traffic","engagement","leads","conversions","sales","retargeting","trust"]},"demand_job":{"type":"string","enum":["unknown","create_demand","reframe_demand","capture_demand","convert_demand","retain_demand"]},"status":{"type":"string","enum":["unknown","running","paused","ended","draft"]},"promise":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"type":"string"},{"type":"null"}]},"primary_cta":{"anyOf":[{"type":"string"},{"type":"null"}]},"landing_page_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"context_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"reported_spend":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["amount","currency","period_start","period_end"],"additionalProperties":false},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","source_key","source_name","name","type","objective","demand_job","status","promise","audience","primary_cta","landing_page_url","context_url","reported_spend","note","updated_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"decisions:read","x-onelence-capability":"campaign_contexts.list"},"post":{"operationId":"campaign_contexts_save","summary":"Save a campaign context","description":"Creates or updates the description of a campaign on a source (objective, promise, audience, landing page, entered spend), matched by source and name. Fields passed replace the stored values, which are not kept; fields left out stay as they are.","tags":["Context"],"security":[{"oauth2":["workspace:write"]},{"bearerToken":[]}],"parameters":[{"name":"site","in":"path","required":true,"description":"Site domain (e.g. example.com) or site id. Defaults to the workspace's newest active site.","schema":{"type":"string","minLength":1,"maxLength":253}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_key":{"type":"string","minLength":1,"maxLength":300,"description":"source_key from the campaign contexts list, or a source id."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Campaign name; the same name updates that campaign."},"type":{"type":"string","enum":["unknown","ad_campaign","organic_post","referral_placement","email_send","community_post","partner_placement","other"]},"objective":{"type":"string","enum":["unknown","awareness","traffic","engagement","leads","conversions","sales","retargeting","trust"]},"demand_job":{"type":"string","enum":["unknown","create_demand","reframe_demand","capture_demand","convert_demand","retain_demand"]},"status":{"type":"string","enum":["unknown","running","paused","ended","draft"]},"promise":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"audience":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"primary_cta":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"landing_page_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"context_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"reported_spend":{"description":"Spend the team confirms for this campaign; null clears it.","anyOf":[{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"period_start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"period_end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false,"required":["source_key","name"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"campaign_context"},"id":{"type":"string"},"source_key":{"type":"string"},"source_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"type":{"type":"string","enum":["unknown","ad_campaign","organic_post","referral_placement","email_send","community_post","partner_placement","other"]},"objective":{"type":"string","enum":["unknown","awareness","traffic","engagement","leads","conversions","sales","retargeting","trust"]},"demand_job":{"type":"string","enum":["unknown","create_demand","reframe_demand","capture_demand","convert_demand","retain_demand"]},"status":{"type":"string","enum":["unknown","running","paused","ended","draft"]},"promise":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"type":"string"},{"type":"null"}]},"primary_cta":{"anyOf":[{"type":"string"},{"type":"null"}]},"landing_page_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"context_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"reported_spend":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}]},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["amount","currency","period_start","period_end"],"additionalProperties":false},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","source_key","source_name","name","type","objective","demand_job","status","promise","audience","primary_cta","landing_page_url","context_url","reported_spend","note","updated_at"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"workspace:write","x-onelence-capability":"campaign_contexts.save"}},"/event-definitions":{"get":{"operationId":"event_definitions_list","summary":"Conversion events","description":"The conversion events defined in this workspace: display name and the event name the SDK sends.","tags":["Tracking"],"security":[{"oauth2":["tracking:read"]},{"bearerToken":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page (default 25, max 100).","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"event_definition"},"id":{"type":"string"},"name":{"type":"string"},"event_name":{"type":"string"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","name","event_name","kind","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:read","x-onelence-capability":"event_definitions.list"},"post":{"operationId":"event_definitions_create","summary":"Define a conversion event","description":"Adds a conversion event so OneLence reports it, e.g. \"Demo booked\" sent by the SDK as demo_booked.","tags":["Tracking"],"security":[{"oauth2":["tracking:write"]},{"bearerToken":[]}],"parameters":[{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Display name, e.g. \"Demo booked\"."},"event_name":{"type":"string","minLength":1,"maxLength":200,"description":"Event name the SDK sends, e.g. demo_booked."}},"additionalProperties":false,"required":["name","event_name"]}}}},"responses":{"200":{"description":"With dry_run=true: what would change. Nothing is applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"event_definition"},"id":{"type":"string"},"name":{"type":"string"},"event_name":{"type":"string"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","name","event_name","kind","created_at"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:write","x-onelence-capability":"event_definitions.create"}},"/event-definitions/{event_definition_id}":{"patch":{"operationId":"event_definitions_update","summary":"Rename a conversion event","description":"Changes a conversion event's display name or the event name the SDK sends. The new name replaces the old one, which is not kept.","tags":["Tracking"],"security":[{"oauth2":["tracking:write"]},{"bearerToken":[]}],"parameters":[{"name":"event_definition_id","in":"path","required":true,"description":"id from the event definitions list.","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)$"}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"event_name":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"event_definition"},"id":{"type":"string"},"name":{"type":"string"},"event_name":{"type":"string"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","id","name","event_name","kind","created_at"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:write","x-onelence-capability":"event_definitions.update"},"delete":{"operationId":"event_definitions_delete","summary":"Delete a conversion event","description":"Removes a conversion event definition: OneLence stops counting that event as a conversion. Events and conversions already received are kept, no longer linked to it. Owners and admins only.","tags":["Tracking"],"security":[{"oauth2":["tracking:write"]},{"bearerToken":[]}],"parameters":[{"name":"event_definition_id","in":"path","required":true,"description":"id from the event definitions list.","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)$"}},{"name":"dry_run","in":"query","required":false,"description":"true returns a preview of the change and applies nothing.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"event_definition"},"id":{"type":"string"},"deleted":{"type":"boolean","const":true}},"required":["object","id","deleted"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"tracking:write","x-onelence-capability":"event_definitions.delete","x-onelence-admin-only":true}},"/plans":{"get":{"operationId":"plans_list","summary":"Plans","description":"OneLence plans with monthly and yearly prices (USD) and limits; bots and crawlers use `monthly_bot_events`, apart from `monthly_events`; `current` marks the workspace's plan.","tags":["Billing"],"security":[{"oauth2":["billing:subscribe"]},{"bearerToken":[]}],"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"plan"},"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"current":{"type":"boolean"},"price_monthly":{"anyOf":[{"type":"number"},{"type":"null"}]},"price_yearly":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string","const":"USD"},"limits":{"type":"object","properties":{"websites":{"anyOf":[{"type":"number"},{"type":"null"}]},"team_members":{"anyOf":[{"type":"number"},{"type":"null"}]},"monthly_events":{"anyOf":[{"type":"number"},{"type":"null"}]},"monthly_bot_events":{"anyOf":[{"type":"number"},{"type":"null"}]},"monthly_conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"ai_credits_monthly":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["websites","team_members","monthly_events","monthly_bot_events","monthly_conversions","ai_credits_monthly"],"additionalProperties":false}},"required":["object","id","name","description","current","price_monthly","price_yearly","currency","limits"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["object","data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"billing:subscribe","x-onelence-capability":"plans.list"}},"/checkout-links":{"post":{"operationId":"checkout_links_create","summary":"Checkout link","description":"A OneLence billing link with the chosen plan highlighted. The user reviews and checks out in OneLence; nothing is charged here. Owners and admins only.","tags":["Billing"],"security":[{"oauth2":["billing:subscribe"]},{"bearerToken":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","minLength":1,"maxLength":80,"description":"Plan id from the plans list."},"interval":{"description":"Billing interval (default month).","type":"string","enum":["month","year"]}},"additionalProperties":false,"required":["plan"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"checkout_link"},"url":{"type":"string"},"plan":{"type":"string"},"interval":{"type":"string","enum":["month","year"]},"note":{"type":"string"}},"required":["object","url","plan","interval","note"],"additionalProperties":false}}}},"400":{"description":"Invalid input; `error.param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"subscription_required or upgrade_required; the error carries billing_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"insufficient_scope or admin_required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown endpoint, site, source or record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"This Idempotency-Key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"OneLence could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-onelence-scope":"billing:subscribe","x-onelence-capability":"checkout_links.create","x-onelence-admin-only":true}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth 2.1 with PKCE (S256). Request `resource` set to the API base URL without /v1.","flows":{"authorizationCode":{"authorizationUrl":"https://api.onelence.com/oauth/authorize","tokenUrl":"https://api.onelence.com/oauth/token","refreshUrl":"https://api.onelence.com/oauth/token","scopes":{"account:read":"Workspace name, plan, usage, sites, team, business context and integration health.","analytics:read":"Traffic, pages, funnel, conversions, events, affiliates, AI visibility, SEO and live visitors.","decisions:read":"Daily briefing, priorities, sources and their decisions, signals, evidence gaps, recorded changes and campaign context.","tracking:read":"Install instructions, your publishable key, event definitions and tracking checks.","workspace:write":"Record changes, give decision feedback and edit campaign and business context. Every change asks for your confirmation.","tracking:write":"Register sites and manage the events counted as conversions. Every change asks for your confirmation.","billing:subscribe":"Show plans and create a OneLence checkout link. Billing changes and cancellation stay in OneLence.","offline_access":"Keep access without signing in again, until you disconnect the app."}}}},"bearerToken":{"type":"http","scheme":"bearer","description":"A personal access token (olpat_…) from Settings → Developer."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"8 to 200 visible ASCII characters. Retries with the same key and request return the stored response for 24 hours.","schema":{"type":"string","minLength":8,"maxLength":200}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message"],"properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","billing_error","permission_error","rate_limit_error","api_error"]},"code":{"type":"string","description":"Stable error code, e.g. site_not_found or insufficient_scope."},"message":{"type":"string","description":"Readable explanation, safe to show to the user."},"param":{"type":"string","description":"The input field the error is about, when there is one."}},"additionalProperties":true}}},"Preview":{"type":"object","required":["object","capability","summary"],"properties":{"object":{"type":"string","const":"preview"},"capability":{"type":"string"},"summary":{"type":"object","required":["title","details"],"properties":{"title":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}}}}