Skip to content

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:

  • Token: <your-api-key> — Get it from API Keys
  • Authorization: Bearer <jwt-token> — From Login

Request

Path Parameters

ParameterTypeRequiredDescription
tidstringDevice unique identifier

Headers

HeaderRequiredDescription
TokenYour API key
AuthorizationBearer <jwt-token>

Body Parameters

ParameterTypeRequiredDescription
namestringNew 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

StatusDescription
401Unauthorized — Invalid or missing token
404Not Found — Device does not exist
422Validation Error — Invalid parameters

Pocket Alert Documentation