Skip to content

Create a workspace

PubNio API workspaces.create: create a workspace. Request fields, examples in five clients, errors, and idempotency.

Create a workspace with 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 has each field’s type.

Examples

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.

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

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"}'
pnio workspaces create --name Studio --default-timezone America/New_York
async () => {
  const response = await codemode.request({
    method: "POST",
    path: "/api/v1/workspaces",
    body: { name: "Studio", defaultTimezone: "America/New_York" },
  });
  return response.data;
};

Errors

It also declares the problems most operations 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.

Type to search…

↑↓ navigate↵ selectEsc close