Create a new device slot for multi-device management
cURL
curl --request POST \ --url https://api.example.com/devices \ --header 'Content-Type: application/json' \ --data ' { "device_id": "<string>" } '
{ "400": {}, "500": {}, "code": "<string>", "message": "<string>", "status": 123, "results": { "id": "<string>", "phone_number": "<string>", "display_name": "<string>", "state": "<string>", "jid": "<string>", "created_at": "<string>" } }
POST /devices
Show example
my-custom-device-id
{ "device_id": "my-custom-device-id" }
{}
SUCCESS
Device added
200
Show properties
Show values
disconnected
2024-01-01T00:00:00Z
{ "code": "SUCCESS", "message": "Device added", "status": 200, "results": { "id": "my-custom-device-id", "phone_number": "", "display_name": "", "state": "disconnected", "jid": "", "created_at": "2024-01-01T00:00:00Z" } }
Show response
{ "code": "400", "message": "Device ID already exists", "results": null }
{ "code": "INTERNAL_SERVER_ERROR", "message": "Error creating device", "results": null }
curl -X POST http://localhost:3000/devices \ -u username:password \ -H "Content-Type: application/json" \ -d '{"device_id": "my-custom-device-id"}'
X-Device-Id