> For the complete documentation index, see [llms.txt](https://docs.veilio.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veilio.xyz/documentation/great-to-know/offboarding.md).

# Offboarding & Account Exit

Veilio provides a guided offboarding flow so customers can recover all plaintext data and leave without vendor lock-in. Dashboard: Settings → Compliance → « Leave Veilio » (/dashboard/offboarding).

### Why a guided flow?

Account deletion is **irreversible**. The flow ensures you:

1. Understand the consequences.
2. Export all detokenized data.
3. Archive audit logs.
4. Confirm reintegration into your own systems.
5. Only then delete the account.

### Steps (4 required before deletion)

| Step                 | Requirement                                             | Validation                              |
| -------------------- | ------------------------------------------------------- | --------------------------------------- |
| 1. Understand        | Checkbox acknowledgement                                | Client-side                             |
| 2. Export data       | Full GDPR export (JSON or CSV)                          | Server: `hasCompletedExport` + 2FA      |
| 3. Export audit logs | Download JSON or CSV logs                               | Client: `logsDownloaded` after download |
| 4. Confirm recovery  | Three checkboxes (downloaded / verified / reintegrated) | Client-side                             |
| 5. Delete account    | Password confirmation                                   | `DELETE /api/compliance/delete-account` |

Progress is shown as **X/4** required steps. Deletion stays locked until all four are complete.

### Export data (step 2)

```http
POST /api/compliance/export
Content-Type: application/json

{
  "format": "json",
  "code": "123456"
}
```

* Requires authenticated session + **TOTP 2FA** code.
* Job runs asynchronously; email notification when ready.
* Export **detokenizes all your tokens** — quota checks are bypassed for this operation.
* Download via the one-time link from the offboarding UI or compliance settings.

### Export audit logs (step 3)

```http
GET /api/compliance/logs-export?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD&format=json
```

Choose a date range (default: last 30 days). **Mandatory** before account deletion.

### Inventory preview

Before exporting, the UI loads:

```http
GET /api/compliance/offboarding/summary
```

Returns active token count, datasets, API keys, shredded token count, and export status.

### Crypto-shredded data

Tokens that were **crypto-shredded** are permanently unrecoverable and will **not** appear in the export. The UI warns if shredded tokens exist.

### After deletion

All tokens, logs, API keys, datasets, and the subscription are removed. The user is logged out.
