---
title: "(preview) Fork"
method: POST
path: "/v1/databases/{db_id}/fork"
tags: ["Database"]
---

# (preview) Fork

`POST /v1/databases/{db_id}/fork`

## Request

- Base URL: `https://api.bunny.net/database`
- URL: `https://api.bunny.net/database/v1/databases/{db_id}/fork`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/bunny-database-backend-api/docs/v1/databases/:db_id/fork/post.ts> (a function with typed inputs; its response is checked against the schema)

Fork database

## Path parameters

- `db_id` string, required: [DatabaseId] is a `db_<ulid>`

## Request body

- ForkDatabasePayload
  - `slug` string, required
  - `date` string, date-time, required

## Response `200`

- ForkDatabaseResponse
  - `database` Database, required: [Database] returned by the API
    - `name` string, required: Name of the [Database]
    - `id` string, required: [DatabaseId] is a `db_<ulid>`
    - `url` string, uri, required: Url of the database
    - `block_reads` boolean, required: The status for reads from your database
    - `block_writes` boolean, required: The status for writes from your database
    - `allow_attach` boolean, required: If your database is allowed to be attached with other.
    - `group_id` string, required: [DatabaseGroupId] is a `group_<ulid>`
    - `group_name` string, required: The [DatabaseGroup] display name.
    - `is_schema` boolean, required: If this database define another database schema.
    - `schema` string, nullable: The associated parent database that owns the schema for this database
    - `version` string, required: The current version of libSQL for the databases in this [DatabaseGroup].
    - `size_max` string, required: The current size limit of the Database
    - `current_size` string, required: The current size Database

## Other responses

- `400`: A default error response for most API errors.
- `401`: A default error response for most API errors.
- `500`: A default error response for most API errors.

---

[API](https://skmtc.dev/bunny/apis/bunny-database-backend-api.md) - [All operations](https://skmtc.dev/bunny/apis/bunny-database-backend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/bunny-database-backend-api/revisions/f3bb69bad6b6?raw)
