curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_uuids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"priority": 0
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts"
payload = {
"contact_uuids": ["550e8400-e29b-41d4-a716-446655440000"],
"priority": 0
}
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({contact_uuids: ['550e8400-e29b-41d4-a716-446655440000'], priority: 0})
};
fetch('https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts', 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://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts",
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([
'contact_uuids' => [
'550e8400-e29b-41d4-a716-446655440000'
],
'priority' => 0
]),
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://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts"
payload := strings.NewReader("{\n \"contact_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"priority\": 0\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://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"priority\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts")
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 \"contact_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"priority\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "N contact(s) added to pool, M task(s) created across K running campaign(s).",
"data": {
"pool_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contacts_added": 123,
"contacts_skipped": 123,
"contact_uuids_not_found": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tasks_created": 123,
"running_campaign_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}Add existing contacts to a pool
Adds one or more existing contacts (by UUID) to the pool, creating ContactPoolItem rows with status=Pending. Contacts already present in the pool are silently skipped (no error). UUIDs that don’t resolve to a contact are returned in contact_uuids_not_found rather than failing the whole call. Side effect: if the pool is attached to ONE OR MORE campaigns currently in ‘In Process’ status, tasks are auto-created for the newly added contacts in EVERY running campaign — and ProcessWhatsAppCampaign is dispatched for text/sms campaigns. The whole operation is transactional: pool inserts and task creation succeed together or roll back together.
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_uuids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"priority": 0
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts"
payload = {
"contact_uuids": ["550e8400-e29b-41d4-a716-446655440000"],
"priority": 0
}
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({contact_uuids: ['550e8400-e29b-41d4-a716-446655440000'], priority: 0})
};
fetch('https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts', 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://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts",
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([
'contact_uuids' => [
'550e8400-e29b-41d4-a716-446655440000'
],
'priority' => 0
]),
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://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts"
payload := strings.NewReader("{\n \"contact_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"priority\": 0\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://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"priority\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/pools/{uuid}/contacts")
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 \"contact_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"priority\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "N contact(s) added to pool, M task(s) created across K running campaign(s).",
"data": {
"pool_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contacts_added": 123,
"contacts_skipped": 123,
"contact_uuids_not_found": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tasks_created": 123,
"running_campaign_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Path Parameters
UUID of the pool to add contacts to.
Body
UUIDs of existing contacts to add. Use POST /api/v1/contacts to create new contacts first if needed. Duplicates within the array are deduplicated server-side.
1Priority assigned to the new pool items. Higher values are picked first when type='Parallel'. Ignored for FIFO/LIFO pools. Default: 0.
0
Response
Operation summary. Response includes how many contacts were added, skipped, or not found, plus how many tasks were created across all running campaigns.
