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, code: number, data: any}.
Phone numbers use the international format, digits only, without the leading plus sign. Example: 14155552671.
The instance must be connected.
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;
Response — the number is on WhatsApp:
{
"success": true,
"code": 200,
"message": "The phone number is registered on WhatsApp",
"data": null
}
A number that is not on WhatsApp returns HTTP 400 with success: false and the message The phone number is not registered on WhatsApp.
Add or edit a number in your WhatsApp contacts
POST /contacts/push
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/push \
-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/push', {
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/push', {
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/push', [
'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/push');
$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/push', 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())
Response
{
"success": true,
"code": 200,
"message": "The contact is saved into your WhatsApp contacts.",
"data": null
}
Remove a number from your WhatsApp contacts
POST /contacts/delete
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/delete \
-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/delete', {
instance: 'my-instance-1',
phone: '14155552671',
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/contacts/delete', {
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/delete', [
'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/delete');
$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/delete', json={
'instance': 'my-instance-1',
'phone': '14155552671',
}, headers={'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY'}).json())
Response
{
"success": true,
"code": 200,
"message": "The phone number is removed from your WhatsApp contacts",
"data": null
}