> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0xd8nn-file-operations/0xd831-delete-file-from-device.md).

# 0xD831 - Delete File from Device

The host uses this command to request the deletion of a file stored on the device.&#x20;

The sequence of events is as follows:

{% stepper %}
{% step %}

### Host composes and sends request

The host composes a command request in the format below and sends it to the device.
{% endstep %}

{% step %}

### Device processes request

The device reads and erases the file and sends a response to the host in the format below.
{% endstep %}

{% step %}

### Failure handling

If the file read or the file erase fails, a response of failure will be sent to the host.
{% endstep %}
{% endstepper %}

## Request Data for Command 0xD831 – Delete File from Device

<table><thead><tr><th>Tag</th><th width="73">Len</th><th>Value / Description</th><th width="75.33331298828125">Typ</th><th width="74.66668701171875">Req</th><th width="96.666748046875">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Request Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>D831 = <strong>Command 0xD831 - Delete File from Device</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>81</td><td>04</td><td>File ID from <a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0xd8nn-file-operations/about-files"><mark style="color:red;"><strong>File Types</strong></mark></a></td><td>B</td><td>R</td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Request Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Response Data for Command 0xD831 – Delete File from Device

<table><thead><tr><th>Tag</th><th width="74.6666259765625">Len</th><th width="172.33331298828125">Value / Description</th><th width="77">Typ</th><th width="74.6666259765625">Req</th><th width="98">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Response Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>D831 = <strong>Delete File from Device- Command 0xD831</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>No parameters.</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Response Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

#### Request Example

{% code title="Example (hex)" %}

```
AA 00 81 04 01 05 D8 31 84 08 D8 31 81 04 02 00 00 00
```

{% endcode %}

#### Response Example

{% code title="Example (hex)" %}

```
AA 00 81 04 82 05 D8 31 82 04 00 00 00 00
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0xd8nn-file-operations/0xd831-delete-file-from-device.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
