Create a new contact
curl --request POST \
--url https://agents.nineteen58.co.za/public-api/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"identifier": "1234567890",
"name": "John Doe",
"channel": "whatsapp",
"email": "john.doe@example.com",
"personal_context": "Met at Tech Conference 2024",
"notes": "Interested in AI solutions",
"relevant_information": "Prefers communication in the morning"
}
'import requests
url = "https://agents.nineteen58.co.za/public-api/contacts"
payload = {
"identifier": "1234567890",
"name": "John Doe",
"channel": "whatsapp",
"email": "john.doe@example.com",
"personal_context": "Met at Tech Conference 2024",
"notes": "Interested in AI solutions",
"relevant_information": "Prefers communication in the morning"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: '1234567890',
name: 'John Doe',
channel: 'whatsapp',
email: 'john.doe@example.com',
personal_context: 'Met at Tech Conference 2024',
notes: 'Interested in AI solutions',
relevant_information: 'Prefers communication in the morning'
})
};
fetch('https://agents.nineteen58.co.za/public-api/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://agents.nineteen58.co.za/public-api/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([
'identifier' => '1234567890',
'name' => 'John Doe',
'channel' => 'whatsapp',
'email' => 'john.doe@example.com',
'personal_context' => 'Met at Tech Conference 2024',
'notes' => 'Interested in AI solutions',
'relevant_information' => 'Prefers communication in the morning'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://agents.nineteen58.co.za/public-api/contacts"
payload := strings.NewReader("{\n \"identifier\": \"1234567890\",\n \"name\": \"John Doe\",\n \"channel\": \"whatsapp\",\n \"email\": \"john.doe@example.com\",\n \"personal_context\": \"Met at Tech Conference 2024\",\n \"notes\": \"Interested in AI solutions\",\n \"relevant_information\": \"Prefers communication in the morning\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://agents.nineteen58.co.za/public-api/contacts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"1234567890\",\n \"name\": \"John Doe\",\n \"channel\": \"whatsapp\",\n \"email\": \"john.doe@example.com\",\n \"personal_context\": \"Met at Tech Conference 2024\",\n \"notes\": \"Interested in AI solutions\",\n \"relevant_information\": \"Prefers communication in the morning\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.nineteen58.co.za/public-api/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifier\": \"1234567890\",\n \"name\": \"John Doe\",\n \"channel\": \"whatsapp\",\n \"email\": \"john.doe@example.com\",\n \"personal_context\": \"Met at Tech Conference 2024\",\n \"notes\": \"Interested in AI solutions\",\n \"relevant_information\": \"Prefers communication in the morning\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Contact created successfully",
"contact_id": "123e4567-e89b-12d3-a456-426614174000"
}{
"error": "<string>"
}Contacts
Create Contact
Creates a new contact with the provided information. Special validation is applied for WhatsApp contacts.
POST
/
public-api
/
contacts
Create a new contact
curl --request POST \
--url https://agents.nineteen58.co.za/public-api/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"identifier": "1234567890",
"name": "John Doe",
"channel": "whatsapp",
"email": "john.doe@example.com",
"personal_context": "Met at Tech Conference 2024",
"notes": "Interested in AI solutions",
"relevant_information": "Prefers communication in the morning"
}
'import requests
url = "https://agents.nineteen58.co.za/public-api/contacts"
payload = {
"identifier": "1234567890",
"name": "John Doe",
"channel": "whatsapp",
"email": "john.doe@example.com",
"personal_context": "Met at Tech Conference 2024",
"notes": "Interested in AI solutions",
"relevant_information": "Prefers communication in the morning"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: '1234567890',
name: 'John Doe',
channel: 'whatsapp',
email: 'john.doe@example.com',
personal_context: 'Met at Tech Conference 2024',
notes: 'Interested in AI solutions',
relevant_information: 'Prefers communication in the morning'
})
};
fetch('https://agents.nineteen58.co.za/public-api/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://agents.nineteen58.co.za/public-api/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([
'identifier' => '1234567890',
'name' => 'John Doe',
'channel' => 'whatsapp',
'email' => 'john.doe@example.com',
'personal_context' => 'Met at Tech Conference 2024',
'notes' => 'Interested in AI solutions',
'relevant_information' => 'Prefers communication in the morning'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://agents.nineteen58.co.za/public-api/contacts"
payload := strings.NewReader("{\n \"identifier\": \"1234567890\",\n \"name\": \"John Doe\",\n \"channel\": \"whatsapp\",\n \"email\": \"john.doe@example.com\",\n \"personal_context\": \"Met at Tech Conference 2024\",\n \"notes\": \"Interested in AI solutions\",\n \"relevant_information\": \"Prefers communication in the morning\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://agents.nineteen58.co.za/public-api/contacts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"1234567890\",\n \"name\": \"John Doe\",\n \"channel\": \"whatsapp\",\n \"email\": \"john.doe@example.com\",\n \"personal_context\": \"Met at Tech Conference 2024\",\n \"notes\": \"Interested in AI solutions\",\n \"relevant_information\": \"Prefers communication in the morning\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.nineteen58.co.za/public-api/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifier\": \"1234567890\",\n \"name\": \"John Doe\",\n \"channel\": \"whatsapp\",\n \"email\": \"john.doe@example.com\",\n \"personal_context\": \"Met at Tech Conference 2024\",\n \"notes\": \"Interested in AI solutions\",\n \"relevant_information\": \"Prefers communication in the morning\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Contact created successfully",
"contact_id": "123e4567-e89b-12d3-a456-426614174000"
}{
"error": "<string>"
}Authorizations
Headers
API key for authentication
Body
application/json
Unique identifier for the contact (phone number for WhatsApp, email for email channel)
Example:
"1234567890"
Contact's full name
Example:
"John Doe"
Communication channel
Available options:
whatsapp, email Example:
"whatsapp"
Contact's email address
Example:
"john.doe@example.com"
Personal context or background information about the contact
Example:
"Met at Tech Conference 2024"
Additional notes or comments about the contact
Example:
"Interested in AI solutions"
Any other relevant information about the contact
Example:
"Prefers communication in the morning"
⌘I

