---
title: "Create a workspace; the caller becomes its owner"
method: POST
path: "/api/workspaces"
tags: ["Workspaces"]
---

# Create a workspace; the caller becomes its owner

`POST /api/workspaces`

## Request

- Base URL: `https://tre-app.com`
- URL: `https://tre-app.com/api/workspaces`
- Auth: HTTP bearer

Requires unbound admin token scope or the web session. Read and write tokens receive 403 FORBIDDEN. Every workspace-bound token receives 403 FORBIDDEN (Workspace-bound tokens cannot create workspaces), before writes or idempotency replay. On a billing-enabled installation the first workspace a person creates starts their one 14-day trial; a workspace created after that is read-only until a plan is chosen. A self-hosted installation has neither.

## Headers

- `Idempotency-Key` string

## Request body

- WorkspaceCreate
  - `name` string, required

## Response `201`

Success

- WorkspaceCreated
  - `id` string, uuid, required
  - `slug` string, required
  - `name` string, required
  - `role` 'owner', required

## Other responses

- `400`: Invalid request
- `401`: Unauthenticated
- `403`: Forbidden: insufficient role or token scope; scope denials name the held scope and the operation
- `404`: Not found
- `409`: Conflict
- `422`: Idempotency-Key reused with a different request body (IDEMPOTENCY_KEY_REUSED)
- `429`: Rate limited
- `500`: Internal server error
- `503`: Temporarily unavailable

---

[API](https://skmtc.dev/tre-app/apis/tre-rest-api.md) · [All operations](https://skmtc.dev/tre-app/apis/tre-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tre-app/apis/tre-rest-api/revisions/26a7187a05fc?raw)
