Update Device PUT
Update a device's name or settings.
Endpoint
PUT https://api.pocketalert.app/v1/devices/{tid}Authentication
Required
Include one of these headers in your request:
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tid | string | ✅ | Device unique identifier |
Headers
| Header | Required | Description |
|---|---|---|
Token | ✅ | Your API key |
Authorization | ✅ | Bearer <jwt-token> |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | New device name |
Example Request
bash
curl -X PUT "https://api.pocketalert.app/v1/devices/9dc24hqldvv2bfx2nlc6r" \
-H "Token: your-api-key" \
-H "Content-Type: application/json" \
-d '{"name": "My iPhone"}'javascript
const tid = '9dc24hqldvv2bfx2nlc6r';
const response = await fetch(`https://api.pocketalert.app/v1/devices/${tid}`, {
method: 'PUT',
headers: {
'Token': 'your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({ name: 'My iPhone' })
});python
import requests
tid = '9dc24hqldvv2bfx2nlc6r'
response = requests.put(
f'https://api.pocketalert.app/v1/devices/{tid}',
headers={'Token': 'your-api-key'},
json={'name': 'My iPhone'}
)
print(response.json())php
$tid = '9dc24hqldvv2bfx2nlc6r';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/devices/'.$tid, [
'name' => 'My iPhone',
]);
return $response->json();Response
Success Response
200 OK
Device updated successfully
json
{
"data": "success"
}Error Responses
| Status | Description |
|---|---|
401 | Unauthorized — Invalid or missing token |
404 | Not Found — Device does not exist |
422 | Validation Error — Invalid parameters |
