---
title: "Create a database"
method: POST
path: "/spaces/{space_id}/databases"
---

# Create a database

`POST /spaces/{space_id}/databases`

Creates a new database in a space.

## Path parameters

- `space_id` string, required

## Request body

- CreateDatabaseRequest — Request to create a new database in a space.
  - `name` string — Name for the new database. Auto-generated if omitted.
  - `type` 'standard' | 'dedicated' — Database deployment model. - `standard` — shared-resource databases subject to the space's compute and storage limits. - `dedicated` — per-instance paid databases with guaranteed resources, exempt from space-level auto-pause.
  - `size` '1x' | '2x' | '4x' | '8x' — Compute size for dedicated databases. Each step up allocates proportionally more vCPU and RAM.
  - `share_token` string — Share token from a database share (begins with `gs_`). When provided, creates the new database from the shared snapshot.

## Response `202`

Database created

- Database — A Ghost database.
  - `id` string, required — Database ID.
  - `name` string, required — Database name. Unique within the space.
  - `type` 'standard' | 'dedicated', required — Database deployment model. - `standard` — shared-resource databases subject to the space's compute and storage limits. - `dedicated` — per-instance paid databases with guaranteed resources, exempt from space-level auto-pause.
  - `size` '1x' | '2x' | '4x' | '8x' — Compute size for dedicated databases. Each step up allocates proportionally more vCPU and RAM.
  - `status` 'queued' | 'configuring' | 'running' | 'pausing' | 'paused' | 'resuming' | 'deleting' | 'deleted' | 'upgrading' | 'unstable' | 'unknown', required — Current lifecycle status of the database.
  - `host` string, required — PostgreSQL hostname for connections.
  - `port` integer, required — PostgreSQL port for connections.
  - `password` string, nullable — PostgreSQL password for the default user. Returned on every GET for authorized callers.
  - `storage_mib` integer, nullable — Current disk usage in MiB. Null if not yet available.

## Other responses

- `default` — Error response

---

[API](https://skmtc.net/timescale/apis/ghost-api.md) · [All operations](https://skmtc.net/timescale/apis/ghost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/timescale/ghost-api/versions/808022f897be/schema)
