---
title: "Create a client space explicitly."
method: POST
path: "/spaces"
tags: ["Client spaces"]
---

# Create a client space explicitly.

`POST /spaces`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/spaces`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.stacktr.ee/oauth/authorize`, token URL `https://api.stacktr.ee/oauth/token`, scopes: `sites:write`, `sites:read`)

Rarely needed: publishing with a `client` field auto-creates the space with the same casing and slug rules, so this exists for setting a client up before anything ships.

## Request body

- object
  - `name` string, required: Display name, e.g. "Acme Co".

## Response `201`

Created (or already existed — idempotent with the publish-path auto-create).

- object
  - `ok` boolean
  - `space` object
    - `id` string, required
    - `name` string, required
    - `slug` string, required

## Other responses

- `400`: Missing or invalid name.

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
