end_sales_page_test
End the running A/B test and keep one version.
/v1/guides/{productId}/sales-page-tests/endOnly when the creator asks you to. Needs a key with the publish option (403 api_scope_required otherwise). Ends the guide's running test; the version kept stays on the guide's link at once. Version a (the default) leaves the main page as it is; another page's version becomes the main page, as set_main_sales_page does; other hero photos go on the main page's live hero and its draft. Ask the creator which version to keep: list_sales_page_tests has each one's purchases. Refused with conflict when no test runs. Returns the ended test as list_sales_page_tests does.
curl -X POST "https://sceniq.earth/api/v1/guides/j5738kd1q9x2m7v4c6b8n0p3r5t1w9y2/sales-page-tests/end" \
-H "Authorization: Bearer $SCENIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"keep": "b"
}'Path parameters
- productIdstring · guide idrequired
Id of the guide (a product of type map). From
list_guidesorcreate_guide.
Body parameters
- keepstringoptional
The version to keep, by its key in
list_sales_page_tests: a (the default, the main page as it is), b, c or d.
Returns
200 OK with this object.
- testIdstring · salesPageTests idrequired
The test's id.
- numbernumberrequired
The test's number within the guide (Test 1, Test 2 ...).
- kindstringrequired
pages: published pages of the guide against the main page; hero: the main page with other hero photos.
pageshero - statusstringrequired
Whether the test still splits the guide link's visitors.
runningended - startedAtnumberrequired
When it started (Unix time in milliseconds).
- endedAtnumber or nullrequired
When it ended, or null while it runs.
- keptArmstring or nullrequired
The key of the version kept when it ended (a to d), or null while it runs.
- armsarray of objectsrequired
Its versions, A first, with their counts.
Show 10 fieldsHide fields
- keystringrequired
The version's key: a is the main page as it is, b to d the others (
end_sales_page_testkeep). - weightnumberrequired
The version's share of the guide link's visitors, in percent.
- labelstringrequired
What the studio calls the version: a page's version and name (V2 · TikTok launch), Current photos or Other photos.
- listingIdstring or null · sales page idrequired
A test of pages: the version's page; null for a test of hero photos, or once the page was deleted.
- photosarray of stringsrequired
A test of hero photos: the version's first photos (at most three); [] for a test of pages.
- viewsnumberrequired
Page views of this version.
- visitorsnumberrequired
People who saw this version.
- checkoutViewsnumberrequired
Checkouts opened from this version.
- payStartsnumberrequired
Payments started from this version.
- purchasesnumberrequired
Purchases made from this version that stand (refunds left out).
- truncatedbooleanrequired
true when the test had more purchases than one read counts (5,000): purchases are then a floor.
{
"testId": "kd7t4w8y2a6c0e4g8j2m6q0s4v8x2z6b",
"number": 1,
"kind": "pages",
"status": "ended",
"startedAt": 1790586840000,
"endedAt": 1790673240000,
"keptArm": "b",
"arms": [
{
"key": "a",
"weight": 50,
"label": "V1 · Main page",
"listingId": "kr7w1e3r5t7y9v1j3p5p7a9s1d3f5g7h",
"photos": [],
"views": 412,
"visitors": 361,
"checkoutViews": 38,
"payStarts": 21,
"purchases": 14
},
{
"key": "b",
"weight": 50,
"label": "V2 · TikTok launch",
"listingId": "kr7a3c5e7g9j1m3p5s7v9y1b3d5f7h9k",
"photos": [],
"views": 398,
"visitors": 352,
"checkoutViews": 47,
"payStarts": 29,
"purchases": 19
}
],
"truncated": false
}Errors
Every error is { error: { code, message } }. Act on the code.
- 400invalid_argumentA required field is missing, a field is unknown, or a value does not match its type (the Convex validator's path and value are in the message).
- 400invalid_requestA writer refused a value: a map link on a host that is not allowed, a title that is too long, a date that does not exist, too many items in a list. The message is the writer's own sentence.
- 401unauthenticatedThe request carries no key. Send it as Authorization: Bearer sk_sceniq_... (or X-Api-Key).
- 401invalid_api_keyThe key is unknown, revoked or expired.
- 403api_scope_requiredA read-only key called a write operation, or a key without the publish option called publish_changes.
- 403forbiddenThe key belongs to a creator account that is no longer active.
- 404not_foundThe id does not exist or belongs to another creator. The two answers are identical on purpose, so ids never reveal what exists.
- 409conflictThe request clashes with the row's current state. The message says what to change.
- 413payload_too_largeA JSON body over 2 MB, an image over 6 MB, a batch upload over 19 MB, or an MCP message over 2 MB.
- 429rate_limitedOver a limit: requests per key per minute, per creator per hour, uploads per key per minute, or check_links per guide per hour.
- 500internal_errorAn unexpected failure. The message is hidden on purpose.