Instances API
Manage your WhatsApp instances: start, restart, stop, and disconnect. Each use case below is explained with concrete examples.
- All requests are HTTP POST (unless stated otherwise) with
Content-Type: application/json
and theX-API-KEY
header. - Responses follow
{ message: string, success: boolean, ... }
.
Start an instance
Endpoint: POST /instances/start
When to use it
- To initialize a newly created instance or relaunch after a stop.
- Required before generating a QR if the instance was inactive.
Body
- instance: string — Your instance identifier.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/instances/start \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1"
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/instances/start', {
instance: 'my-instance-1',
}, {
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' }
});
await fetch('https://api.communiktor.com/instances/start', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({ instance: 'my-instance-1' })
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$response = $client->post('/instances/start', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [ 'instance' => 'my-instance-1' ]
]);
echo $response->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/instances/start');
$payload = json_encode(['instance' => 'my-instance-1']);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $response;
import requests
r = requests.post('https://api.communiktor.com/instances/start', json={
'instance': 'my-instance-1'
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Restart an instance
Endpoint: POST /instances/restart
When to use it
- After a configuration change.
- To restore an unstable connection without forcing a new QR.
Body
- instance: string — The instance identifier.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/instances/restart \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1"
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/instances/restart', {
instance: 'my-instance-1'
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/instances/restart', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({ instance: 'my-instance-1' })
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$client->post('/instances/restart', [
'headers' => [ 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
'json' => [ 'instance' => 'my-instance-1' ]
]);
<?php
$ch = curl_init('https://api.communiktor.com/instances/restart');
$payload = json_encode(['instance' => 'my-instance-1']);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
print(requests.post('https://api.communiktor.com/instances/restart', json={'instance': 'my-instance-1'}, headers={'Content-Type':'application/json','X-API-KEY':'YOUR_API_KEY'}).json())
Stop an instance
Endpoint: POST /instances/stop
When to use it
- Take the instance offline gracefully.
- Temporarily suspend sending/receiving messages.
Body
- instance: string — The instance identifier.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/instances/stop \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1"
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/instances/stop', { instance: 'my-instance-1' }, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/instances/stop', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({ instance: 'my-instance-1' })
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$client->post('/instances/stop', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [ 'instance' => 'my-instance-1' ]
]);
<?php
$ch = curl_init('https://api.communiktor.com/instances/stop');
$payload = json_encode(['instance' => 'my-instance-1']);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
print(requests.post('https://api.communiktor.com/instances/stop', json={'instance': 'my-instance-1'}, headers={'Content-Type':'application/json','X-API-KEY':'YOUR_API_KEY'}).json())
Disconnect the instance (logout)
Endpoint: POST /instances/disconnect
When to use it
- Invalidate the WhatsApp session and force re-login via QR.
- Useful if the phone changed or the session is corrupted.
Body
- instance: string — The instance identifier.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/instances/disconnect \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1"
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/instances/disconnect', { instance: 'my-instance-1' }, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/instances/disconnect', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({ instance: 'my-instance-1' })
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$client->post('/instances/disconnect', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [ 'instance' => 'my-instance-1' ]
]);
<?php
$ch = curl_init('https://api.communiktor.com/instances/disconnect');
$payload = json_encode(['instance' => 'my-instance-1']);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
print(requests.post('https://api.communiktor.com/instances/disconnect', json={'instance': 'my-instance-1'}, headers={'Content-Type':'application/json','X-API-KEY':'YOUR_API_KEY'}).json())