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

# Workspaces

> Manage workspaces, members, and invitations.

<Snippet file="auth-header.mdx" />

## List workspaces

List all workspaces you belong to.

```bash theme={null}
GET /api/v1/workspaces
```

```bash Example theme={null}
curl https://api.mossdesk.com/api/v1/workspaces \
  -H "X-API-Key: moss_k_..."
```

## Create a workspace

Requires **owner** role.

```bash theme={null}
POST /api/v1/workspaces
```

<ParamField body="name" type="string" required>Workspace name</ParamField>
<ParamField body="slug" type="string" required>URL-safe slug (lowercase alphanumeric and hyphens only)</ParamField>

## List members

List all members of the current workspace.

```bash theme={null}
GET /api/v1/workspaces/members
```

## List invitations

List pending invitations. Requires **owner** role.

```bash theme={null}
GET /api/v1/workspaces/invites
```

## Create an invitation

Invite a new member to the workspace. Requires **owner** role.

```bash theme={null}
POST /api/v1/workspaces/invites
```

<ParamField body="email" type="string" required>Email address to invite</ParamField>
<ParamField body="role" type="string" default="member">Role: `member` or `owner`</ParamField>

```bash Example theme={null}
curl -X POST https://api.mossdesk.com/api/v1/workspaces/invites \
  -H "X-API-Key: moss_k_..." \
  -H "Content-Type: application/json" \
  -d '{ "email": "bob@acme.com", "role": "member" }'
```

## Revoke an invitation

Requires **owner** role.

```bash theme={null}
DELETE /api/v1/workspaces/invites/:id
```

## Accept an invitation

```bash theme={null}
POST /api/v1/workspaces/invites/accept
```

<ParamField body="token" type="string" required>Invite token</ParamField>
