Contacts API
Manage WhatsApp contacts associated with your instance.
All requests are POST with Content-Type: application/json and must include the X-API-KEY header. Responses follow {message: string, success: boolean}
.
Phone numbers must be E.164 digits without the leading plus sign. Example: 14155552671.
Check if a phone number is on WhatsApp
POST /contacts/check
When to use it
- Verify if a number is WhatsApp-registered before attempting messages or saving as contact.
- Useful for validation during signup or import flows.
Body
- instance: string — Your instance identifier.
- phone: string — E.164 number without plus (digits only).
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/contacts/check \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"phone": "14155552671"
}'
import axios from 'axios';
axios.post('https://api.communiktor.com/contacts/check', {
instance: 'my-instance-1',
phone: '14155552671',
}, {
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
}
}).then(r => console.log(r.data)).catch(e => console.error(e.response?.data || e.message));
const res = await fetch('https://api.communiktor.com/contacts/check', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
},
body: JSON.stringify({
instance: 'my-instance-1',
phone: '14155552671',
}),
});
console.log(await res.json());
import requests
response = requests.post(
'https://api.communiktor.com/contacts/check',
json={
'instance': 'my-instance-1',
'phone': '14155552671',
},
headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
}
)
print(response.json())
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$response = $client->post('/contacts/check', [
'headers' => [
'Content-Type' => 'application/json',
'X-API-KEY' => 'YOUR_API_KEY',
],
'json' => [
'instance' => 'my-instance-1',
'phone' => '14155552671',
],
]);
echo $response->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/contacts/check');
$payload = json_encode([
'instance' => 'my-instance-1',
'phone' => '14155552671',
]);
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;
Add or edit a number in your WhatsApp contacts
POST /contacts/add
When to use it
- Create or update a contact in the device address book used by the instance.
- Keep names synchronized with your CRM.
Body
- instance: string — Your instance identifier.
- phone: string — E.164 number without plus (digits only).
- lastname: string — Contact last name.
- firstname: string — Contact first name.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/contacts/add \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"phone": "14155552671",
"lastname": "Doe",
"firstname": "Jane"
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/contacts/add', {
instance: 'my-instance-1',
phone: '14155552671',
lastname: 'Doe',
firstname: 'Jane',
}, {
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' }
});
await fetch('https://api.communiktor.com/contacts/add', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
phone: '14155552671',
lastname: 'Doe',
firstname: 'Jane',
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/contacts/add', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'phone' => '14155552671',
'lastname' => 'Doe',
'firstname' => 'Jane',
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/contacts/add');
$payload = json_encode([
'instance' => 'my-instance-1',
'phone' => '14155552671',
'lastname' => 'Doe',
'firstname' => 'Jane',
]);
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
r = requests.post('https://api.communiktor.com/contacts/add', json={
'instance': 'my-instance-1',
'phone': '14155552671',
'lastname': 'Doe',
'firstname': 'Jane',
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Remove a number from your WhatsApp contacts
POST /contacts/remove
When to use it
- Clean up your device address book to avoid clutter.
- Remove stale or wrong contacts.
Body
- instance: string — Your instance identifier.
- phone: string — E.164 number without plus (digits only).
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/contacts/remove \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"phone": "14155552671"
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/contacts/remove', {
instance: 'my-instance-1',
phone: '14155552671',
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/contacts/remove', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({ instance: 'my-instance-1', phone: '14155552671' })
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$client->post('/contacts/remove', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [ 'instance' => 'my-instance-1', 'phone' => '14155552671' ]
]);
<?php
$ch = curl_init('https://api.communiktor.com/contacts/remove');
$payload = json_encode(['instance' => 'my-instance-1', 'phone' => '14155552671']);
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/contacts/remove', json={
'instance': 'my-instance-1',
'phone': '14155552671',
}, headers={'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY'}).json())