# Remove a document from a transaction

`DELETE /api/v1/vaults/{vault}/possessions/{possession}/transactions/{transaction}/documents/{file}`

Remove a document from a transaction. The change is written to the account log.

The file is let go rather than deleted outright. It stays wherever else it is used, and is swept up after a grace period once nothing uses it.

## Path parameters

- `vault` (string, required): The vault the possession is kept in, named either by the readable name it reports as slug or by its id. A vault of another account answers 404.
- `possession` (uuid, required): The id of the possession. A possession of another vault or of another account answers 404.
- `transaction` (uuid, required): The id of the transaction. A transaction of another possession answers 404.
- `file` (uuid, required): The id of the document, as the documents of the transaction give it. A document of another transaction answers 404.

## Returns

Nothing. A transaction of another possession, a document of another transaction or of another account answers 404.

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://my.monicahq.com/api/v1/vaults/dunder-mifflin/possessions/9c4e2a71-5b38-4f06-8d1e-2a7f3c6b9e15/transactions/3f8a1c62-7d94-4b2e-a5c0-6e9b2d4f1a83/documents/5c2e8f14-9a63-4d7b-b0e1-3f6a9c4d2e58 \
  -X DELETE \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/vaults/dunder-mifflin/possessions/9c4e2a71-5b38-4f06-8d1e-2a7f3c6b9e15/transactions/3f8a1c62-7d94-4b2e-a5c0-6e9b2d4f1a83/documents/5c2e8f14-9a63-4d7b-b0e1-3f6a9c4d2e58', {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${token}` },
})
```

```php
$response = Http::withToken($token)->delete('https://my.monicahq.com/api/v1/vaults/dunder-mifflin/possessions/9c4e2a71-5b38-4f06-8d1e-2a7f3c6b9e15/transactions/3f8a1c62-7d94-4b2e-a5c0-6e9b2d4f1a83/documents/5c2e8f14-9a63-4d7b-b0e1-3f6a9c4d2e58');
```

## Response

`204`

```json
[]
```
