POST
/
url-ab-tests
Create URL A/B Test
curl --request POST \
  --url https://jmpy.me/api/v1/url-ab-tests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "primary_url_id": "<string>",
  "short_code": "<string>",
  "url_type": "<string>",
  "subdomain": "<string>",
  "branded_domain": "<string>",
  "variants": [
    {}
  ],
  "variants[].name": "<string>",
  "variants[].destination_url": "<string>",
  "variants[].traffic_weight": 123,
  "description": "<string>",
  "hypothesis": "<string>",
  "traffic_split_mode": "<string>",
  "conversions_enabled": true,
  "min_sample_size": 123,
  "confidence_level": 123
}
'
Create a new A/B test for a short URL to compare different destination pages and optimize for conversions.

Body Parameters

name
string
required
The name of the A/B test.
primary_url_id
string
The UUID of an existing primary short URL to run the A/B test on. If omitted, a new rotator short link will be programmatically created and launched.
short_code
string
Optional custom short code alias for the new rotator link (only used if primary_url_id is omitted).
url_type
string
default:"standard"
Optional. The domain context to use for the new rotator link. One of standard, branded, or subdomain.
subdomain
string
Optional. The verified subdomain name to use for the new rotator link (required if url_type is subdomain).
branded_domain
string
Optional. The verified branded custom domain to use for the new rotator link (required if url_type is branded).
variants
object[]
required
Array of variant configurations. At least 2 variants are required.
variants[].name
string
Name of the variant (e.g., “Control”, “Page B”).
variants[].destination_url
string
required
The destination URL for this variant.
variants[].traffic_weight
number
Percentage of traffic to route to this variant. Defaults to an equal split among all variants if not specified. Must sum to 100 if traffic_split_mode is weighted.
description
string
Optional description for the test.
hypothesis
string
Optional hypothesis explaining the expected outcome of the test.
traffic_split_mode
string
default:"equal"
How traffic is split. One of equal or weighted.
conversions_enabled
boolean
default:false
Optional. Enable conversion tracking (leads, sales, signups) for this test.
min_sample_size
number
default:"100"
Minimum number of clicks required before statistical significance is calculated.
confidence_level
number
default:"95"
Target confidence level percentage (e.g., 90, 95, 99).

Request Examples

curl -X POST "https://jmpy.me/api/v1/url-ab-tests" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Landing Page CTA Test",
    "primary_url_id": "url_abc123",
    "variants": [
      { "name": "Control", "destination_url": "https://mysite.com/landing-a", "traffic_weight": 50 },
      { "name": "Variant B", "destination_url": "https://mysite.com/landing-b", "traffic_weight": 50 }
    ]
  }'

Use Cases

Create a standard A/B test split equally between two destinations.
const response = await fetch('https://jmpy.me/api/v1/url-ab-tests', {
  method: 'POST',
  headers: { 
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: "Headline Test",
    primary_url_id: "url_123",
    variants: [
      { name: "Original", destination_url: "https://site.com/a" },
      { name: "New Headline", destination_url: "https://site.com/b" }
    ]
  })
});
Slowly roll out a new page to only 10% of users.
const response = await fetch('https://jmpy.me/api/v1/url-ab-tests', {
  method: 'POST',
  headers: { 
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: "New Feature Rollout",
    primary_url_id: "url_123",
    traffic_split_mode: "weighted",
    variants: [
      { name: "Stable", destination_url: "https://site.com/v1", traffic_weight: 90 },
      { name: "Beta", destination_url: "https://site.com/v2", traffic_weight: 10 }
    ]
  })
});

List A/B Tests

View your existing tests

Start Test

Launch a created test

Short URL Details

Get primary URL ID

Analytics

Monitor test performance

Response Examples

{
  "test": {
    "id": "test_url_789",
    "user_id": "usr_55555",
    "name": "Landing Page CTA Test",
    "primary_url_id": "url_abc123",
    "status": "draft",
    "variants": [
      {
        "id": "var_a",
        "test_id": "test_url_789",
        "name": "Control",
        "destination_url": "https://mysite.com/landing-a",
        "traffic_weight": 50
      },
      {
        "id": "var_b",
        "test_id": "test_url_789",
        "name": "Variant B",
        "destination_url": "https://mysite.com/landing-b",
        "traffic_weight": 50
      }
    ]
  },
  "message": "A/B test created successfully"
}