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

# Delete Document

> Delete a document you uploaded, together with its extracted results

Delete a document you uploaded with [Upload Document](https://docs.anivahealth.com/api/documents/upload-document.md). Use it when
you uploaded a file to the wrong profile. Aniva deletes the file and every value extracted from it.
The values also leave the member's Aniva app.

Requires the `documents_upload` scope on the profile group the document was uploaded under.

Aniva then sends the `document.deleted` [webhook](https://docs.anivahealth.com/concepts/webhooks.md) to the endpoints that received
the last results event of the document. A delete cannot be undone.

## Request

### Path parameters

**id** `string` *required*

Document ID (UUID) from the upload response.

## Response

On success, the API returns `200 OK`.

**id** `string` *required*

The deleted document.

**deleted** `boolean` *required*

Always `true`.

## Error responses

| Status | Description |
| - | - |
| `400` | Invalid ID format. |
| `403` | Your API key lacks the `documents_upload` scope. |
| `404` | No document uploaded under one of your profile groups has this ID. |
| `500` | Internal server error. |

```bash cURL theme={null}
curl --request DELETE \
  --url https://anivahealth.com/api/v1/documents/f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c \
  --header 'x-api-key: YOUR_API_KEY'
```

```json 200 theme={null}
{
  "id": "f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c",
  "deleted": true
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.