> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# collaborator

## Collaborator

Immutable representation of a user's collaboration on a project.

A Collaborator binds a user to a project with a specific role and permissions.
Collaborators are contextual - the same user can have different roles on
different projects.

Collaborator attributes are immutable. To modify the role, use the update()
method which returns a new Collaborator instance. To remove access, use remove().

**Examples**

```python theme={null}
# Get collaborators for a project
project = Project.get(name="My Project")
collaborators = project.collaborators

for collab in collaborators:
    print(f"{collab.email} - {collab.role}")

# Check if a specific user has access
viewer = next((c for c in collaborators if c.email == "viewer@example.com"), None)
if viewer:
    print(f"User has {viewer.role} access")

# Filter by role using the CollaboratorRole enum
from galileo import CollaboratorRole
editors = [c for c in collaborators if c.role == CollaboratorRole.EDITOR]

# Update a collaborator's role directly on the object
updated_collab = collab.update(role=CollaboratorRole.EDITOR)

# Remove a collaborator
collab.remove()
```

### created\_at

```python theme={null}
def created_at(self) -> datetime | None
```

Get the creation timestamp.

### email

```python theme={null}
def email(self) -> str | None
```

Get the user's email address.

### first\_name

```python theme={null}
def first_name(self) -> str | None
```

Get the user's first name.

### id

```python theme={null}
def id(self) -> str
```

Get the collaboration record ID.

### last\_name

```python theme={null}
def last_name(self) -> str | None
```

Get the user's last name.

### permissions

```python theme={null}
def permissions(self) -> list[Any] | None
```

Get the permissions for this collaboration.

Returns None if no permissions data is available (either omitted by
the API or explicitly empty). A non-empty list indicates specific
actions the API caller can perform on this collaborator record.

### project\_id

```python theme={null}
def project_id(self) -> str
```

Get the project ID.

### remove

```python theme={null}
def remove(self) -> None
```

Remove this collaborator from the project.

Revokes the user's access to the project. After calling this method,
the collaborator object should no longer be used.

**Examples**

```python theme={null}
# Remove a collaborator
collab = project.collaborators[0]
collab.remove()
```

### role

```python theme={null}
def role(self) -> CollaboratorRole
```

Get the collaboration role.

### to\_dict

```python theme={null}
def to_dict(self) -> dict[str, Any]
```

Convert collaborator to dictionary representation.

## Returns

dict: Dictionary with collaborator properties.

### update

```python theme={null}
def update(self, role: CollaboratorRole) -> Collaborator
```

Update this collaborator's role.

Creates a new Collaborator instance with the updated role. The original
instance remains unchanged (immutability is preserved).

**Arguments**

* `role`: The new role to assign (CollaboratorRole enum).

### user\_id

```python theme={null}
def user_id(self) -> str
```

Get the user ID.
