Catalog/workflow-ab-bucket

Workflow

Deterministic A/B bucketing API

Hashes userId+experiment into [0,1) and assigns a sticky A/B/n variant by cumulative weight split, so the same user always lands in the same bucket. Answers 'Which experiment variant is this user in?', 'How do I split traffic deterministically?'.

Price$0.02per request
MethodPOST
Route/v1/workflow/ab-bucket
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
ab-testbucketingexperimentsplit-testvariantdeterministicstickyworkflow
API URLhttps://x402.hexl.dev/v1/workflow/ab-bucket
Integration docs
Example request
{
  "userId": "user-42",
  "experiment": "checkout-color",
  "variants": [
    {
      "name": "control",
      "weight": 50
    },
    {
      "name": "treatment",
      "weight": 50
    }
  ]
}
Example response
{
  "variant": "treatment",
  "bucket": 0.766695,
  "percentile": 76.6695,
  "sticky": true,
  "splits": [
    {
      "name": "control",
      "share": 0.5
    },
    {
      "name": "treatment",
      "share": 0.5
    }
  ],
  "interpretation": "User 'user-42' deterministically bucketed into 'treatment' for experiment 'checkout-color'."
}
Input schema
{
  "type": "object",
  "required": [
    "userId",
    "experiment",
    "variants"
  ],
  "properties": {
    "userId": {
      "type": "string",
      "examples": [
        "user-42"
      ]
    },
    "experiment": {
      "type": "string",
      "examples": [
        "checkout-color"
      ]
    },
    "variants": {
      "type": "array",
      "examples": [
        [
          {
            "name": "control",
            "weight": 50
          },
          {
            "name": "treatment",
            "weight": 50
          }
        ]
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}