Assigns up to 100 users to a role, each against its own set of structures. This endpoint supports partial success: the memberships that were created are returned in structure_memberships, and any assignment that failed is reported in errors with a status code and a reason. A response with a populated errors array is still a 200.
Use this endpoint to give users a role on specific structures. A role defined in the Roles section grants nothing until you assign it here.
Each entry in user_structure_pairs names one user and the structures to assign the role on. Different users can have different structures in the same request.
A role applies only to the structure types it is scoped to. Check a role's
structure_type_idswith the Get a role endpoint before you assign it, and pass structures of those types only.
Requirements
Limits
user_structure_pairsholds 1 to 100 entries per request, so one call assigns at most 100 users.- Each entry's
structure_idsholds 1 to 10 structures, so one user takes at most 10 structures per call.
Split larger assignments across several requests.
Partial success
This endpoint reports failures per assignment rather than failing the whole request. A response that created some memberships and rejected others is still a 200:
structure_membershipsholds the memberships that were created.errorsholds one entry per rejected(user, structure)pair, each carrying the user ID, the structure ID, a status code, and a human-readable reason.user_nameis included where it could be resolved, so you can surface the failure without a second lookup.
Always inspect errors. An empty array is the only confirmation that every assignment succeeded.