---
title: "Update"
method: PATCH
path: "/v2/databases/{db_id}"
tags: ["Database (v2)"]
---

# Update

`PATCH /v2/databases/{db_id}`

## Request

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

Update a Database for the user.

## Path parameters

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

## Request body

- UpdateDatabaseV2Payload
  - `primary_regions` PossibleRegion[], nullable: The primary regions expected for the Database
  - `replicas_regions` PossibleRegion[], nullable: The replicas regions expected for the Database

## Response `200`

- UpdateDatabaseV2Response
  - `db` Database2, required: A [Database].
    - `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
    - `size_max` string, required: The current size limit of the Database
    - `current_size` string, required: The current size Database
    - `size_max_bytes` integer, required: The current size limit of the Database in bytes
    - `current_size_bytes` integer, required: The current size Database in bytes
    - `storage_region` string, required: The current Storage Region used to store your databases.
    - `primary_regions` PossibleRegion[], required: The Primary Regions available for your Database, when your database need to be commissionned, it'll be comissionned in one of those regions.
    - `replicas_regions` PossibleRegion[], required: The Replica Regions are the regions where your replicas will be able to be commissionned.

## Other responses

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

## Changes

- **2026-11-12** `f3bb69bad6b6`: 2 info
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
- **2026-04-26** `2a6107525e2a`: 4 info
  - response property `db/current_size` deprecated
  - response property `db/size_max` deprecated
  - added the required property `db/current_size_bytes` to the response with the `200` status
  - added the required property `db/size_max_bytes` to the response with the `200` status

[Operation history](https://skmtc.dev/bunny/apis/bunny-database-backend-api/changes/v2/databases/:db_id/patch.md)

---

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