---
title: "POST /v1/workspaces"
method: POST
path: "/v1/workspaces"
tags: ["Workspaces"]
---

# POST /v1/workspaces

`POST /v1/workspaces`

## Request

- Base URL: `https://api.tokenbooks.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tokenbooks.io/v1/workspaces`
- Auth: API key in header `x-api-key`

## Request body

- CreateWorkspaceRequestDto
  - `name` string, required: Workspace name
  - `slug` string: Workspace slug (auto-generated if not supplied
  - `environment` 'production' | 'test': Use "test" only when calling with a test API key (tb_test_…); assigns relaxed testing plan. Live keys must omit or use production.

## Response `201`

- CreateWorkspaceResponseDto
  - `workspace` object, required
    - `id` string, required: Workspace ID
    - `name` string, required: Workspace name
    - `slug` string, required: Workspace slug
  - `apiKey` string, required: Workspace-scoped API key

---

[API](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api.md) · [All operations](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/revisions/180622e6255e?raw)
