User Group Audit

User group audit log.

Labelbox records an event each time a person is added to a user group, removed from it or given a new role in it, each time the group is attached to or detached from a project, and when the group is deleted. Each event says who made the change, whether a person or an automation made it, and how it reached Labelbox (the app, the API, the Labelbox MCP, a CSV upload, a background task or Labelbox itself). Events are never changed or deleted. The log starts when it shipped; earlier changes are not in it.

Only people who can manage a group can read its events.

The methods on labelbox.schema.user_group.UserGroup that return the classes below are thin wrappers over the function at the bottom of this module.

class labelbox.schema.user_group_audit.UserGroupAuditActorKind(value)[source]

Bases: str, Enum

Whether a person or an automation made a group change.

AUTOMATION = 'AUTOMATION'

the API with an API key (the SDK and scripts), the Labelbox MCP, a background task, or Labelbox itself.

Type:

An automation

PERSON = 'PERSON'

A person, in the Labelbox app.

class labelbox.schema.user_group_audit.UserGroupAuditChannel(value)[source]

Bases: str, Enum

How a group change reached Labelbox.

ALIGNERR_API = 'ALIGNERR_API'

The Alignerr API.

API = 'API'

the SDK and scripts.

Type:

The API with an API key

APP = 'APP'

The Labelbox app.

BACKGROUND_TASK = 'BACKGROUND_TASK'

A background task whose requester is not known.

CSV_IMPORT = 'CSV_IMPORT'

A CSV of members uploaded to the group.

MCP = 'MCP'

The Labelbox MCP.

SYSTEM = 'SYSTEM'

for example removing a deleted user from their groups.

Type:

Labelbox itself, with no requester

class labelbox.schema.user_group_audit.UserGroupAuditEvent(*, id: str, groupId: str, groupName: str | None = None, type: UserGroupAuditEventType | str, occurredAt: datetime, actorKind: UserGroupAuditActorKind | str, channel: UserGroupAuditChannel | str, actorUserId: str | None = None, automation: str | None = None, memberUserId: str | None = None, previousRoleId: str | None = None, previousRoleName: str | None = None, roleId: str | None = None, roleName: str | None = None, projectId: str | None = None, projectName: str | None = None)[source]

Bases: _CamelCaseMixin

One change to a user group.

id

Stable ID of the event.

Type:

str

group_id

The group’s ID.

Type:

str

group_name

The group’s current name. None once the group is deleted.

Type:

Optional[str]

type

What changed (see UserGroupAuditEventType). Unknown values are kept as strings.

Type:

str

occurred_at

When the change was made.

Type:

datetime

actor_kind

Whether a person or an automation made the change (see UserGroupAuditActorKind).

Type:

str

channel

How the change reached Labelbox (see UserGroupAuditChannel).

Type:

str

actor_user_id

The person who made the change, or the user an automation acted for (the API key’s owner, the MCP user, the task’s requester). None when Labelbox made the change itself.

Type:

Optional[str]

automation

Which automation made the change: the API key, MCP client, task or reason. None for a person.

Type:

Optional[str]

member_user_id

The person added, removed or given a new role. None for project and group events.

Type:

Optional[str]

previous_role_id

The member’s role before a removal or role change.

Type:

Optional[str]

previous_role_name

That role’s name.

Type:

Optional[str]

role_id

The member’s role after an addition or role change.

Type:

Optional[str]

role_name

That role’s name.

Type:

Optional[str]

project_id

The project the group was attached to or detached from.

Type:

Optional[str]

project_name

That project’s name.

Type:

Optional[str]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'arbitrary_types_allowed': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'actor_kind': FieldInfo(annotation=Union[UserGroupAuditActorKind, str], required=True, alias='actorKind', alias_priority=1), 'actor_user_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='actorUserId', alias_priority=1), 'automation': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='automation', alias_priority=1), 'channel': FieldInfo(annotation=Union[UserGroupAuditChannel, str], required=True, alias='channel', alias_priority=1), 'group_id': FieldInfo(annotation=str, required=True, alias='groupId', alias_priority=1), 'group_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='groupName', alias_priority=1), 'id': FieldInfo(annotation=str, required=True, alias='id', alias_priority=1), 'member_user_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='memberUserId', alias_priority=1), 'occurred_at': FieldInfo(annotation=datetime, required=True, alias='occurredAt', alias_priority=1), 'previous_role_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='previousRoleId', alias_priority=1), 'previous_role_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='previousRoleName', alias_priority=1), 'project_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='projectId', alias_priority=1), 'project_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='projectName', alias_priority=1), 'role_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='roleId', alias_priority=1), 'role_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='roleName', alias_priority=1), 'type': FieldInfo(annotation=Union[UserGroupAuditEventType, str], required=True, alias='type', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.user_group_audit.UserGroupAuditEventType(value)[source]

Bases: str, Enum

What a group audit event records.

GROUP_ATTACHED_TO_PROJECT = 'GROUP_ATTACHED_TO_PROJECT'

its members gained access to it.

Type:

The group was attached to a project

GROUP_DELETED = 'GROUP_DELETED'

The group was deleted.

GROUP_DETACHED_FROM_PROJECT = 'GROUP_DETACHED_FROM_PROJECT'

its members lost access through it.

Type:

The group was detached from a project

MEMBER_ADDED = 'MEMBER_ADDED'

A person was added to the group.

MEMBER_REMOVED = 'MEMBER_REMOVED'

A person was removed from the group.

MEMBER_ROLE_CHANGED = 'MEMBER_ROLE_CHANGED'

A member’s role in the group changed. One event, not a removal and an addition.