Saltar al contenido principal

Workspaces API

The workspaces API lets you create, read, update, and delete workspaces within your organization.

Procedures​

workspace.list​

List all workspaces the authenticated user has access to.

Type: Query Required scope: read:workspace

GET /trpc/workspace.list

Response:

{
"result": {
"data": [
{
"id": "ws_abc123",
"name": "Engineering",
"slug": "engineering",
"description": "Engineering team workspace",
"color": "#6366f1",
"icon": "code",
"projectCount": 5,
"memberCount": 12,
"createdAt": "2026-01-15T10:30:00Z"
}
]
}
}

workspace.byId​

Get a specific workspace by ID.

Type: Query Required scope: read:workspace

GET /trpc/workspace.byId?input={"id":"ws_abc123"}

workspace.create​

Create a new workspace.

Type: Mutation Required scope: write:workspace

POST /trpc/workspace.create

Input:

{
"name": "Marketing",
"slug": "marketing",
"description": "Marketing team workspace",
"color": "#f59e0b",
"icon": "megaphone"
}

Response:

{
"result": {
"data": {
"id": "ws_def456",
"name": "Marketing",
"slug": "marketing",
"description": "Marketing team workspace",
"color": "#f59e0b",
"icon": "megaphone",
"createdAt": "2026-03-18T16:00:00Z"
}
}
}

workspace.update​

Update a workspace's settings.

Type: Mutation Required scope: write:workspace

POST /trpc/workspace.update

Input:

{
"id": "ws_abc123",
"name": "Engineering Team",
"description": "Updated description"
}

workspace.delete​

Delete a workspace and all its contents.

Type: Mutation Required scope: write:workspace (requires workspace admin role)

POST /trpc/workspace.delete

Input:

{
"id": "ws_abc123"
}

workspace.listMembers​

List members of a specific workspace.

Type: Query Required scope: read:workspace

GET /trpc/workspace.listMembers?input={"workspaceId":"ws_abc123"}

workspace.addMember​

Add a member to a workspace.

Type: Mutation Required scope: write:workspace

POST /trpc/workspace.addMember

Input:

{
"workspaceId": "ws_abc123",
"userId": "usr_abc123",
"role": "member"
}

workspace.removeMember​

Remove a member from a workspace.

Type: Mutation Required scope: write:workspace

POST /trpc/workspace.removeMember

Input:

{
"workspaceId": "ws_abc123",
"userId": "usr_abc123"
}