Typescript (SDK)
Sites
Query a site's database
Runs SQL against the site’s Cloudflare D1 database and returns the resulting rows. Each site owns its own database, so a caller can only reach the database behind a site they own. The database is provisioned on first deploy — querying before the site has been deployed returns a database_unavailable error.
POST
Typescript (SDK)
Authorizations
API key in the format: Bearer {api_token}
Path Parameters
The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
Body
application/json
The SQL to execute. Multiple statements may be separated by ; — the last statement that returns rows is surfaced.
Response
Query result

