# Delete a location

`DELETE /api/v1/locations/{location}`

Remove a location that holds no other and that no possession has stayed at.

A location holding others answers 422 on location, saying how many and that they must be moved first, for instance "1 location is inside it. Move it first." Nothing is moved on your behalf.

A location any stay of a possession refers to, current or past, answers 422 on location as well, for instance "1 stay of a possession is here. Correct or delete it first." The history of a possession is never lost on your behalf.

The deletion is final, and the account log keeps the name of the location.

## Path parameters

- `location` (uuid, required): The id of the location. A location belonging to somebody else answers 404.

## Returns

Nothing. A location holding others or referred to by a stay answers 422, and one belonging to somebody else 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/locations/e83a1f6d-27c4-4b95-8d02-6f1b9c4e7a58 \
  -X DELETE \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/locations/e83a1f6d-27c4-4b95-8d02-6f1b9c4e7a58', {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${token}` },
})
```

```php
$response = Http::withToken($token)->delete('https://my.monicahq.com/api/v1/locations/e83a1f6d-27c4-4b95-8d02-6f1b9c4e7a58');
```

## Response

`204`

```json
[]
```
