---
title: Create a workspace
description: "Creates a workspace and the caller's owner membership atomically via create_workspace_with_owner."
api_method: POST
api_path: "/v1/workspaces"
canonical_url: https://wiblo.app/docs/developers/api/workspaces/create-workspace
last_updated: 2026-08-03T21:24:33+02:00
md_url: https://wiblo.app/docs/developers/api/workspaces/create-workspace.md
---

# Create a workspace

`POST /v1/workspaces`

Creates a workspace and the caller's owner membership atomically via `create_workspace_with_owner`. `name` is the only required field: an omitted `slug` derives from the name server-side (the canonical normalizer), an omitted `owner_name` defaults from the caller's profile display name, an omitted `owner_avatar_url` defaults from the profile photo (explicit `null` means born with no photo), and the owner member row's accent seeds from the profile's `accent_hue`. Per-user rate-limited at 5/60s (creation is heavy and abuse-sensitive). Reserved-slug rejection fires before the RPC — including for derived slugs.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | `string` | No | Omitted means the server derives the slug from the name via the canonical normalizer. |
| `name` | `string` | Yes |  |
| `avatar_url` | `string \| null` | No | Workspace logo URL; omitted or null means no logo. |
| `accent_hue` | `"red" \| "coral" \| "orange" \| "green" \| "teal" \| "blue" \| ...` | No | Stored monogram accent key; omitted means the tile keeps the deterministic id-hash colour. |
| `owner_name` | `string` | No | Omitted means the server defaults it from your profile display name. |
| `owner_email` | `string` | No |  |
| `owner_avatar_url` | `string \| null` | No | Omitted defaults to your profile avatar; explicit null means born with no photo. |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/workspaces \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "..."
}'
```

**TypeScript**

```ts
import { createSdk, createWorkspace } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await createWorkspace({
  client: sdk,
  body: {
    "name": "..."
  },
})
```

## Responses

**`201`** — Workspace and owner membership created. Returns `CreateWorkspaceResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace` | `CreatedWorkspace` | Yes |  |
| `membership` | `CreatedWorkspaceMembership` | Yes |  |

**`400`** — Request body failed Zod validation (`VALIDATION_FAILED`). Returns `ApiErrorEnvelope`.

**`401`** — No valid Supabase session cookie was present. Returns `ApiErrorEnvelope`.

**`409`** — Slug already in use (`SLUG_TAKEN`) or the caller already owns 50 active workspaces (`WORKSPACE_LIMIT_REACHED`). Returns `ApiErrorEnvelope`.

**`422`** — Slug is reserved or fails the shape CHECK (`INVALID_SLUG`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.

### The CreatedWorkspace object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes |  |
| `slug` | `string` | Yes | The claimed slug — echoes the request's, or the server-derived one when the request omitted it. |
| `name` | `string` | Yes |  |
| `avatar_url` | `string \| null` | Yes |  |
| `accent_hue` | `"red" \| "coral" \| "orange" \| "green" \| "teal" \| "blue" \| ...` | Yes | Stored accent key; `null` means the tile derives its colour from the id hash. |
| `created_at` | `string` | Yes |  |

### The CreatedWorkspaceMembership object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes |  |
| `role` | `"owner"` | Yes |  |
| `linked_user_id` | `string \| null` | Yes |  |
