TenanciTenanci

Help centerAPI referenceA/B tests

A/B tests

Landing page tests on the same address.

List A/B tests

GET/domains/{id}/split-testsdomains:readLanding+

runningLimit counts the tests running across the whole organization (all domains) and carries the plan cap in max (null = no cap; the Landing plan allows 5). Over the cap, POST …/start returns 409 split_limit.

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

Request

cURL
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "items": [
    {
      "id": "lp-corte-de-outubro-k3x9",
      "name": "Corte de outubro",
      "path": "/oferta",
      "scope": "path",
      "status": "draft",
      "goal": "Lead",
      "variants": [
        {
          "key": "a",
          "name": "Original (A)",
          "url": "https://lp.agendafacil.com/barbearia-do-ze/",
          "weight": 50
        },
        {
          "key": "b",
          "name": "Com vídeo",
          "url": "https://lp.agendafacil.com/barbearia-do-ze-video/",
          "weight": 50
        }
      ],
      "winner": null,
      "autoStop": true,
      "mode": "fixed",
      "rebalancedAt": null,
      "startedAt": null,
      "endedAt": null,
      "createdAt": "2026-10-15T10:00:00.000Z",
      "url": "https://barbeariadoze.com.br/oferta"
    }
  ],
  "runningLimit": {
    "running": 2,
    "max": 5
  }
}

Create an A/B test

POST/domains/{id}/split-testsdomains:writeLanding+

The edge assigns each visitor and serves their landing page on the domain's own address. It starts as a draft (draft); start it with POST …/start. Up to 50 tests per domain. Results: GET /domains/:id/analytics/experiments/:exp with the test id.

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

Body

  • namestringrequiredmax 80

    Test name.

  • pathstringmax 300

    Address on the domain where the test runs (default /).

  • scope"host" | "path"

    path (default): only the entry page and what it loads; host: the whole domain belongs to the test.

  • goalstring | null

    Goal that decides the test (name used in tenanci.track() or in a page goal). Required to start.

  • variantsobject[]required≤ 4 itens

    2 to 4 landing pages; the first one is the control (a).

    • namestringmax 60

      Variant name (default: Original (A), Variante B…).

    • urlstringrequiredmax 2048

      Landing page address (on another host, not on the test's own domain).

    • weightinteger≥ -9007199254740991, ≤ 9007199254740991

      Traffic percentage (0–100). When given, they must add up to 100; without weights, traffic is split evenly.

  • autoStopboolean

    End on its own once there's a safe winner (default true) and notify by email.

  • mode"fixed" | "bandit"

    fixed (default): fixed percentages; bandit: shifts traffic toward the winning page.

Request

cURL
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Corte de outubro","path":"/oferta","goal":"Lead","variants":[{"url":"https://lp.agendafacil.com/barbearia-do-ze/"},{"name":"Com vídeo","url":"https://lp.agendafacil.com/barbearia-do-ze-video/"}]}'

Response 201

{
  "id": "lp-corte-de-outubro-k3x9",
  "name": "Corte de outubro",
  "path": "/oferta",
  "scope": "path",
  "status": "draft",
  "goal": "Lead",
  "variants": [
    {
      "key": "a",
      "name": "Original (A)",
      "url": "https://lp.agendafacil.com/barbearia-do-ze/",
      "weight": 50
    },
    {
      "key": "b",
      "name": "Com vídeo",
      "url": "https://lp.agendafacil.com/barbearia-do-ze-video/",
      "weight": 50
    }
  ],
  "winner": null,
  "autoStop": true,
  "mode": "fixed",
  "rebalancedAt": null,
  "startedAt": null,
  "endedAt": null,
  "createdAt": "2026-10-15T10:00:00.000Z",
  "url": "https://barbeariadoze.com.br/oferta"
}

Check a landing page

POST/domains/{id}/split-tests/check-urldomains:writeLanding+

Opens the URL the way the edge will and warns about what may go wrong: errors, not HTML, redirects to another domain, absolute <base href> or a script that checks its own address.

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

Body

  • urlstringrequiredmax 2048

    Landing page address.

Request

cURL
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests/check-url" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://lp.agendafacil.com/barbearia-do-ze-video/"}'

Response 200

{
  "ok": true,
  "status": 200,
  "finalUrl": "https://lp.agendafacil.com/barbearia-do-ze-video/",
  "title": "Barbearia do Zé | Agende seu corte",
  "warnings": []
}

Get an A/B test

GET/domains/{id}/split-tests/{testId}domains:readLanding+

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

  • testIdpath · stringrequired

    Test id (lp-…)

Request

