Skip to main content

📱 Device Management

Manage your WhatsApp devices with the Whatspie API. Create, monitor, and control your WhatsApp Business connections with comprehensive device lifecycle management.

🔗 Device Connection

Complete device management including creation, QR code generation, connection monitoring, and package management for your WhatsApp Business integration.

🌐 Base URL

https://api.whatspie.com

🔐 Authentication

All device management endpoints require Bearer token authentication:

Authorization: Bearer <YOUR_API_TOKEN>

📋 Device Operations Overview

OperationMethodEndpointDescription
Create DevicePOST/devicesCreate a new WhatsApp device
List DevicesGET/devicesGet all your devices
Get Device InfoGET/devices/{id}Get specific device details
Get QR CodeGET/devices/{id}/qrGet QR code for device connection

🆕 Create Device

Create a new WhatsApp device with a specific package plan.

Endpoint

POST https://api.whatspie.com/devices

Request Parameters

ParameterTypeRequiredDescription
packagestringPackage plan (e.g., "STARTUP240K")
namestringDisplay name for the device

Request Example

curl -L -X POST 'https://api.whatspie.com/devices' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json; charset=utf-8' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"package": "STARTUP240K",
"name": "Customer Service"
}'

Success Response

TBA

Error Response

{
"code": 400,
"message": "Invalid package type"
}

📋 List Devices

Get all devices associated with your account.

Endpoint

GET https://api.whatspie.com/devices

Request Example

curl -L -X GET 'https://api.whatspie.com/devices' \
-H 'Accept: application/json; charset=utf-8' \
-H 'Authorization: Bearer <TOKEN>'

Success Response

{
"status": 200,
"message": "OK",
"data": [
{
"id": 2076,
"phone": "6289510154496",
"webhook_url": "https://your-webhook-url.com",
"status": "ACTIVE",
"version": "multidevice",
"paired_status": "UNPAIRED",
"created_at": "2022-03-15T00:32:13Z",
"updated_at": "2025-08-14T23:26:01Z",
"server": {
"name": "EUR (DEU1)",
"status": "ACTIVE"
},
"package": {
"code": "STARTUP240K",
"name": "Startup"
},
"subscription": {
"quote_available": "-1",
"quote_used": "522"
}
}
]
}

Device Status Values

StatusDescription
UNPAIREDDevice not connected to WhatsApp
PAIREDDevice successfully connected
EXPIREDQR code expired, need to reconnect
SUSPENDEDDevice temporarily suspended

📱 Get Device Information

Get detailed information about a specific device.

Endpoint

GET https://api.whatspie.com/devices/{id}

Request Example

curl -L -X GET 'https://api.whatspie.com/devices/6' \
-H 'Accept: application/json; charset=utf-8' \
-H 'Authorization: Bearer <TOKEN>'

Success Response

{
"status": 200,
"message": "OK",
"data": {
"id": 5,
"phone": "62895383079050",
"webhook_url": "https://your-webhook-url.com",
"status": "ACTIVE",
"version": "multidevice",
"paired_status": "PAIRED",
"created_at": "2020-02-26T07:06:47Z",
"updated_at": "2025-08-11T21:30:42Z",
"server": {
"name": "ASIA (IDN1)",
"status": "ACTIVE"
},
"package": {
"code": "STARTUP240K",
"name": "Startup"
},
"subscription": {
"quote_available": "-1",
"quote_used": "62755"
}
}
}

Error Response (Device Not Found)

{
"code": 404,
"message": "Device not found"
}

📱 Get QR Code

Generate or retrieve the QR code for device connection.

Endpoint

GET https://api.whatspie.com/devices/{id}/qr

Request Parameters

ParameterTypeRequiredDescription
response_typestringurl

Request Example

curl -L -X GET 'https://api.whatspie.com/devices/5/qr?response_type=url' \
-H 'Accept: application/json; charset=utf-8' \
-H 'Authorization: Bearer <TOKEN>'

Success Response

{
"status": 200,
"message": "OK",
"data": {
"qr": "data:image/png;base64,json-image"
}
}

Error Response (Device Already Connected)

{
"code": 200,
"message": "Device connected"
}

Error Response (QR Code Generation Failed)

{
"code": 500,
"message": "QR code generation failed"
}

📦 Package Types

Available package codes for device creation:

IDPackage CodeName
1BETABeta Tester
2STARTER60KStarter
3STARTUP240KStartup
4BUSINESSBusiness

Package Selection Examples

# Create device with Starter package
curl -L -X POST 'https://api.whatspie.com/devices' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
--data-raw '{
"package": "STARTER60K",
"name": "Basic Bot"
}'

# Create device with Business package
curl -L -X POST 'https://api.whatspie.com/devices' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
--data-raw '{
"package": "BUSINESS",
"name": "Enterprise Bot"
}'

🔧 Best Practices

Device Creation

  1. Meaningful Names: Use descriptive names for easy identification
  2. Package Selection: Choose appropriate package based on usage needs
  3. Monitoring: Implement connection monitoring for critical devices

QR Code Management

  1. Secure Display: Only show QR codes in secure environments
  2. Expiry Handling: Handle QR code expiration gracefully
  3. Auto-refresh: Implement automatic QR code refresh when expired

Connection Monitoring

  1. Regular Checks: Monitor device status every 3-5 seconds during connection
  2. Timeout Handling: Set reasonable timeouts for connection attempts
  3. Error Recovery: Implement retry logic for failed connections

🚨 Common Errors

Package Not Available

{
"code": 400,
"message": "Invalid package type",
"error": "Package 'INVALID_PACKAGE' is not available"
}

Device Limit Reached

{
"code": 403,
"message": "Device limit exceeded",
"error": "Maximum number of devices reached for your plan"
}

Device Not Found

{
"code": 404,
"message": "Device not found",
"error": "Device with ID 999 does not exist"
}

🔗 Next Steps

Once your device is connected:

Your WhatsApp Business device is now ready for automated messaging!