User Group

class labelbox.schema.user_group_v2.Member(email: str)[source]

Bases: object

A member of a user group.

class labelbox.schema.user_group_v2.UploadReport(lines: List[UploadReportLine])[source]

Bases: object

The report of the upload members mutation.

class labelbox.schema.user_group_v2.UploadReportLine(email: str, result: str, error: str | None = None)[source]

Bases: object

A single line in the CSV report of the upload members mutation. Both errors and successes are reported here.

Example output when using dataclasses.asdict(): >>> { >>> ‘lines’: [ >>> { >>> ‘email’: ‘…’, >>> ‘result’: ‘Not added’, >>> ‘error’: ‘User not found in the current organization’ >>> }, >>> { >>> ‘email’: ‘…’, >>> ‘result’: ‘Not added’, >>> ‘error’: ‘Member already exists in group’ >>> }, >>> { >>> ‘email’: ‘…’, >>> ‘result’: ‘Added’, >>> ‘error’: ‘’ >>> } >>> ] >>> }

class labelbox.schema.user_group_v2.UserGroupV2(client: Client)[source]

Bases: object

Upload members to a user group.

upload_members(group_id: str, role: str, emails: List[str]) UploadReport | None[source]

Upload members to a user group.

Parameters:
  • group_id – A valid ID of the user group.

  • role – The name of the role to assign to the uploaded members as it appears in the UI on the Import Members popup.

  • emails – The list of emails of the members to upload.

Returns:

The report of the upload members mutation.

Return type:

UploadReport

Raises:
  • ResourceNotFoundError – If the role is not found.

  • LabelboxError – If the upload fails.

  • For indicvidual email errors, the error message is available in the UploadReport.