---
title: "Create a space"
method: POST
path: "/api/spaces"
tags: ["spaces"]
---

# Create a space

`POST /api/spaces`

## Request

- Base URL: `https://telawiki.com`
- URL: `https://telawiki.com/api/spaces`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `tela_session`

The creator becomes owner. Passing `org_id` makes the space organization-owned and grants the whole organization `editor`.

## Request body

- object
  - `name` string, required
  - `slug` string: Derived from `name` when omitted.
  - `org_id` integer, nullable: You must be a member of the organization.

## Response `201`

The space.

- object
  - `space` Space, required
    - `id` integer, required
    - `name` string, required
    - `slug` string, required
    - `visibility` 'private' | 'public', required: `public` makes the entire space readable with no account, at `/{handle}/{space-slug}`.
    - `description` string, required
    - `created_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.
    - `updated_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.
    - `my_role` 'owner' | 'editor' | 'viewer': Your effective role. Set on single-space responses, absent from listings.
    - `public_path` string: Server-computed `/{handle}/{space-slug}`. Present only for a public space — never derive it client-side.

## Other responses

- `400`: `invalid_json`, `invalid_name`, or `invalid_slug`.
- `402`: `quota_exceeded` — a plan limit (pages, storage) was reached.
- `403`: `forbidden` (no access, or the role is too low), `viewer_no_write`, `api_key_scope` (the token's scope forbids this method), or `api_key_space_scope` (the token is pinned to another space).
- `409`: `slug_conflict` — that slug is taken.
- `500`: `internal` — server error.

---

[API](https://skmtc.dev/telawiki/apis/tela-rest-api.md) · [All operations](https://skmtc.dev/telawiki/apis/tela-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telawiki/apis/tela-rest-api/revisions/f316f31f6fcb?raw)
