GET /admin/devices

Get all devices across all API keys with customer information. Useful for admin dashboard overview.

Responses

  • 200 application/json

    Devices retrieved successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data array[object]
      Hide data attributes Show data attributes object
      • device_id string
      • device_name string
      • whatsmeow_jid string
      • status string
      • customer_name string
      • api_key_id integer
      • created_at string
      • last_active_at string
  • 401 application/json

    Unauthorized - Invalid admin secret

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
GET /admin/devices
curl \
 --request GET 'http://localhost:7001/admin/devices' \
 --header "X-Admin-Secret: $API_KEY"
Response examples (200)
{
  "code": 200,
  "data": [
    {
      "status": "connected",
      "device_id": "550e8400-e29b-41d4-a716-446655440000",
      "api_key_id": 1,
      "created_at": "2025-01-01T00:00:00Z",
      "device_name": "Production Phone",
      "customer_name": "Acme Corp",
      "whatsmeow_jid": "6281234567890@s.whatsapp.net",
      "last_active_at": "2025-12-17T10:30:00Z"
    },
    {
      "status": "disconnected",
      "device_id": "660e8400-e29b-41d4-a716-446655440001",
      "api_key_id": 2,
      "created_at": "2025-02-15T00:00:00Z",
      "device_name": "Support Phone",
      "customer_name": "Tech Solutions",
      "whatsmeow_jid": "6289876543210@s.whatsapp.net",
      "last_active_at": "2025-12-16T08:15:00Z"
    }
  ],
  "status": true,
  "message": "Devices retrieved successfully"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Devices retrieved successfully",
  "data": [
    {
      "device_id": "550e8400-e29b-41d4-a716-446655440000",
      "device_name": "Production Phone",
      "whatsmeow_jid": "6281234567890@s.whatsapp.net",
      "status": "connected",
      "customer_name": "Acme Corp",
      "api_key_id": 1,
      "created_at": "2025-01-01T00:00:00Z",
      "last_active_at": "2025-12-17T10:30:00Z"
    }
  ]
}
Response examples (401)
{
  "code": 401,
  "error": "Invalid or missing admin secret",
  "status": false,
  "message": "Unauthorized"
}
Response examples (401)
{
  "status": false,
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing authentication"
}
Response examples (500)
{
  "code": 500,
  "error": "Failed to retrieve devices",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}