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

# Delete Table

> Permanently deletes the specified uploaded table and all its data.

<Info>
  Minimum required API key scope: `Read/Write`
</Info>

<Note>
  * You must be an admin to delete the table.
  * You can also delete a table through `user settings (dune.com) -> data -> delete`.
  * Deleting a table does not incur credits.
</Note>

<Tip>
  **Migrating from the old API?** See the [Migration Guide](./migration) for help updating your code.
</Tip>

<RequestExample>
  ```bash curl theme={null}
  curl --request DELETE \
    --url https://api.dune.com/api/v1/uploads/my_user/interest_rates \
    --header 'X-DUNE-API-KEY: <x-dune-api-key>'
  ```

  ```python Python SDK theme={null}
  from dune_client.client import DuneClient

  dune = DuneClient()

  table = dune.delete_table(
          namespace="my_user",
          table_name="interest_rates"
  )
  ```

  ```typescript TS SDK theme={null}
  import { DuneClient } from "@duneanalytics/client-sdk";

  client = new DuneClient(process.env.DUNE_API_KEY!);
  const result = await client.table.delete({
    namespace: "my_user",
    table_name: "interest_rates",
  });
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.dune.com/api/v1/uploads/my_user/interest_rates"

  headers = {
      "X-DUNE-API-KEY": "<x-dune-api-key>"
  }

  response = requests.request("DELETE", url, headers=headers)
  ```

  ```javascript Javascript theme={null}
  const url = "https://api.dune.com/api/v1/uploads/my_user/interest_rates";

  const headers = {
      "X-DUNE-API-KEY": "<x-dune-api-key>"
  };

  fetch(url, {
      method: 'DELETE',
      headers: headers
  })
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  ```
</RequestExample>


## OpenAPI

````yaml DELETE /v1/uploads/{namespace}/{table_name}
openapi: 3.0.1
info:
  contact: {}
  description: Dune API
  title: DuneAPI
  version: '1.0'
servers:
  - url: https://api.dune.com/api
security: []
paths:
  /v1/uploads/{namespace}/{table_name}:
    delete:
      summary: Delete an uploaded table
      description: Permanently deletes the specified uploaded table and all its data.
      parameters:
        - description: API Key for the service
          in: header
          name: X-Dune-Api-Key
          required: true
          schema:
            type: string
        - description: Alternative to using the X-Dune-Api-Key header
          in: query
          name: api_key
          schema:
            type: string
        - description: The namespace of the table to delete
          in: path
          name: namespace
          required: true
          schema:
            type: string
        - description: The table name of the table to delete
          in: path
          name: table_name
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.TableDeleteResponse'
          description: OK
        '404':
          content:
            application/json:
              schema: {}
          description: Not Found
        '500':
          content:
            application/json:
              schema: {}
          description: Internal Server Error
components:
  schemas:
    models.TableDeleteResponse:
      properties:
        message:
          type: string
      type: object

````