import weflayr
from weflayr.openapi.models import GetAbTestsStatus
client = weflayr.client() # reads WEFLAYR_API_KEY
client.get_ab_tests(status=GetAbTestsStatus.ACTIVE, limit=20)
const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
await weflayr.api.getAbTests({
client,
throwOnError: true,
query: {
status: 'active',
limit: 20,
},
});
curl "https://app.weflayr.com/api/ab-tests/?status=active&limit=20" \
-H "Authorization: Bearer $WEFLAYR_API_KEY"
{
"ab_tests": [
{
"slug": "summarize-profile-ab-test",
"name": "Summarize profile A/B test",
"version": 1,
"archived_at": null,
"updated_at": "2026-10-24T10:00:00+00:00",
"url": "https://app.weflayr.com/dashboard/ab-tests/?test=summarize-profile-ab-test"
}
],
"next_cursor": null,
"has_more": false
}
{"error": "Invalid or missing API key. Send it as \"Authorization: Bearer <your key>\"."}
{"error": "Invalid request payload.", "detail": [{"field": "limit", "error": "Input should be less than or equal to 1000"}]}
A/B tests
Get A/B tests
Get each A/B test of the project by its live version.
GET
/
api
/
ab-tests
/
import weflayr
from weflayr.openapi.models import GetAbTestsStatus
client = weflayr.client() # reads WEFLAYR_API_KEY
client.get_ab_tests(status=GetAbTestsStatus.ACTIVE, limit=20)
const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
await weflayr.api.getAbTests({
client,
throwOnError: true,
query: {
status: 'active',
limit: 20,
},
});
curl "https://app.weflayr.com/api/ab-tests/?status=active&limit=20" \
-H "Authorization: Bearer $WEFLAYR_API_KEY"
{
"ab_tests": [
{
"slug": "summarize-profile-ab-test",
"name": "Summarize profile A/B test",
"version": 1,
"archived_at": null,
"updated_at": "2026-10-24T10:00:00+00:00",
"url": "https://app.weflayr.com/dashboard/ab-tests/?test=summarize-profile-ab-test"
}
],
"next_cursor": null,
"has_more": false
}
{"error": "Invalid or missing API key. Send it as \"Authorization: Bearer <your key>\"."}
{"error": "Invalid request payload.", "detail": [{"field": "limit", "error": "Input should be less than or equal to 1000"}]}
Ordered by slug, without their document: read one with Get A/B test for it.
Parameters
“active” lists the ones not archived, “archived” the archived ones, “all” both.
The route is paginated: pass the previous page’s
next_cursor, as is, to get the next page. has_more says whether another page exists.import weflayr
from weflayr.openapi.models import GetAbTestsStatus
client = weflayr.client() # reads WEFLAYR_API_KEY
client.get_ab_tests(status=GetAbTestsStatus.ACTIVE, limit=20)
const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
await weflayr.api.getAbTests({
client,
throwOnError: true,
query: {
status: 'active',
limit: 20,
},
});
curl "https://app.weflayr.com/api/ab-tests/?status=active&limit=20" \
-H "Authorization: Bearer $WEFLAYR_API_KEY"
{
"ab_tests": [
{
"slug": "summarize-profile-ab-test",
"name": "Summarize profile A/B test",
"version": 1,
"archived_at": null,
"updated_at": "2026-10-24T10:00:00+00:00",
"url": "https://app.weflayr.com/dashboard/ab-tests/?test=summarize-profile-ab-test"
}
],
"next_cursor": null,
"has_more": false
}
{"error": "Invalid or missing API key. Send it as \"Authorization: Bearer <your key>\"."}
{"error": "Invalid request payload.", "detail": [{"field": "limit", "error": "Input should be less than or equal to 1000"}]}