Skip to content

Get All Devices GET

Retrieve a list of all devices registered to your account.

Endpoint

GET https://api.pocketalert.app/v1/devices

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

Headers

HeaderRequiredDescription
TokenYour API key
AuthorizationBearer <jwt-token>

Example Request

bash
curl -X GET "https://api.pocketalert.app/v1/devices" \
  -H "Token: your-api-key"
javascript
const response = await fetch('https://api.pocketalert.app/v1/devices', {
  headers: { 'Token': 'your-api-key' }
});

const devices = await response.json();
python
import requests

response = requests.get(
    'https://api.pocketalert.app/v1/devices',
    headers={'Token': 'your-api-key'}
)
print(response.json())
php
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/devices');

return $response->json();

Response

Success Response

200 OK

Returns an array of device objects

FieldTypeDescription
tidstringUnique device identifier
namestringDevice name
serial_numberstringDevice serial number
is_activebooleanWhether the device is active
created_atstringRegistration timestamp
json
[
  {
    "tid": "9dc24hqldvv2bfx2nlc6r",
    "name": "iPhone 15 Pro",
    "serial_number": "123456-OK91-KLAI-8K91-32A0AKSA28X2",
    "is_active": true,
    "created_at": "12.06.2023 02:48:49"
  },
  {
    "tid": "qjxozlq7xr7fakrjplj193",
    "name": "Android Tablet",
    "serial_number": "GP2A.2891092711.017",
    "is_active": true,
    "created_at": "07.06.2023 22:44:47"
  }
]

Error Responses

StatusDescription
401Unauthorized — Invalid or missing token

Pocket Alert Documentation