---
title: Discard a pentest draft
description: Delete a pentest that hasn't started.
url: https://www.hacktron.ai/docs/api/pentests/discard-pentest
---

# Discard a pentest draft

Deletes a pentest draft and its saved login details. To end a pentest that has already started, use [`POST /scans/{id}/stop`](/docs/api/scans/stop-scan). You need the member role or above.

## Request

`DELETE /pentests/{id}`

Send an [API key](/docs/api/authentication) with the `write` scope in the `X-Api-Key` header.

:::examples

```bash title="Request" wrap=false
curl -X DELETE "https://api.hacktron.ai/v1/pentests/<id>" \
  -H "X-Api-Key: $HACKTRON_API_KEY"
```

```json title="Response 200 OK" showLineNumbers=false wrap=false
{
  "scan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "discarded": true
}
```

:::

### Path parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `id` | string, required | |

## Responses

### 200 OK

| Field | Type | Description |
| --- | --- | --- |
| `scan_id` | string (uuid), required | |
| `discarded` | boolean, required | |
