GamebeastDocs
Dashboard

Bulk resolve experiment assignments

POST
/sdk/v2/experiments/assignments/bulk

Resolve experiment assignments for up to 250 units sharing the same unit type. Creates and persists assignments as needed (weighted hash or round-robin), identically to the single-unit endpoints. Designed for server-side SDKs (e.g. Roblox) that batch-assign players rather than polling per-user. Returns a map of distinctId → assignment array; IDs with no active assignments appear with an empty array. Fails the whole batch with 503 if any assignment cannot be durably written.

Also answers 503 with a retry-after header (seconds) when the service is shedding load or the batch passes its deadline; retry after that delay.

Supply units with an optional per-unit context, plus an optional sharedContext carrying facts the whole batch shares — the unit's own values win per key. The older distinctIds array is still accepted but resolves without context, so targeted experiments will not match those units.

Authorization

sdkApiKey
authorization<token>

SDK (public) key, prefixed gb_pk_ (older keys: sdk_). Send it as the authorization header value. Scoped to one project, so it is safe to ship in a game build.

In: header

Header Parameters

environment?string

Environment alias. Defaults to development when omitted; studio is accepted as a synonym for it. Any alias outside the calling key's environment scope is rejected with 403.

Length1 <= length

Value in

  • "production"
  • "development"
project-id?integer
Range0 < value <= 9007199254740991

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/sdk/v2/experiments/assignments/bulk" \  -H "Content-Type: application/json" \  -d '{    "unitType": "user",    "units": [      {        "distinctId": "string"      }    ]  }'
{  "assignments": {    "property1": [      {        "experimentId": 0,        "groupId": 0,        "automaticGroupId": 0,        "overrideGroupId": 0,        "status": "active",        "source": "weightedHash",        "assignmentVersion": 0      }    ],    "property2": [      {        "experimentId": 0,        "groupId": 0,        "automaticGroupId": 0,        "overrideGroupId": 0,        "status": "active",        "source": "weightedHash",        "assignmentVersion": 0      }    ]  }}