Delete Device DELETE
Hapus perangkat dari akun Anda. Tindakan ini tidak dapat dibatalkan.
Endpoint
DELETE https://api.pocketalert.app/v1/devices/{tid}Autentikasi
Wajib
Sertakan salah satu header berikut dalam permintaan Anda:
Permintaan
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tid | string | ✅ | Pengenal unik perangkat |
Headers
| Header | Required | Description |
|---|---|---|
Token | ✅ | Kunci API Anda |
Authorization | ✅ | Bearer <jwt-token> |
Contoh Permintaan
bash
curl -X DELETE "https://api.pocketalert.app/v1/devices/9dc24hqldvv2bfx2nlc6r" \
-H "Token: your-api-key"javascript
const tid = '9dc24hqldvv2bfx2nlc6r';
await fetch(`https://api.pocketalert.app/v1/devices/${tid}`, {
method: 'DELETE',
headers: { 'Token': 'your-api-key' }
});python
import requests
tid = '9dc24hqldvv2bfx2nlc6r'
response = requests.delete(
f'https://api.pocketalert.app/v1/devices/{tid}',
headers={'Token': 'your-api-key'}
)php
$tid = '9dc24hqldvv2bfx2nlc6r';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->delete('https://api.pocketalert.app/v1/devices/'.$tid);
return $response->json();Respons
Respons Sukses
200 OK
Perangkat berhasil dihapus
json
{
"data": "success"
}Respons Error
| Status | Description |
|---|---|
401 | Unauthorized — Token tidak valid atau tidak ada |
404 | Not Found — Perangkat tidak ditemukan |
Catatan
Setelah menghapus perangkat, perangkat tersebut perlu didaftarkan ulang melalui aplikasi seluler agar dapat menerima notifikasi kembali.