---
title: "Share a database"
method: POST
path: "/spaces/{space_id}/databases/{database_ref}/share"
---

# Share a database

`POST /spaces/{space_id}/databases/{database_ref}/share`

Creates a shareable snapshot of a database. Returns a share token that can be used to fork the database into another space.

## Path parameters

- `space_id` string, required
- `database_ref` string, required

## Request body

- ShareDatabaseRequest
  - `expires_at` string, date-time — Timestamp after which the share expires. If omitted, the share does not expire.

## Response `201`

Share created

- DatabaseShare
  - `id` string, required
  - `share_token` string, required
  - `database_id` string, required
  - `database_name` string, required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time
  - `revoked_at` string, date-time

## Other responses

- `default` — Error response

## Changes

- **2026-04-22** `cb6948daa61e` — 1 info
  - endpoint added
- **2026-04-17** `a7becb6668ec` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/timescale/apis/ghost-api/changes/spaces/:space_id/databases/:database_ref/share/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/cb6948daa61e/schema)
