Skip to content

Workspaces

The Workspaces resource covers listing, iterating, creating, fetching, updating, and deleting workspaces.

Initialization

from tally import Tally

client = Tally(api_key="tly_your_api_key_here")

List Workspaces

Method

client.workspaces.all(page: int = 1) -> PaginatedWorkspaces

Example

result = client.workspaces.all(page=1)

print(result.page, result.total, result.has_more)
for workspace in result.items:
    print(workspace.id, workspace.name)

Notes

  • The returned collection is items, not data
  • PaginatedWorkspaces exposes page, limit, total, and has_more

Official Reference

List Workspaces


Iterate Workspaces

for workspace in client.workspaces:
    print(workspace.name, len(workspace.members))

Create Workspace

Method

client.workspaces.create(name: str) -> Workspace

Example

workspace = client.workspaces.create(name="Marketing Team")
print(workspace.id, workspace.name)

Official Reference

Create Workspace


Get Workspace

Method

client.workspaces.get(workspace_id: str) -> Workspace

Example

workspace = client.workspaces.get("ws_123")
print(workspace.name)
print(len(workspace.members), len(workspace.invites))

Official Reference

Get Workspace


Update Workspace

Method

client.workspaces.update(
    workspace_id: str,
    name: str,
) -> None

Example

client.workspaces.update("ws_123", name="Marketing and Sales")

Notes

  • The SDK currently treats this endpoint as returning no value

Official Reference

Update Workspace


Delete Workspace

Method

client.workspaces.delete(workspace_id: str) -> None

Official Reference

Delete Workspace


Models

Workspace

Workspace dataclass

Represents a Tally workspace.

PaginatedWorkspaces

PaginatedWorkspaces dataclass

Represents a paginated response of workspaces.