---
title: "Create Database"
method: POST
path: "/v1/databases"
tags: ["Database"]
---

# Create Database

`POST /v1/databases`

## Request

- Base URL: `https://api.bunny.net/database`
- URL: `https://api.bunny.net/database/v1/databases`
- 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/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new database in a DatabaseGroup.

## Request body

- CreateDatabasePayload
  - `slug` string, required: The database slug
  - `group` string, required: [DatabaseGroupId] is a `group_<ulid>`

## Response `200`

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

- `401`: A default error response for most API errors.
- `409`: 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)