cURL
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests/<testId>" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "id": "lp-corte-de-outubro-k3x9",
  "name": "Corte de outubro",
  "path": "/oferta",
  "scope": "path",
  "status": "draft",
  "goal": "Lead",
  "variants": [
    {
      "key": "a",
      "name": "Original (A)",
      "url": "https://lp.agendafacil.com/barbearia-do-ze/",
      "weight": 50
    },
    {
      "key": "b",
      "name": "Com vídeo",
      "url": "https://lp.agendafacil.com/barbearia-do-ze-video/",
      "weight": 50
    }
  ],
  "winner": null,
  "autoStop": true,
  "mode": "fixed",
  "rebalancedAt": null,
  "startedAt": null,
  "endedAt": null,
  "createdAt": "2026-10-15T10:00:00.000Z",
  "url": "https://barbeariadoze.com.br/oferta"
}

Update an A/B test

PATCH/domains/{id}/split-tests/{testId}domains:writeLanding+

The same fields as creation, all optional. Landing pages, address and scope only change while draft or paused (and, when paused, without changing the number of pages). The goal can't change once ended.

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

  • testIdpath · stringrequired

    Test id (lp-…)

Body

  • namestringmax 80

    Test name.

  • pathstringmax 300

    Address on the domain where the test runs (default /).

  • scope"host" | "path"

    path (default): only the entry page and what it loads; host: the whole domain belongs to the test.

  • goalstring | null

    Goal that decides the test (name used in tenanci.track() or in a page goal). Required to start.

  • variantsobject[]≤ 4 itens

    2 to 4 landing pages; the first one is the control (a).

    • namestringmax 60

      Variant name (default: Original (A), Variante B…).

    • urlstringrequiredmax 2048

      Landing page address (on another host, not on the test's own domain).

    • weightinteger≥ -9007199254740991, ≤ 9007199254740991

      Traffic percentage (0–100). When given, they must add up to 100; without weights, traffic is split evenly.

  • autoStopboolean

    End on its own once there's a safe winner (default true) and notify by email.

  • mode"fixed" | "bandit"

    fixed (default): fixed percentages; bandit: shifts traffic toward the winning page.

Request

cURL
curl -X PATCH "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests/<testId>" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"mode":"bandit","autoStop":false}'

Response 200

{
  "id": "lp-corte-de-outubro-k3x9",
  "name": "Corte de outubro",
  "path": "/oferta",
  "scope": "path",
  "status": "draft",
  "goal": "Lead",
  "variants": [
    {
      "key": "a",
      "name": "Original (A)",
      "url": "https://lp.agendafacil.com/barbearia-do-ze/",
      "weight": 50
    },
    {
      "key": "b",
      "name": "Com vídeo",
      "url": "https://lp.agendafacil.com/barbearia-do-ze-video/",
      "weight": 50
    }
  ],
  "winner": null,
  "autoStop": false,
  "mode": "bandit",
  "rebalancedAt": null,
  "startedAt": null,
  "endedAt": null,
  "createdAt": "2026-10-15T10:00:00.000Z",
  "url": "https://barbeariadoze.com.br/oferta"
}

Delete an A/B test

DELETE/domains/{id}/split-tests/{testId}domains:writeLanding+

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

  • testIdpath · stringrequired

    Test id (lp-…)

Request

cURL
curl -X DELETE "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests/<testId>" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 204

Success

Start, pause, resume, end or archive

POST/domains/{id}/split-tests/{testId}/{action}domains:writeLanding+

draft → running ⇄ paused → ended → archived. start requires the goal; start/resume return 409 if another active test uses the same address (split_overlap) or the plan's limit of running tests was reached (split_limit). end requires winner and sends every visitor to the winner; archive takes the test offline. The body is only used by end.

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

  • testIdpath · stringrequired

    Test id (lp-…)

  • actionpath · stringrequired

    start, pause, resume, end or archive

Body

  • winner"a" | "b" | "c" | "d"

    Winning variant (end only).

Request

cURL
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/split-tests/<testId>/<action>" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"winner":"b"}'

Response 200

{
  "id": "lp-corte-de-outubro-k3x9",
  "name": "Corte de outubro",
  "path": "/oferta",
  "scope": "path",
  "status": "ended",
  "goal": "Lead",
  "variants": [
    {
      "key": "a",
      "name": "Original (A)",
      "url": "https://lp.agendafacil.com/barbearia-do-ze/",
      "weight": 50
    },
    {
      "key": "b",
      "name": "Com vídeo",
      "url": "https://lp.agendafacil.com/barbearia-do-ze-video/",
      "weight": 50
    }
  ],
  "winner": "b",
  "autoStop": true,
  "mode": "fixed",
  "rebalancedAt": null,
  "startedAt": "2026-10-15T10:05:00.000Z",
  "endedAt": "2026-10-22T09:00:00.000Z",
  "createdAt": "2026-10-15T10:00:00.000Z",
  "url": "https://barbeariadoze.com.br/oferta"
}