Skip to content

API Overview ​

The API allows you to programmatically upload experiment datasets to AB-Labz Workbench without manual upload through the UI.

Advantages of Uploading via API ​

1. Monitoring Experiments on Dashboard ​

You can monitor all experiments on the dashboard. However, automatic analysis after each submission of updated data is available only for experiments that are delivered via API:

  • Distribution Correctness (SRM) — checking the correctness of traffic split between groups
  • Accumulated Sample — current size and percentage of target sample achievement
  • Win Probability Forecast — probability estimate of winning by key metric

2. Automatic Synchronization ​

With configured synchronization, there is no need to manually export data, each new experiment becomes immediately available in the data upload list.

How It Works ​

Dataset upload is performed with one request:

POST /api/v1/datasets/upload/?experiment_id=<id>

The file is uploaded directly to the server with on-the-fly validation:

  • Size check (200 MB limit)
  • CSV structure and UTF-8 encoding validation

Quick Start ​

python
import requests

API_KEY = 'abn_xxxxxxxxxxxxx'
BASE_URL = 'https://workbench.ab-labz.com/api/v1'
FILE_PATH = 'dataset.csv'

# One-step upload with validation
with open(FILE_PATH, 'rb') as f:
    response = requests.post(
        f'{BASE_URL}/datasets/upload/',
        params={'experiment_id': 'test_exp_001'},
        headers={
            'Authorization': f'Bearer {API_KEY}',
            'Content-Type': 'text/csv'
        },
        data=f
    )

if response.status_code == 201:
    print(f"Uploaded: {response.json()['size_mb']} MB")

Bash (cURL) ​

bash
curl -X POST "https://workbench.ab-labz.com/api/v1/datasets/upload/?experiment_id=test_exp" \
  -H "Authorization: Bearer abn_xxxxxxxxxxxxx" \
  -H "Content-Type: text/csv" \
  --data-binary @dataset.csv

After upload, the dataset is immediately available for analysis in the UI via Data Preparation → Get via API.

AB-Labz - Product Experiments Laboratory