Search + K

Command Palette

Search for a command to run...

Sign In

Get D1 Database

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

Returns the specified D1 database.

Parameters

path Path Parameters

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

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

Database details response failure

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