Search + K

Command Palette

Search for a command to run...

Sign In

Update D1 Database partially

PATCH /accounts/{account_id}/d1/database/{database_id}
Copy endpoint
https://api.cloudflare.com/client/v4

Updates partially the specified D1 database.

Parameters

path Path Parameters

Name Type
account_id required
type D1AccountIdentifier = string
database_id required
type D1DatabaseIdentifier = string

Request Body

application/json required
interface D1DatabaseUpdatePartialRequestBody {
read_replication?: { mode: D1ReadReplicationMode

The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).

type D1ReadReplicationMode = "auto" | "disabled"
; }
;
}

Responses

200 application/json

Database details response

interface D1ApiResponseCommon {
errors: D1Messages
type D1Messages = { code: number;message: string; }[]
;
messages: D1Messages
type D1Messages = { code: number;message: string; }[]
;
result: {};
success: true;
}
& { result?: D1DatabaseDetailsResponse

The details of the D1 database.

interface D1DatabaseDetailsResponse {
created_at?: D1CreatedAt;
file_size?: D1FileSize;
name?: D1DatabaseName;
num_tables?: D1TableCount;
read_replication?: D1ReadReplicationDetails;
uuid?: D1DatabaseIdentifier;
version?: D1DatabaseVersion;
}
; }

Client Errors

4XX application/json

Update D1 database response failure

interface D1ApiResponseCommonFailure {
errors: D1Messages
type D1Messages = { code: number;message: string; }[]
;
messages: D1Messages
type D1Messages = { code: number;message: string; }[]
;
result: null;
success: false;
}