{"openapi":"3.1.0","info":{"title":"LiveVariant API","version":"1.0.0","description":"Build, inspect and read bandit-driven A/B tests.\n\nThere are no accounts and no API keys. A test is its config, encoded into its own URLs, and its identity is a hash of that config. Reading results needs the stats secret generated when the test was built, sent in the request body; the server checks it against the hash stored inside the config itself.\n\nThese endpoints mirror the MCP tools of the same names exactly. Use MCP if your client supports it; use this if it does not.","license":{"name":"AGPL-3.0","url":"https://www.gnu.org/licenses/agpl-3.0.html"}},"servers":[{"url":"https://livevariant.com"}],"tags":[{"name":"authoring","description":"Build and check tests. No network, no state."},{"name":"results","description":"Read a running test. Needs its stats secret."}],"paths":{"/api/v1/build-test":{"post":{"operationId":"build_test","summary":"Turn variants (one element or several) into a ready-to-use test with URLs","description":"Creates a LiveVariant test and returns every URL needed to run it, plus a freshly generated stats secret.\n\nPass `variants` to test one element, or `slots` to test several at once (hero image AND call-to-action, say). With slots the test optimizes the COMBINATION: one model learns how the elements interact, which two separate tests structurally cannot see. There is no algorithm to pick either way; every test runs the same joint model, sized from its shape.\n\nBy default, nothing is registered anywhere: the config IS the test, encoded into the URLs, and the test's identity is a hash of it. Pass `publishableKey` on an account-enabled deployment to also register the new test to that key's organization, so it appears under My tests; the config and URLs are still the test, and registration failure is returned as a warning rather than failing the build. Editing a variant later produces a DIFFERENT test with its own empty history, which is usually what you want per campaign but is worth saying out loud to whoever you are building this for.\n\nThe stats secret is returned once and never again. Only its hash goes into the config, so nobody, including this service, can recover it. Give it to the person who will read the results.","tags":["authoring"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"variants":{"description":"Single-element test: two or more variants. The first is the control.","minItems":2,"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"description":"Shown in stats and in the utm stamp. Defaults to v1, v2, …","type":"string","minLength":1},"url":{"description":"Destination for redirect serving.","type":"string","format":"uri"},"image":{"description":"Image URL, for email variants.","type":"string","format":"uri"},"html":{"description":"Inline HTML, served by the SDK.","type":"string"},"markdown":{"description":"Inline markdown, served by the SDK.","type":"string"},"text":{"description":"Inline text, served by the SDK.","type":"string"},"redirectUrl":{"description":"Where a click on this variant lands, if it differs per variant.","type":"string","format":"uri"}}}},"slots":{"description":"Multi-element test: variants per element, keyed by a short name like \"hero\" or \"cta\". The test serves and learns combinations.","type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,31}$"},"additionalProperties":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"description":"Shown in stats and in the utm stamp. Defaults to v1, v2, …","type":"string","minLength":1},"url":{"description":"Destination for redirect serving.","type":"string","format":"uri"},"image":{"description":"Image URL, for email variants.","type":"string","format":"uri"},"html":{"description":"Inline HTML, served by the SDK.","type":"string"},"markdown":{"description":"Inline markdown, served by the SDK.","type":"string"},"text":{"description":"Inline text, served by the SDK.","type":"string"},"redirectUrl":{"description":"Where a click on this variant lands, if it differs per variant.","type":"string","format":"uri"}}}}},"slotRedirects":{"description":"Where clicks on ONE element land, when elements point at different pages (a hero leading to the campaign landing page, a CTA below it to pricing). Keyed like `slots`. Falls back to `redirectUrl`; a variant's own redirectUrl still wins over both. Setting any of these means every click link must name its slot, which slotLinks does for you.","type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,31}$"},"additionalProperties":{"type":"string","format":"uri"}},"name":{"description":"A label for your own reference, and the one field worth spending a merge tag on in a recurring ESP template: it is part of the test's identity, so n={{campaign_name}} mints a separate, separately readable test per campaign, and the name is what list_tests searches.","type":"string","minLength":1},"context":{"description":"Dimensions to learn a separate winner for.","maxItems":8,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Dimension name, e.g. country. Becomes ?c_<key>= on serve URLs."},"values":{"description":"Allowed values, when they are enumerable. Anything else is rejected at serving time, which is what stops a crafted URL inventing buckets. It also makes the results readable: bucket keys are one-way hashes, and a declared list is what lets stats recover \"country=nl\" from one. Worth passing even for a `from` dimension, and worth getting right the first time, since `ctx` is inside the test identity and adding values later starts a new test.","minItems":2,"type":"array","items":{"type":"string","minLength":1}},"from":{"description":"Fill this dimension from a signal the server derives, so the caller never sends it. Network signals (country, device, …) are guessed from the connection and are suppressed for proxied email fetches; utm_* are read off the link and survive a proxy intact, which makes them the reliable choice for email.","type":"string","enum":["country","continent","region","city","timezone","device","language","organization","utm_source","utm_medium","utm_campaign","utm_content","utm_term"]}},"required":["key"]}},"redirectUrl":{"description":"Where clicks land when a variant does not say.","type":"string","format":"uri"},"variantParam":{"description":"Stamp the served combination into this parameter on redirect, e.g. \"utm_content\", so the test shows up in the customer's own analytics.","type":"string","minLength":1,"maxLength":32},"publishableKey":{"description":"Registers the new test to the organization identified by a publishable key the user provides for an organization they administer. Result access stays tied to this test's stats secret. Only works on account-enabled deployments; elsewhere a warning says so and the test still works.","type":"string","pattern":"^pk_[a-z0-9]{24}$"},"region":{"description":"Where the test's state lives. A placement hint (wnam, enam, sam, weur, eeur, apac, oc, afr, me) or \"eu\" for the EU jurisdiction (state guaranteed created and kept inside the EU). Defaults to the creator's own region when the host can tell; without any, state is born wherever the FIRST request comes from, which in email is routinely a mail provider's US datacenter.","type":"string","enum":["wnam","enam","sam","weur","eeur","apac","oc","afr","me","eu"]},"serverUrl":{"description":"Self-hosted deployments only.","type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Turn variants (one element or several) into a ready-to-use test with URLs","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"testId":{"type":"string"},"config":{"type":"string","description":"The encoded config: this is the test."},"statsSecret":{"type":"string","description":"Shown once. Store it now."},"slots":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string"},"variants":{"type":"array","items":{"type":"string"}}},"required":["slot","variants"]},"description":"Canonical slot order with variant names, as stats reports them."},"combinations":{"type":"number","description":"How many distinct combinations the test chooses between."},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where the test's state will live; null means first-request placement."},"urls":{"type":"object","properties":{"serve":{"type":"string"},"click":{"type":"string"},"pixel":{"type":"string"},"manage":{"type":"string","description":"Opening this URL shows live results, and signed-in users can click 'Add to my account' to claim the test into their dashboard. It contains the stats secret in its #fragment, so share it only with people authorized to see results."},"serveNoAutoContext":{"type":"string"},"clickNoAutoContext":{"type":"string"}},"required":["serve","click","pixel","manage","serveNoAutoContext","clickNoAutoContext"]},"slotLinks":{"description":"Multi-slot tests only: the serve/click URL per element. The bare urls.serve returns 400 for these tests, because a serve must say which element it renders. The bare urls.click works when the destination is uniform (a config redirectUrl or ?to=); per-slot clicks matter as soon as an element carries its own destination, via slotRedirects or a variant redirectUrl.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"serve":{"type":"string"},"click":{"type":"string"}},"required":["serve","click"]}},"emailTemplate":{"description":"Query-parameter spelling per slot for an ESP template: wire it once, then campaign managers fill only the merge fields. All links share one identical config string (names, ctx dims, kh and the landing r=/sr= included, so serve and click stay ONE test); image links add &slot= per element. The click link needs no slot unless the test sets slotRedirects, in which case each element's click link carries its own. Absent when a variant has inline content or its own redirectUrl, which the parameter form cannot express.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"imageSrc":{"type":"string"},"linkHref":{"type":"string"}},"required":["imageSrc","linkHref"]}},"warnings":{"type":"array","items":{"type":"string"}},"registeredTo":{"description":"The organization the test was registered to, when a publishableKey was given and accepted.","type":"string"},"destinations":{"description":"Redirect destinations and whether each is a verified domain. Unverified means visitors see a 'Redirecting you to…' continue screen before landing; relay the verification warning to the user when present.","type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"verified":{"type":"boolean"}},"required":["host","verified"]}}},"required":["testId","config","statsSecret","slots","combinations","region","urls","warnings"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inspect-test":{"post":{"operationId":"inspect_test","summary":"Decode any test URL and report what it will actually do, with warnings","description":"Decodes a test and describes it: slots, variants, context, and whether it can be served by redirect. Also lints it for the mistakes that only show up once a campaign is out, such as an email test whose context comes from geo (which a mail proxy answers about itself).\n\nUse this before sending anything, and to answer 'what is this link?'.","tags":["authoring"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"test":{"type":"string","minLength":1,"description":"The test: an encoded config, or any LiveVariant URL containing one (serve, click, pixel, manage), or a query-parameter serve URL. Paste whatever you have."},"config":{"type":"string","minLength":1,"description":"Alias for `test`: the same value under the name build_test returns it as (`config`). Pass one or the other."}},"oneOf":[{"required":["test"]},{"required":["config"]}]}}}},"responses":{"200":{"description":"Decode any test URL and report what it will actually do, with warnings","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"testId":{"type":"string"},"name":{"type":"string"},"slots":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string"},"variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"formats":{"type":"array","items":{"type":"string"}},"servesByRedirect":{"type":"boolean"}},"required":["name","formats","servesByRedirect"]}}},"required":["slot","variants"]}},"combinations":{"type":"number"},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"context":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"from":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["key"]}},"resultsReadable":{"type":"boolean","description":"False when the config has no stats key, which is permanent."},"findings":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","note"]},"message":{"type":"string"}},"required":["level","message"]}}},"required":["testId","slots","combinations","region","context","resultsReadable","findings"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/generate-priors":{"post":{"operationId":"generate_priors","summary":"Turn your predictions into capped priors and embed them","description":"Takes YOUR estimate of how each variant will perform and converts it into the prior the model starts from, so a test does not spend its first visitors rediscovering what you already suspect.\n\nYou supply the guess; this does the arithmetic and the capping. That capping is the point: a prior is expressed as pseudo-observations, and it is deliberately held weak enough that real data overrides it quickly. The response says exactly how many real visitors per variant it takes to wash your guess out, so you can judge whether you have been too confident. Being wrong here costs a little early traffic, not the test.\n\nPriors are outside the identity hash, so the test keeps its id, its URLs and any history it already has.\n\nPass `when` to make the belief hold for ONE segment only (\"image B is the one for the blue segment\"). Without it the belief is about every visitor, which is a different and much stronger claim.","tags":["authoring"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"test":{"type":"string","minLength":1,"description":"The test: an encoded config, or any LiveVariant URL containing one (serve, click, pixel, manage), or a query-parameter serve URL. Paste whatever you have."},"config":{"type":"string","minLength":1,"description":"Alias for `test`: the same value under the name build_test returns it as (`config`). Pass one or the other."},"when":{"description":"Context this belief is limited to, as dimension key to value (e.g. {\"color\": \"blauw\"}). The keys must be dimensions the test declares. Omit it for a belief about every visitor.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"beliefs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"slot":{"description":"Which slot the variant belongs to. Optional for single-slot tests.","type":"string"},"variant":{"anyOf":[{"type":"string"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"Variant name or index within its slot."},"rate":{"type":"number","minimum":0,"maximum":1,"description":"Your estimate of its conversion rate, e.g. 0.04 for 4%."}},"required":["variant","rate"]}},"confidence":{"default":"medium","description":"How much your guess is worth in observations. low=5, medium=15, high=30, or give a number directly. Higher means the test trusts you for longer before the data takes over.","anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"number","exclusiveMinimum":0}]}},"required":["beliefs"],"oneOf":[{"required":["test"]},{"required":["config"]}]}}}},"responses":{"200":{"description":"Turn your predictions into capped priors and embed them","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"testId":{"type":"string"},"config":{"type":"string"},"manageUrl":{"type":"string"},"priors":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string"},"variant":{"type":"string"},"mean":{"type":"number"},"strength":{"type":"number"}},"required":["slot","variant","mean","strength"]}},"washesOutAfter":{"type":"number","description":"Roughly this many real visitors per variant and your guess stops mattering."},"notes":{"type":"array","items":{"type":"string"}}},"required":["testId","config","manageUrl","priors","washesOutAfter","notes"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/get-stats":{"post":{"operationId":"get_stats","summary":"Live results plus win probabilities and a stop/continue call","description":"Fetches a test's results and works out what they mean.\n\nAlongside the raw counts it returns the probability that each combination is genuinely best and the expected cost of stopping now and keeping the leader. Use those rather than comparing conversion rates by eye: a variant ahead 2/10 to 1/10 looks twice as good and is very close to a coin flip, and that mistake is the single most common way an A/B test gets called wrong.\n\nMulti-slot tests also report per-slot marginals: how each variant did across every combination it appeared in.\n\nNeeds the stats secret. If you have the manage URL, its #fragment IS the secret and it will be used automatically.","tags":["results"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"test":{"type":"string","minLength":1,"description":"The test: an encoded config, or any LiveVariant URL containing one (serve, click, pixel, manage), or a query-parameter serve URL. Paste whatever you have."},"config":{"type":"string","minLength":1,"description":"Alias for `test`: the same value under the name build_test returns it as (`config`). Pass one or the other."},"statsSecret":{"description":"Omit when passing a manage URL that carries it in the fragment.","type":"string"}},"oneOf":[{"required":["test"]},{"required":["config"]}]}}}},"responses":{"200":{"description":"Live results plus win probabilities and a stop/continue call","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"testId":{"type":"string"},"totalAssignments":{"type":"number"},"combinations":{"type":"array","items":{"type":"object","properties":{"choice":{"type":"array","items":{"type":"string"}},"pulls":{"type":"number"},"conversions":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"probabilityBest":{"type":"number"}},"required":["choice","pulls","conversions","conversionRate","probabilityBest"]}},"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pulls":{"type":"number"},"conversions":{"type":"number"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["name","pulls","conversions","conversionRate"]}}},"decision":{"type":"object","properties":{"leader":{"type":"string"},"canStop":{"type":"boolean"},"expectedLossIfStoppingNow":{"type":"number"},"relativeLoss":{"type":"number"},"advice":{"type":"string"}},"required":["leader","canStop","expectedLossIfStoppingNow","relativeLoss","advice"]},"contextBuckets":{"type":"number"},"bySignal":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"pulls":{"type":"number"},"conversions":{"type":"number"}},"required":["pulls","conversions"]}}},"excluded":{"type":"object","properties":{"total":{"type":"number"},"bySource":{"type":"number"},"byWindow":{"type":"number"}},"required":["total","bySource","byWindow"]}},"required":["testId","totalAssignments","combinations","slots","decision","contextBuckets","bySignal","excluded"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/get-test-status":{"post":{"operationId":"get_test_status","summary":"Is the test claimed, and will its destinations show the interstitial","description":"Reports what the deployment's registry knows about a test: whether it is claimed into an account (and by which organization), and whether each redirect destination is a verified domain.\n\nUnverified destinations work, but visitors see a 'Redirecting you to…' continue screen first. When you see verified: false, tell the user to verify the domain under Settings on the dashboard; the three ways are a DNS TXT record, serving the well-known file, or having the SDK tag with their publishable key live in the site's source. If the test is unclaimed, remind them the manage URL claims it in one click when opened signed in.\n\nRequires the test's stats secret, the same as get_stats. A manage URL's #fragment is used automatically.","tags":["results"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"test":{"type":"string","minLength":1,"description":"The test: an encoded config, or any LiveVariant URL containing one (serve, click, pixel, manage), or a query-parameter serve URL. Paste whatever you have."},"config":{"type":"string","minLength":1,"description":"Alias for `test`: the same value under the name build_test returns it as (`config`). Pass one or the other."},"statsSecret":{"description":"Omit when passing a manage URL that carries it in the fragment.","type":"string"}},"oneOf":[{"required":["test"]},{"required":["config"]}]}}}},"responses":{"200":{"description":"Is the test claimed, and will its destinations show the interstitial","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"testId":{"type":"string"},"claimed":{"type":"boolean","description":"Whether the test is registered to an organization."},"org":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The claiming organization's name; null when unclaimed."},"destinations":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string"},"verified":{"type":"boolean"}},"required":["host","verified"]},"description":"Every host this test can redirect a visitor to. verified: false means the continue screen shows before landing there."}},"required":["testId","claimed","org","destinations"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/list-tests":{"post":{"operationId":"list_tests","summary":"Lists the tests saved to the caller's account, with search.","description":"Lists tests registered to the signed-in account, newest first, with cursor pagination and an optional case-insensitive name filter. Only exists on deployments with accounts, and only answers for an identified caller: unlike every other tool, WHOSE tests these are cannot be expressed as an argument. Each entry carries the encoded config, which inspect_test and get_stats accept directly.","tags":["authoring"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"description":"Case-insensitive substring filter on the test name","type":"string","maxLength":200},"cursor":{"description":"Opaque cursor from a previous page's nextCursor","type":"string"},"limit":{"type":"integer","minimum":1,"maximum":100}}}}}},"responses":{"200":{"description":"Lists the tests saved to the caller's account, with search.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tests":{"type":"array","items":{"type":"object","properties":{"testId":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"encoded":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"addedAt":{"type":"number"}},"required":["testId","name","encoded","region","addedAt"]}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["tests","nextCursor"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/register-test":{"post":{"operationId":"register_test","summary":"Puts an existing test under an organization's My tests","description":"Registers a test you built earlier to the organization a publishable key belongs to, so it shows under My tests and its stats are readable from the dashboard without the secret.\n\nUse this only when the user provides both the test's stats secret and a publishable key for an organization they administer. The stats secret must match the hash inside the config, and the publishable key identifies the organization to register into. Prefer passing publishableKey to build_test directly: it registers at creation in one step. Keyless tests cannot be registered this way (nothing to prove with); they register through the tag on a verified domain. The organization can remove a listing from its dashboard (the test itself keeps serving).","tags":["results"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"config":{"type":"string","minLength":1,"description":"The encoded test config (from build_test or any test URL)."},"statsSecret":{"type":"string","minLength":1,"description":"The test's stats secret, exactly as build_test returned it."},"publishableKey":{"type":"string","pattern":"^pk_[a-z0-9]{24}$","description":"A publishable key for the target organization, provided by a user authorized to register tests there."}},"required":["config","statsSecret","publishableKey"]}}}},"responses":{"200":{"description":"Puts an existing test under an organization's My tests","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registered":{"type":"boolean","const":true},"org":{"type":"string","description":"The organization that now owns the test."},"testId":{"type":"string"}},"required":["registered","org","testId"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/upload-image":{"post":{"operationId":"upload_image","summary":"Store an image and get back a protected URL to use as a variant","description":"Uploads an image to the deployment's asset store and returns its URL, for use as a variant's `image` (email tests) or `url`.\n\nThe returned URL is deliberately not fetchable on its own: assets are only served with a short-lived signature that the serve endpoints mint per request, so uploading here does not create free static hosting. Use `previewUrl` (valid for an hour) to check what was stored.\n\nStorage is content-addressed: the id is the sha256 of the bytes, so uploading the same image twice is harmless and returns the same URL. Raster images only; SVG is refused because it can carry scripts. Not every deployment enables asset hosting, and this tool says so plainly when yours does not.","tags":["results"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"string","minLength":1,"maxLength":8000000,"description":"The image bytes, base64-encoded (plain base64, not a data: URL)."},"contentType":{"type":"string","enum":["image/png","image/jpeg","image/gif","image/webp","image/avif"],"description":"The image's actual type; the server stores and serves it as this."},"serverUrl":{"description":"Self-hosted deployments only.","type":"string","format":"uri"},"uploadToken":{"description":"Optional self-hosted upload authorization for deployments configured with LV_ASSET_UPLOAD_TOKEN; omit for the hosted service.","type":"string"}},"required":["data","contentType"]}}}},"responses":{"200":{"description":"Store an image and get back a protected URL to use as a variant","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"assetId":{"type":"string","description":"sha256 of the bytes; the id inside the URL."},"url":{"type":"string","description":"Use this as the variant's image/url. 403s without a signature, by design."},"previewUrl":{"type":"string","description":"Signed for one hour, to verify the upload."},"size":{"type":"number"},"contentType":{"type":"string"}},"required":["assetId","url","previewUrl","size","contentType"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/variant-brief":{"post":{"operationId":"variant_brief","summary":"Channel-specific specs and rules for drafting the variants themselves","description":"Returns the constraints to write or generate test variants against, for email or web, plus the rules that decide whether a test can be read at all once it runs.\n\nThe one that matters most: one idea per slot. To vary two elements, give the test two slots and let it learn the combination, rather than bundling both changes into one variant and never learning which half worked. Ask for this before drafting variants, then produce them yourself against what it returns.","tags":["authoring"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"goal":{"type":"string","minLength":1,"description":"What the test should improve, e.g. 'more demo bookings'."},"channel":{"type":"string","enum":["email","web"]},"format":{"type":"string","enum":["image","text","html","url"],"description":"What each variant will be."},"count":{"default":2,"type":"integer","minimum":2,"maximum":10},"audience":{"description":"Who sees it, if that shapes the copy.","type":"string"}},"required":["goal","channel","format"]}}}},"responses":{"200":{"description":"Channel-specific specs and rules for drafting the variants themselves","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"goal":{"type":"string"},"variantCount":{"type":"number"},"specs":{"type":"array","items":{"type":"string"}},"rules":{"type":"array","items":{"type":"string"}},"hosting":{"type":"string"},"nextStep":{"type":"string"}},"required":["goal","variantCount","specs","rules","hosting","nextStep"]}}}},"400":{"description":"The request could not be used as given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The stats secret did not match this test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}