Skip to main content
POST
/
devices
create device
curl --request POST \
  --url https://api.chatlevel.io/v1/devices \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "webhookUrl": "<string>",
  "webhookEvents": [
    "connection.open"
  ],
  "phoneNumber": "31612345678"
}
'
{
  "device": {
    "id": 12345,
    "name": "My Device",
    "status": "qr",
    "qr": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "webhookUrl": "https://example.com/webhook",
    "webhookEvents": [
      "message.received",
      "message.sent"
    ],
    "messagesSent": 0,
    "subscription_status": "active",
    "createdAt": "2024-01-15T10:30:00Z"
  },
  "status": {
    "code": 200,
    "message": "Device created successfully"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string

User-friendly device name

webhookUrl
string

Webhook URL for receiving events

webhookEvents
enum<string>[]

Events to send to webhook (defaults to all). 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
phoneNumber
string

Phone number for pairing code authentication (alternative to QR code). Must be digits only, include country code, no + or spaces.

Example:

"31612345678"

Response

Device created successfully

device
object
status
object