Skip to main content
PUT
/
devices
/
{id}
update device
curl --request PUT \
  --url https://api.chatlevel.io/v1/devices/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "webhookUrl": "<string>",
  "webhookEvents": [
    "connection.open"
  ],
  "subscription_status": "active"
}
'
{
  "device": {
    "id": 12345,
    "name": "Updated Device Name",
    "status": "connected",
    "qr": null,
    "webhookUrl": "https://example.com/new-webhook",
    "webhookEvents": [
      "message.received"
    ],
    "messagesSent": 150,
    "subscription_status": "active",
    "createdAt": "2024-01-15T10:30:00Z"
  },
  "status": {
    "code": 200,
    "message": "Device updated successfully"
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Provide your API key as: Authorization: Bearer <api_key>

Path Parameters

id
integer
required

Device ID Numeric device identifier

Body

application/json
name
string

New name for the device

webhookUrl
string | null

Webhook URL for receiving events (null to disable)

webhookEvents
enum<string>[]

Events to send to webhook. See webhook documentation for event payloads.

Available options:
connection.open,
connection.closed,
connection.auth,
connection.timeout,
connection.logout,
message.received,
message.sent,
message.updated,
message.deleted,
call
subscription_status
enum<string>

Subscription status. When set to 'inactive', the WhatsApp session is stopped but auth data is preserved for reactivation. When set to 'active', the session is restarted.

Available options:
active,
inactive

Response

Device updated successfully

device
object
status
object