---
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

## Changes

- **2026-08-11** `42816b90d8d6` — 1 warning
  - added the new `signups_disabled` enum value to the `code` response property for the response status `default`
- **2026-06-23** `d0e78bae6ce1` — 1 warning
  - added the new `compute_limit_exceeded` enum value to the `code` response property for the response status `default`
- **2026-06-22** `bdf92f48aec1` — 1 info
  - added the optional property `code` to the response with the `default` status
- **2026-04-22** `cb6948daa61e` — 1 info
  - added the new optional request property `share_token`
- **2026-04-17** `a7becb6668ec` — 2 breaking, 2 warning
  - the response property `size` became nullable for the status `202`
  - the `storage_mib` response's property type/format changed from `integer`/`int64` to `integer`/`` for status `202`
  - removed the request property `share_token`
  - removed the optional property `code` from the response with the `default` status

[Change history](https://skmtc.dev/timescale/apis/ghost-api/changes/spaces/:space_id/databases/post.md)

---

[API](https://skmtc.dev/timescale/apis/ghost-api.md) · [All operations](https://skmtc.dev/timescale/apis/ghost-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/timescale/ghost-api/revisions/42816b90d8d6/schema)
