---
raw: true
search:
  tags:
    - Spaces
    - POST
seo:
  description: >-
    Creates a space under a team with a chosen or generated slug. Pass source to
    create it from… Reference for the POST /v1/spaces endpoint in the Spacefast
    API.
sidebar:
  label: Create a space
  badge: POST
title: Create a space
type: openapi-operation
---
Creates a space under a team with a chosen or generated slug. Pass `source` to create it from a GitHub repository and start its first build. Use POST /v1/publish to create a space and publish content in one call.

`POST /v1/spaces`

**Request body** (`application/json`, required)

- `teamId` (string | null)
- `capabilities` (string[]) — Send \`optional\_access\` only when the client can read a successful receipt without \`access\`. Team-owned Spaces then get no automatic share link. Omit it to retain the legacy Open-link receipt during rollout.
- `slug` (string)
- `title` (string)
- `config` (object) — Initial SpaceConfig overlay for the new space.
- `access` (string) — Set the initial general access for this new team-owned Space: \`private\` admits the owning team, \`public\` also admits anyone on the web. \`team\` is a legacy spelling of \`private\`. Omit this field to use the team's default. \`public\` returns 403 \`team\_private\_spaces\_only\` when the team allows private spaces only.
- `dataLocation` (string) — Data location for a new Space; "auto" lets placement decide.
- `source` (object) — Create from an authorized GitHub repository or fork the main branch of a Source available Spacefast repository. GitHub connections start their initial sync and deployment; remixes copy main and publish an initial live build. Team-owned Spaces only.

Request body example:

```json
{
  "teamId": "team_3f9a1c7e5b2d8a4f",
  "slug": "marketing-site",
  "title": "Marketing site"
}
```

**Responses**

- `201` — Response for status 201
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 201:

```json
{
  "data": {
    "space": {
      "id": "spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c",
      "teamId": "team_3f9a1c7e5b2d8a4f",
      "teamSlug": "acme",
      "anonymous": false,
      "slug": "marketing-site",
      "title": "Marketing site",
      "status": "active",
      "disabled": null,
      "claimState": null,
      "defaultHostname": "marketing-site.space.fast",
      "publicName": "marketing-site",
      "liveUrl": "https://marketing-site.space.fast/",
      "dataLocation": "dca",
      "channels": {
        "live": {
          "versionId": "ver_2b9e7d4c1a6f8b3e0d5c9a2f7e4b1d8c",
          "updatedAt": "2026-06-30T12:00:03.000Z"
        }
      },
      "config": null,
      "noindex": false,
      "teamAccessPolicy": {
        "privateSpacesOnly": false,
        "noindex": false
      },
      "policy": null,
      "operation": null,
      "createdAt": "2026-06-30T11:59:00.000Z",
      "updatedAt": "2026-06-30T12:00:03.000Z"
    }
  }
}
```
