restart device
curl --request POST \
--url https://api.chatlevel.io/v1/devices/{id}/restart \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "31612345678"
}
'import requests
url = "https://api.chatlevel.io/v1/devices/{id}/restart"
payload = { "phoneNumber": "31612345678" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '31612345678'})
};
fetch('https://api.chatlevel.io/v1/devices/{id}/restart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chatlevel.io/v1/devices/{id}/restart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '31612345678'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chatlevel.io/v1/devices/{id}/restart"
payload := strings.NewReader("{\n \"phoneNumber\": \"31612345678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chatlevel.io/v1/devices/{id}/restart")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"31612345678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatlevel.io/v1/devices/{id}/restart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"31612345678\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 200,
"message": "Device 12345 restarted successfully"
}
}{
"status": {
"code": 400,
"message": "Invalid JSON format"
}
}{
"status": "error",
"error": {
"code": 401,
"message": "Missing or invalid authorization header. Please provide a Bearer token."
}
}{
"status": {
"code": 404,
"message": "Device not found"
}
}{
"status": {
"code": 408,
"message": "Request timeout"
}
}{
"status": {
"code": 413,
"message": "Request payload too large"
}
}{
"status": {
"code": 429,
"message": "Rate limit exceeded. Maximum 100 requests per minute per user."
}
}{
"status": {
"code": 500,
"message": "Failed to restart device 12345"
}
}devices
restart device
Close any open socket (without logout) and start a new session. Optionally provide a phone number to receive a pairing code instead of QR.
POST
/
devices
/
{id}
/
restart
restart device
curl --request POST \
--url https://api.chatlevel.io/v1/devices/{id}/restart \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "31612345678"
}
'import requests
url = "https://api.chatlevel.io/v1/devices/{id}/restart"
payload = { "phoneNumber": "31612345678" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '31612345678'})
};
fetch('https://api.chatlevel.io/v1/devices/{id}/restart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chatlevel.io/v1/devices/{id}/restart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '31612345678'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chatlevel.io/v1/devices/{id}/restart"
payload := strings.NewReader("{\n \"phoneNumber\": \"31612345678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chatlevel.io/v1/devices/{id}/restart")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"31612345678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatlevel.io/v1/devices/{id}/restart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"31612345678\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 200,
"message": "Device 12345 restarted successfully"
}
}{
"status": {
"code": 400,
"message": "Invalid JSON format"
}
}{
"status": "error",
"error": {
"code": 401,
"message": "Missing or invalid authorization header. Please provide a Bearer token."
}
}{
"status": {
"code": 404,
"message": "Device not found"
}
}{
"status": {
"code": 408,
"message": "Request timeout"
}
}{
"status": {
"code": 413,
"message": "Request payload too large"
}
}{
"status": {
"code": 429,
"message": "Rate limit exceeded. Maximum 100 requests per minute per user."
}
}{
"status": {
"code": 500,
"message": "Failed to restart device 12345"
}
}Authorizations
API key authentication. Provide your API key as: Authorization: Bearer <api_key>
Path Parameters
Device ID Numeric device identifier
Body
application/json
Phone number for pairing code authentication (alternative to QR code). Must be digits only, include country code.
Example:
"31612345678"
Response
Device restarted successfully
Show child attributes
Show child attributes
⌘I
