APIs.io Engineering Platform D1 API

The D1 API from APIs.io Engineering Platform — 6 operation(s) for d1.

Operations 8

GET /accounts/{account_id}/d1/database APIs.io Engineering Platform List D1 Databases #
POST /accounts/{account_id}/d1/database APIs.io Engineering Platform Create D1 Database #
DELETE /accounts/{account_id}/d1/database/{database_id} APIs.io Engineering Platform Delete D1 Database #
GET /accounts/{account_id}/d1/database/{database_id} APIs.io Engineering Platform Get D1 Database #
POST /accounts/{account_id}/d1/database/{database_id}/export APIs.io Engineering Platform Export D1 Database as SQL #
POST /accounts/{account_id}/d1/database/{database_id}/import APIs.io Engineering Platform Import SQL into your D1 Database #
POST /accounts/{account_id}/d1/database/{database_id}/query APIs.io Engineering Platform Query D1 Database #
POST /accounts/{account_id}/d1/database/{database_id}/raw APIs.io Engineering Platform Raw D1 Database query #

Documentation

Specifications

Other Resources

🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-1ab188a6-cc1f-490d-9413-9c6da20918d0?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-0e94f581-cbc1-48e0-b594-1f6b3d07a328?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-4517d93a-e7f7-4dc2-b572-06762bbe14de?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-88f9ddbb-3115-47dc-b6e5-7fc6f1d2a190?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-3a12caae-4945-4df4-8ab9-bb6219ba7a9f?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-863b18f0-c2f2-4e32-a5fa-0d1e6ccf77a9?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-189876d1-f207-49a2-a4bc-5c67ae78cd19?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-c1e74fd9-3f84-4d95-943d-d645d6cb82f7?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-b002164d-6e8a-4b6d-b409-4929476e7818?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-508660fd-30b8-4c9c-aede-8edbac8a514d?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-da35e0ba-f1a9-42fe-a77a-56ff0a47e341?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-1d4df7d0-9c92-4fa8-946f-2110c2b3b48d?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-2af6f54f-d259-46c0-8f86-78856f5885cd?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-cc203f31-e7f6-42ec-ad34-c5c4cde58904?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-f19285da-48dd-4691-bbdf-f7d6bec157a3?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-aa69cacc-4bbf-4724-a1d4-78cdad57fee8?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-a5858f86-04d3-4e15-ae11-b42c7516688b?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-c2052341-766c-43c7-b1dc-ed4985e4606b?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-aa777c90-8271-4809-8eac-3ec39a9a899c?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-4d5957dc-df05-4216-a5fc-d46b3ba811d8?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-28d97617-fdba-46a5-ac3e-40f3d2e0fa57?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-7429b451-d812-4abc-b497-b763372cf5c5?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-b0eafdd0-adaa-48a2-a855-6a31beb86d83?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-209f34ef-13c1-400c-bca8-fcddb304aff5?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-fb2bbbb8-d4cc-48b1-a660-c8e158bfbbea?action=share&creator=35240

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/engineering-platform-d1-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

