Skip to content
Start here

Hyperdrive

ModelsExpand Collapse
Configuration = HyperdriveInternetOrigin { host, port, database, 3 more } | HyperdriveOverAccessOrigin { access_client_id, access_client_secret, host, 4 more }
One of the following:
HyperdriveInternetOrigin { host, port, database, 3 more }
host: string

Defines the host (hostname or IP) of your origin database.

port: number

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

database?: string

Set the name of your origin database.

password?: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme?: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:
"postgres"
"postgresql"
"mysql"
user?: string

Set the user of your origin database.

HyperdriveOverAccessOrigin { access_client_id, access_client_secret, host, 4 more }
access_client_id: string

Defines the Client ID of the Access token to use when connecting to the origin database.

access_client_secret: string

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

host: string

Defines the host (hostname or IP) of your origin database.

database?: string

Set the name of your origin database.

password?: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme?: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:
"postgres"
"postgresql"
"mysql"
user?: string

Set the user of your origin database.

Hyperdrive { id, name, origin, 5 more }
id: string

Define configurations using a unique string identifier.

maxLength32
name: string

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

origin: PublicDatabase { database, host, password, 3 more } | AccessProtectedDatabaseBehindCloudflareTunnel { access_client_id, access_client_secret, database, 4 more }
One of the following:
PublicDatabase { database, host, password, 3 more }
database: string

Set the name of your origin database.

host: string

Defines the host (hostname or IP) of your origin database.

password: string

Set the password needed to access your origin database. The API never returns this write-only value.

port: number

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

scheme: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:
"postgres"
"postgresql"
"mysql"
user: string

Set the user of your origin database.

AccessProtectedDatabaseBehindCloudflareTunnel { access_client_id, access_client_secret, database, 4 more }
access_client_id: string

Defines the Client ID of the Access token to use when connecting to the origin database.

access_client_secret: string

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

database: string

Set the name of your origin database.

host: string

Defines the host (hostname or IP) of your origin database.

password: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:
"postgres"
"postgresql"
"mysql"
user: string

Set the user of your origin database.

caching?: HyperdriveHyperdriveCachingCommon { disabled } | HyperdriveHyperdriveCachingEnabled { disabled, max_age, stale_while_revalidate }
One of the following:
HyperdriveHyperdriveCachingCommon { disabled }
disabled?: boolean

Set to true to disable caching of SQL responses. Default is false.

HyperdriveHyperdriveCachingEnabled { disabled, max_age, stale_while_revalidate }
disabled?: boolean

Set to true to disable caching of SQL responses. Default is false.

max_age?: number

Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.

stale_while_revalidate?: number

Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.

created_on?: string

Defines the creation time of the Hyperdrive configuration.

formatdate-time
modified_on?: string

Defines the last modified time of the Hyperdrive configuration.

formatdate-time
mtls?: MTLS { ca_certificate_id, mtls_certificate_id, sslmode }
ca_certificate_id?: string

Define CA certificate ID obtained after uploading CA cert.

mtls_certificate_id?: string

Define mTLS certificate ID obtained after uploading client cert.

sslmode?: string

Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.

origin_connection_limit?: number

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Contact Cloudflare if you need a higher limit.

maximum100
minimum5

HyperdriveConfigs

List Hyperdrives
client.hyperdrive.configs.list(ConfigListParams { account_id } params, RequestOptionsoptions?): SinglePage<Hyperdrive { id, name, origin, 5 more } >
GET/accounts/{account_id}/hyperdrive/configs
Get Hyperdrive
client.hyperdrive.configs.get(stringhyperdriveId, ConfigGetParams { account_id } params, RequestOptionsoptions?): Hyperdrive { id, name, origin, 5 more }
GET/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Create Hyperdrive
client.hyperdrive.configs.create(ConfigCreateParams { account_id, name, origin, 3 more } params, RequestOptionsoptions?): Hyperdrive { id, name, origin, 5 more }
POST/accounts/{account_id}/hyperdrive/configs
Update Hyperdrive
client.hyperdrive.configs.update(stringhyperdriveId, ConfigUpdateParams { account_id, name, origin, 3 more } params, RequestOptionsoptions?): Hyperdrive { id, name, origin, 5 more }
PUT/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Patch Hyperdrive
client.hyperdrive.configs.edit(stringhyperdriveId, ConfigEditParams { account_id, caching, mtls, 3 more } params, RequestOptionsoptions?): Hyperdrive { id, name, origin, 5 more }
PATCH/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Delete Hyperdrive
client.hyperdrive.configs.delete(stringhyperdriveId, ConfigDeleteParams { account_id } params, RequestOptionsoptions?): ConfigDeleteResponse | null
DELETE/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
ModelsExpand Collapse
ConfigDeleteResponse = unknown