Bulk resolve experiment assignments
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 or exposure record cannot be durably written.
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 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 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.
1 <= lengthValue in
- "production"
- "development"
0 < value <= 9007199254740991Request 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 } ] }}