---
title: "Create a workspace"
description: "PubNio API workspaces.create: create a workspace. Request fields, examples in five clients, errors, and idempotency."
---

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

# Create a workspace

Create a workspace with [`POST /api/v1/workspaces`](https://pubnio.com/api/v1/docs#tag/workspaces/POST/api/v1/workspaces). Requires a signed-in user, in the web app or the CLI; API keys are not accepted and MCP cannot call it.

## Request

An omitted defaultTimezone starts at UTC. New queues use the workspace default when they do not set their own time zone.

| Body field        | Type   | Required |
| ----------------- | ------ | -------- |
| `name`            | string | Yes      |
| `defaultTimezone` | string | No       |

## Response

- HTTP 201: an object with `id`, `name`, `defaultTimezone`, `role`.
  - `role`: `owner`, `member`

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const created = await client.workspaces.create({
  name: "Studio",
  defaultTimezone: "America/New_York",
});
```

Create this client with a signed-in person's `accessToken`, not an `apiKey`.

### Python

The Python SDK authenticates with a workspace API key, which this operation does not accept, so it has no method for it.

### cURL

```sh
curl -X POST "https://pubnio.com/api/v1/workspaces" \
  -H "Authorization: Bearer $PUBNIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Studio","defaultTimezone":"America/New_York"}'
```

### CLI

```sh
pnio workspaces create --name Studio --default-timezone America/New_York
```

### MCP execute

```js
async () => {
  const response = await codemode.request({
    method: "POST",
    path: "/api/v1/workspaces",
    body: { name: "Studio", defaultTimezone: "America/New_York" },
  });
  return response.data;
};
```

## Errors

- [`invalid-timezone`](https://pubnio.com/docs/problems/invalid-timezone/): HTTP 422, Invalid time zone

It also declares the problems [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

No key, so a retried `POST` is not deduplicated. Read the current state before you retry.

## Limits

- API keys and MCP cannot call it. A signed-in person runs it from the CLI after `pnio auth login` or in the web app.

## Related

- [Workspaces operations](https://pubnio.com/docs/reference/#workspaces)
- [Accounts and connections](https://pubnio.com/docs/accounts/)

Source: https://pubnio.com/docs/reference/workspaces-create/index.mdx
