# Workspace

5 endpoints.

## List the workspace's members

```http
GET https://orbitwrite.com/api/v1/workspaces/{organizationId}/members
```

Everyone in the workspace, oldest first. Any member may read it, as may the workspace's API keys.

The length of this list is what a plan's member limit is checked against — see `GET /entitlements` for the limit itself.

**Authentication:** bearer token or session cookie.

### Path parameters

- `organizationId` (string, required)

### Responses

#### 200

The workspace's members

- `members` (WorkspaceMember[], required)
  - `id` (string, required)
  - `userId` (string, required)
  - `role` (string, required)
  - `createdAt` (string, required)
  - `lastSeenAt` (string | null, required) — Last activity in this workspace, or null when none is on record. A member active within the last two minutes is online.
  - `user` (object, required)
    - `name` (string, required)
    - `email` (string, required)
    - `image` (string | null, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

## Check whether a slug is free for this workspace

```http
GET https://orbitwrite.com/api/v1/workspaces/{organizationId}/slug-availability
```

Normalises `slug` the way `PATCH /workspaces/{organizationId}` does and reports whether that call would accept it. The workspace's own current slug is available.

**Authentication:** session cookie.

### Path parameters

- `organizationId` (string, required)

### Query parameters

- `slug` (string, required)

### Responses

#### 200

Whether the slug is available

- `slug` (string, required)
- `available` (boolean, required)
- `reason` (string | null, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

## Update workspace settings

```http
PATCH https://orbitwrite.com/api/v1/workspaces/{organizationId}
```

Partial update of the workspace name, slug, timezone and public-page fields. Owner/admin only; runs through Better Auth's organization plugin.

Changing `slug` moves the workspace's app URLs and its link-in-bio page (`orbw.link/{slug}`); links to the old slug stop working. A slug another workspace holds is a 409.

**Authentication:** session cookie.

### Path parameters

- `organizationId` (string, required)

### Request body (`application/json`)

- `name` (string, optional)
- `slug` (string, optional) — The workspace's URL segment, in the app and at orbw.link. Changing it breaks existing links; the old slug does not redirect.
- `bio` (string, optional)
- `website` (string, optional)
- `publicProfileTitle` (string, optional)
- `publicProfileTheme` (string, optional)
- `publicProfileCustom` (string, optional)
- `publicProfileEnabled` (boolean, optional)
- `timezone` (string, optional)

### Responses

#### 200

The workspace after the update

- `id` (string, required)
- `name` (string, required)
- `slug` (string | null, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

#### 404

The resource does not exist

- `error` (string, required)
- `issues` (any[], optional)

#### 409

Conflicts with an existing resource

- `error` (string, required)
- `issues` (any[], optional)

## Change a member's role

```http
PATCH https://orbitwrite.com/api/v1/workspaces/{organizationId}/members/{memberId}
```

**Authentication:** session cookie.

### Path parameters

- `organizationId` (string, required)
- `memberId` (string, required)

### Request body (`application/json`)

- `role` (string, required, one of `owner`, `admin`, `manager`, `member`)

### Responses

#### 200

The member's new role

- `memberId` (string, required)
- `role` (string, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

#### 404

The resource does not exist

- `error` (string, required)
- `issues` (any[], optional)

## Remove a member from the workspace

```http
DELETE https://orbitwrite.com/api/v1/workspaces/{organizationId}/members/{memberId}
```

**Authentication:** session cookie.

### Path parameters

- `organizationId` (string, required)
- `memberId` (string, required)

### Responses

#### 200

The member was removed

- `memberId` (string, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

#### 404

The resource does not exist

- `error` (string, required)
- `issues` (any[], optional)
