# Delete Data

### Endpoint

```
POST /api/v1/data/delete
```

***

### Request Body

| Field    | Type   | Required   | Description                                                       |
| -------- | ------ | ---------- | ----------------------------------------------------------------- |
| `userId` | string | <h3>✓</h3> | The player's Roblox user ID                                       |
| `key`    | string | <h3>✗</h3> | The key to delete. If omitted, all data for the player is deleted |

***

### Example Requests

#### Delete a single key

```lua
Auxvyn.delete(player.UserId, "temporaryBuff")
```

#### Delete all data for a player

```lua
Auxvyn.delete(player.UserId)
```

***

### Example Response

```json
{
  "success": true
}
```

***

### This Cannot Be Undone

Deleting data is permanent. There is no recycle bin or recovery option. Once a key or player record is deleted it is gone forever.

Before deleting player data make sure you:

* Are certain you want to remove it permanently
* Are not accidentally calling delete on the wrong user ID
* Have a backup if the data is critical

***

### When to Use Delete

Common use cases for deleting data:

* Removing temporary buffs or effects when they expire
* Clearing a player's data when they request an account reset
* Removing test data during development
* Cleaning up keys that are no longer used in your game

***

### Error Responses

| Code  | Reason                       |
| ----- | ---------------------------- |
| `400` | Missing `userId`             |
| `401` | Missing or invalid API key   |
| `500` | Failed to delete — try again |

***

### What's Next


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://auxvyn.gitbook.io/auxvyn-docs/api-reference/delete-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
