# Delete Device (DELETE)

Remove a device from your account. This action cannot be undone.

## Endpoint

```
DELETE https://api.pocketalert.app/v1/devices/{tid}
```

## Authentication

> **Info: Required**
>
> Include one of these headers in your request:
> - `Token: <your-api-key>` — Get it from [API Keys](https://pocketalert.app/account/apikeys)
> - `Authorization: Bearer <jwt-token>` — From [Login](https://info.pocketalert.app/api/user/login.md)

## Request

### Path Parameters

| Parameter | Type | Required | Description |
|-----------|------|:--------:|-------------|
| `tid` | string | ✅ | Device unique identifier |

### Headers

| Header | Required | Description |
|--------|:--------:|-------------|
| `Token` | ✅ | Your API key |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

### Example Request

**cURL**

```bash
curl -X DELETE "https://api.pocketalert.app/v1/devices/9dc24hqldvv2bfx2nlc6r" \
  -H "Token: your-api-key"
```

**JavaScript**

```javascript
const tid = '9dc24hqldvv2bfx2nlc6r';
await fetch(`https://api.pocketalert.app/v1/devices/${tid}`, {
  method: 'DELETE',
  headers: { 'Token': 'your-api-key' }
});
```

**Python**

```python
import requests

tid = '9dc24hqldvv2bfx2nlc6r'
response = requests.delete(
    f'https://api.pocketalert.app/v1/devices/{tid}',
    headers={'Token': 'your-api-key'}
)
```

**PHP**

```php
$tid = '9dc24hqldvv2bfx2nlc6r';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->delete('https://api.pocketalert.app/v1/devices/'.$tid);

return $response->json();
```

## Response

### Success Response

> **Tip: 200 OK**
>
> Device deleted successfully

```json
{
  "data": "success"
}
```

### Error Responses

| Status | Description |
|:------:|-------------|
| `401` | Unauthorized — Invalid or missing token |
| `404` | Not Found — Device does not exist |

> **Warning: Note**
>
> After deleting a device, it will need to be re-registered through the mobile app to receive notifications again.
