> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a SQL database

> Deletes a SQL database and all of the data it holds. Deletion is asynchronous and returns `202` with an empty body — the record is not removed synchronously. Poll `GET /storage/sqldbs/{id}`, which returns `404` once the database has been purged; there is no durable `deleted` state. A database still bound by a function is refused with `409` unless `force=true`.



## OpenAPI

````yaml /openapi/source/external/edge-compute/edge-compute.json delete /storage/sqldbs/{id}
openapi: 3.1.0
info:
  description: >-
    Edge Compute storage: KV namespaces and keys, SQL databases, and CloudFS
    filesystems.
  title: Edge Compute API
  contact: {}
  version: '1.0'
  x-endpoint-cost: light
  x-latency-category: responsive
servers:
  - url: https://api.telnyx.com/v2
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: kv namespaces
    description: Manage KV storage namespaces
  - name: kv keys
    description: Read and write keys within a KV namespace
  - name: sql databases
    description: Manage SQL databases and run SQL against them
  - name: cloudfs filesystems
    description: >-
      Manage CloudFS filesystems — JuiceFS-compatible filesystems backed by
      Telnyx Cloud Storage
paths:
  /storage/sqldbs/{id}:
    delete:
      tags:
        - sql databases
      summary: Delete a SQL database
      description: >-
        Deletes a SQL database and all of the data it holds. Deletion is
        asynchronous and returns `202` with an empty body — the record is not
        removed synchronously. Poll `GET /storage/sqldbs/{id}`, which returns
        `404` once the database has been purged; there is no durable `deleted`
        state. A database still bound by a function is refused with `409` unless
        `force=true`.
      operationId: DeleteSqlDatabase
      parameters:
        - description: SQL database ID
          name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - description: >-
            Delete the database even when functions still bind it. Their
            bindings stop resolving.
          name: force
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '202':
          description: >-
            Accepted — deletion runs asynchronously. The body is empty; poll
            `GET /storage/sqldbs/{id}` until it returns `404`.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: SQL database not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '409':
          description: >-
            Conflict — the database is already being deleted, or is still bound
            by one or more functions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '422':
          description: Validation error — `id` is not a valid identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericErrorResponse'
        '503':
          description: >-
            Cannot verify whether the database is still in use; retry, or pass
            `force=true`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            await client.storage.sqldbs.delete('id');
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            client.storage.sqldbs.delete(
                "id",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Storage.Sqldbs.Delete(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    client.storage().sqldbs().delete("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.storage.sqldbs.delete("id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->storage->sqldbs->delete(
                'id',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx storage:sqldbs delete \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    GenericErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        code:
          type: string
          example: '10005'
        detail:
          type: string
          example: The requested function does not exist or you don't have access to it
        meta:
          $ref: '#/components/schemas/ErrorMeta'
        source:
          $ref: '#/components/schemas/ErrorSource'
        title:
          type: string
          example: Function not found
    ErrorMeta:
      type: object
      properties:
        url:
          type: string
          example: https://docs.telnyx.com/api/errors/10005
    ErrorSource:
      type: object
      properties:
        parameter:
          type: string
          example: id
        pointer:
          type: string
          example: /id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````