Skip to Content
Documentation
Starter kits
Get Pro
Introduction
Installation

Workspaces router

An overview of the workspaces router

Procedures

The workspaces router has the following procedures:

Create a workspace

Create a new workspace.

  • Access: @protected
// Client components
const { data } = api.workspaces.create.useMutation()

// Server components
const data = await api.workspaces.create()

Check if slug is available

Check if a workspace slug is available.

  • Access: @protected
// Client components
const { data } = api.workspaces.slugAvailable.useQuery({ slug: 'my-workspace' })

// Server components
const data = await api.workspaces.slugAvailable({ slug: 'my-workspace' })

Get workspace by slug

Get a workspace by its slug and returns the workspace details, subscription, members and tags.

  • Access: @member
// Client components
const { data } = api.workspaces.get.useQuery({ slug: 'my-workspace' })

// Server components
const data = await api.workspaces.get({ slug: 'my-workspace' })

Update workspace

Update a workspace.

  • Access: @admin
// Client components
const { data } = api.workspaces.update.useMutation()

// Server components
const data = await api.workspaces.update()
Workspaces router | Saas UI