> ## 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.

# Clear Data

> Removes all data from the specified uploaded table while preserving the table structure and schema.

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

The `Clear` endpoint removes all the data in the specified table, but does not delete the table.

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

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

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

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

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

  response = requests.request("POST", url, headers=headers)
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/uploads/{namespace}/{table_name}/clear
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}/clear:
    post:
      summary: Clear all data from an uploaded table
      description: >-
        Removes all data from the specified uploaded table while preserving the
        table structure and schema.
      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 clear
          in: path
          name: namespace
          required: true
          schema:
            type: string
        - description: The table name of the table to clear
          in: path
          name: table_name
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.TableClearResponse'
          description: OK
        '404':
          content:
            application/json:
              schema: {}
          description: Not Found
        '500':
          content:
            application/json:
              schema: {}
          description: Internal Server Error
components:
  schemas:
    models.TableClearResponse:
      properties:
        message:
          type: string
      type: object

````