engineering-platform-d1-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'To get started using Cloudflare''s products and services via the API, refer to [how to interact with Cloudflare](https://developers.cloudflare.com/fundamentals/basic-tasks/interact-with-cloudflare/), which covers using tools like [Terraform](https://developers.cloudflare.com/terraform/#cloudflare-terraform) and the [official SDKs](https://developers.cloudflare.com/fundamentals/api/reference/sdks/) to maintain your Cloudflare resources.


    Using the Cloudflare API requires authentication so that Cloudflare knows who is making requests and what permissions you have. Create an API token to grant access to the API to perform actions.


    To create an API token, from the Cloudflare dashboard, go to My Profile > API Tokens and select Create Token. For more information on how to create and troubleshoot API tokens, refer to

    our [API fundamentals](https://developers.cloudflare.com/fundamentals/api/).


    Totally new to Cloudflare? [Start here](https://developers.cloudflare.com/fundamentals/get-started/).'
  license:
    name: BSD-3-Clause
    url: https://opensource.org/licenses/BSD-3-Clause
  title: APIs.io Engineering Platform Cloudflare D1 API
  version: 4.0.0
tags:
- name: D1
paths:
  /accounts/{account_id}/d1/database:
    get:
      description: Returns a list of D1 databases.
      operationId: cloudflare-d1-list-databases
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: query
        name: name
        schema:
          description: a database name to search for.
          type: string
      - in: query
        name: page
        schema:
          default: 1
          description: Page number of paginated results.
          minimum: 1
          type: number
      - in: query
        name: per_page
        schema:
          default: 1000
          description: Number of items per page.
          maximum: 10000
          minimum: 10
          type: number
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: List D1 databases response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      items:
                        $ref: '#/components/schemas/d1_database-response'
                      type: array
                    result_info:
                      properties:
                        count:
                          description: Total number of results for the requested service
                          example: 1
                          type: number
                        page:
                          description: Current page within paginated list of results
                          example: 1
                          type: number
                        per_page:
                          description: Number of results per page of results
                          example: 20
                          type: number
                        total_count:
                          description: Total results available without any search parameters
                          example: 2000
                          type: number
                      type: object
          description: List D1 databases response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform List D1 Databases
      tags:
      - D1
      x-api-token-group:
      - D1 Read
      - D1 Write
    post:
      description: Returns the created D1 database.
      operationId: cloudflare-d1-create-database
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  $ref: '#/components/schemas/d1_database-name'
                primary_location_hint:
                  $ref: '#/components/schemas/d1_primary-location-hint'
              required:
              - name
              type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Database details response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      $ref: '#/components/schemas/d1_database-details-response'
          description: Returns the created D1 database's metadata
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Create D1 Database
      tags:
      - D1
      x-api-token-group:
      - D1 Write
  /accounts/{account_id}/d1/database/{database_id}:
    delete:
      description: Deletes the specified D1 database.
      operationId: cloudflare-d1-delete-database
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: path
        name: database_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_database-identifier'
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Delete D1 database response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      enum:
                      - null
                      type:
                      - object
                      - 'null'
          description: Delete D1 database response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Delete D1 Database
      tags:
      - D1
      x-api-token-group:
      - D1 Write
    get:
      description: Returns the specified D1 database.
      operationId: cloudflare-d1-get-database
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: path
        name: database_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_database-identifier'
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Database details response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      $ref: '#/components/schemas/d1_database-details-response'
          description: Database details response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Get D1 Database
      tags:
      - D1
      x-api-token-group:
      - D1 Read
      - D1 Write
  /accounts/{account_id}/d1/database/{database_id}/export:
    post:
      description: 'Returns a URL where the SQL contents of your D1 can be downloaded. Note: this process may take

        some time for larger DBs, during which your D1 will be unavailable to serve queries. To avoid

        blocking your DB unnecessarily, an in-progress export must be continually polled or will automatically cancel.

        '
      operationId: cloudflare-d1-export-database
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: path
        name: database_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_database-identifier'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                current_bookmark:
                  description: To poll an in-progress export, provide the current bookmark (returned by your first polling response)
                  type: string
                dump_options:
                  properties:
                    no_data:
                      description: Export only the table definitions, not their contents
                      type: boolean
                    no_schema:
                      description: Export only each table's contents, not its definition
                      type: boolean
                    tables:
                      description: 'Filter the export to just one or more tables. Passing an empty array is the same as not passing anything and means: export all tables.'
                      items:
                        type: string
                      type: array
                  type: object
                output_format:
                  description: Specifies that you will poll this endpoint until the export completes
                  enum:
                  - polling
                  type: string
              required:
              - output_format
              type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Poll failed (API error)
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      properties:
                        at_bookmark:
                          description: The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the export task.
                          type: string
                        error:
                          description: Only present when status = 'error'. Contains the error message.
                          type: string
                        messages:
                          description: Logs since the last time you polled
                          items:
                            type: string
                          type: array
                        result:
                          description: Only present when status = 'complete'
                          properties:
                            filename:
                              description: The generated SQL filename.
                              type: string
                            signed_url:
                              description: The URL to download the exported SQL. Available for one hour.
                              type: string
                          type: object
                        status:
                          enum:
                          - complete
                          - error
                          type: string
                        success:
                          type: boolean
                        type:
                          enum:
                          - export
                          type: string
                      type: object
          description: Polled successfully, task no longer running (errored or complete)
        '202':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      properties:
                        at_bookmark:
                          description: The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the export task.
                          type: string
                        messages:
                          description: Logs since the last time you polled
                          items:
                            type: string
                          type: array
                        status:
                          enum:
                          - active
                          type: string
                        success:
                          type: boolean
                        type:
                          enum:
                          - export
                          type: string
                      type: object
          description: Polled successfully, task is currently running
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Export D1 Database as SQL
      tags:
      - D1
  /accounts/{account_id}/d1/database/{database_id}/import:
    post:
      description: 'Generates a temporary URL for uploading an SQL file to, then instructing the D1 to import it

        and polling it for status updates. Imports block the D1 for their duration.

        '
      operationId: cloudflare-d1-import-database
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: path
        name: database_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_database-identifier'
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - properties:
                  action:
                    description: Indicates you have a new SQL file to upload.
                    enum:
                    - init
                    type: string
                  etag:
                    description: Required when action is 'init' or 'ingest'. An md5 hash of the file you're uploading. Used to check if it already exists, and validate its contents before ingesting.
                    type: string
                required:
                - action
                - etag
                type: object
              - properties:
                  action:
                    description: Indicates you've finished uploading to tell the D1 to start consuming it
                    enum:
                    - ingest
                    type: string
                  etag:
                    description: An md5 hash of the file you're uploading. Used to check if it already exists, and validate its contents before ingesting.
                    type: string
                  filename:
                    description: The filename you have successfully uploaded.
                    type: string
                required:
                - action
                - etag
                - filename
                type: object
              - properties:
                  action:
                    description: Indicates you've finished uploading to tell the D1 to start consuming it
                    enum:
                    - poll
                    type: string
                  current_bookmark:
                    description: This identifies the currently-running import, checking its status.
                    type: string
                required:
                - action
                - current_bookmark
                type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Poll failed (API error)
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      properties:
                        at_bookmark:
                          description: The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the import. Only returned if an import process is currently running or recently finished.
                          type: string
                        error:
                          description: Only present when status = 'error'. Contains the error message that prevented the import from succeeding.
                          type: string
                        filename:
                          description: Derived from the database ID and etag, to use in avoiding repeated uploads. Only returned when for the 'init' action.
                          type: string
                        messages:
                          description: Logs since the last time you polled
                          items:
                            type: string
                          type: array
                        result:
                          description: Only present when status = 'complete'
                          properties:
                            final_bookmark:
                              description: The time-travel bookmark if you need restore your D1 to directly after the import succeeded.
                              type: string
                            meta:
                              $ref: '#/components/schemas/d1_query-meta'
                            num_queries:
                              description: The total number of queries that were executed during the import.
                              type: number
                          type: object
                        status:
                          enum:
                          - complete
                          - error
                          type: string
                        success:
                          type: boolean
                        type:
                          enum:
                          - import
                          type: string
                        upload_url:
                          description: The R2 presigned URL to use for uploading. Only returned when for the 'init' action.
                          type: string
                      type: object
          description: Successful action. Import is either ready to start, under way, or finished (succeeded or failed).
        '202':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      properties:
                        at_bookmark:
                          description: The current time-travel bookmark for your D1, used to poll for updates. Will not change for the duration of the import.
                          type: string
                        messages:
                          description: Logs since the last time you polled
                          items:
                            type: string
                          type: array
                        status:
                          enum:
                          - active
                          type: string
                        success:
                          type: boolean
                        type:
                          enum:
                          - import
                          type: string
                      type: object
          description: Polled successfully, task is currently running
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Import SQL into your D1 Database
      tags:
      - D1
  /accounts/{account_id}/d1/database/{database_id}/query:
    post:
      description: Returns the query result as an object.
      operationId: cloudflare-d1-query-database
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: path
        name: database_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_database-identifier'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                params:
                  $ref: '#/components/schemas/d1_params'
                sql:
                  $ref: '#/components/schemas/d1_sql'
              required:
              - sql
              type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Query response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      items:
                        $ref: '#/components/schemas/d1_query-result-response'
                      type: array
          description: Query response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Query D1 Database
      tags:
      - D1
      x-api-token-group:
      - D1 Read
      - D1 Write
  /accounts/{account_id}/d1/database/{database_id}/raw:
    post:
      description: Returns the query result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.
      operationId: cloudflare-d1-raw-database-query
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_account-identifier'
      - in: path
        name: database_id
        required: true
        schema:
          $ref: '#/components/schemas/d1_database-identifier'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                params:
                  $ref: '#/components/schemas/d1_params'
                sql:
                  $ref: '#/components/schemas/d1_sql'
              required:
              - sql
              type: object
        required: true
      responses:
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d1_api-response-common-failure'
          description: Query response failure
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/d1_api-response-common'
                - properties:
                    result:
                      items:
                        $ref: '#/components/schemas/d1_raw-result-response'
                      type: array
          description: Raw query response
      security:
      - api_token: []
      - api_email: []
        api_key: []
      summary: APIs.io Engineering Platform Raw D1 Database query
      tags:
      - D1
components:
  schemas:
    d1_account-identifier:
      description: Account identifier tag.
      example: 023e105f4ecef8ad9ca31a8372d0c353
      maxLength: 32
      readOnly: true
      type: string
    d1_table-count:
      example: 12
      type: number
    d1_sql:
      description: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.
      example: SELECT * FROM myTable WHERE field = ? OR field = ?;
      type: string
    d1_query-meta:
      properties:
        changed_db:
          type: boolean
        changes:
          type: number
        duration:
          type: number
        last_row_id:
          type: number
        rows_read:
          type: number
        rows_written:
          type: number
        size_after:
          type: number
      type: object
    d1_query-result-response:
      properties:
        meta:
          $ref: '#/components/schemas/d1_query-meta'
        results:
          items:
            type: object
          type: array
        success:
          type: boolean
      type: object
    d1_database-details-response:
      properties:
        created_at:
          $ref: '#/components/schemas/d1_created-at'
        file_size:
          $ref: '#/components/schemas/d1_file-size'
        name:
          $ref: '#/components/schemas/d1_database-name'
        num_tables:
          $ref: '#/components/schemas/d1_table-count'
        uuid:
          $ref: '#/components/schemas/d1_database-identifier'
        version:
          $ref: '#/components/schemas/d1_database-version'
      type: object
    d1_database-identifier:
      example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      readOnly: true
      type: string
    d1_database-name:
      example: my-database
      pattern: ^[a-z0-9][a-z0-9-_]*$
      type: string
    d1_primary-location-hint:
      description: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.
      enum:
      - wnam
      - enam
      - weur
      - eeur
      - apac
      - oc
      example: wnam
      type: string
    d1_file-size:
      description: The D1 database's size, in bytes.
      example: 12
      type: number
    d1_raw-result-response:
      properties:
        meta:
          $ref: '#/components/schemas/d1_query-meta'
        results:
          properties:
            columns:
              items:
                type: string
              type: array
            rows:
              items:
                items:
                  anyOf:
                  - type: number
                  - type: string
                  - type: object
                type: array
              type: array
          type: object
        success:
          type: boolean
      type: object
    d1_database-version:
      example: production
      pattern: ^(alpha|beta|production)$
      type: string
    d1_database-response:
      properties:
        created_at:
          $ref: '#/components/schemas/d1_created-at'
        name:
          $ref: '#/components/schemas/d1_database-name'
        uuid:
          $ref: '#/components/schemas/d1_database-identifier'
        version:
          $ref: '#/components/schemas/d1_database-version'
      type: object
    d1_messages:
      example: []
      items:
        properties:
          code:
            minimum: 1000
            type: integer
          message:
            type: string
        required:
        - code
        - message
        type: object
        uniqueItems: true
      type: array
    d1_params:
      example:
      - firstParam
      - secondParam
      items:
        type: string
      type: array
    d1_api-response-common:
      properties:
        errors:
          $ref: '#/components/schemas/d1_messages'
        messages:
          $ref: '#/components/schemas/d1_messages'
        result:
          type: object
        success:
          description: Whether the API call was successful
          enum:
          - true
          example: true
          type: boolean
      required:
      - success
      - errors
      - messages
      - result
      type: object
    d1_api-response-common-failure:
      properties:
        errors:
          allOf:
          - $ref: '#/components/schemas/d1_messages'
          example:
          - code: 7003
            message: No route for the URI
          minLength: 1
        messages:
          allOf:
          - $ref: '#/components/schemas/d1_messages'
          example: []
        result:
          enum:
          - null
          type:
          - object
          - 'null'
        success:
          description: Whether the API call was successful
          enum:
          - false
          example: false
          type: boolean
      required:
      - success
      - errors
      - messages
      - result
      type: object
    d1_created-at:
      description: Specifies the timestamp the resource was created as an ISO8601 string.
      example: '2022-11-15T18:25:44.442097Z'
      format: date-time
      readOnly: true
      type: string
  securitySchemes:
    api_email:
      in: header
      name: X-Auth-Email
      type: apiKey
    api_key:
      in: header
      name: X-Auth-Key
      type: apiKey
    api_token:
      scheme: bearer
      type: http
    user_service_key:
      in: header
      name: X-Auth-User-Service-Key
      type: apiKey