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

# Delete a Collection

> Learn how to delete a collection using the Wetrocloud API when they are no longer needed.

Collections in WetroCloud store indexed resources for retrieval and query operations. Deleting a collection can help remove outdated data.

## When to Use the Delete Endpoint

Use the `/v1/collection/delete/` endpoint when:

* A collection has served its purpose and is no longer needed.
* Data in a collection must be  removed.

To delete a collection, send a `DELETE` request to the `/v1/collection/delete/` endpoint with the required parameters in the body.

### Required Parameters

| Parameter       | Type   | Description                                |
| --------------- | ------ | ------------------------------------------ |
| `collection_id` | String | The unique ID of the collection to delete. |

***

### Request Example

<CodeGroup>
  ```python Python theme={null}
  from wetro import Wetrocloud

  # Initialize the Wetrocloud client
  client = Wetrocloud(api_key="your_api_key")

  # Delete the collection
  delete_collection = client.collection.delete_collection(
      collection_id="my_unique_collection_id"
  )

  print(delete_collection)
  ```

  ```javascript JavaScript theme={null}
  import Wetrocloud from "wetro-sdk";

  // Initialize the Wetrocloud client
  const client = new Wetrocloud({
    apiKey: "your_api_key"
  });

  // Delete the collection
  const response = await client.collection.deleteCollection({
    collection_id: "my_unique_collection_id"
  });

  console.log("Delete response:", response);
  ```

  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://api.wetrocloud.com/v1/collection/delete/ \
    --header 'Authorization: Token <api-key>' \
    --header 'Content-Type: application/json' \
    --data '{
      "collection_id": "my_unique_collection_id"
    }'
  ```
</CodeGroup>

***

### Successful Response

Upon successful deletion, the endpoint returns a confirmation message and a success flag.

**Example Response**

```json theme={null}
{
  "message": "Collection deleted successfully.",
  "success": true
}
```

| Field     | Description                                        |
| --------- | -------------------------------------------------- |
| `message` | A user-friendly message about the deletion status. |
| `success` | Indicates whether the deletion was successful.     |
