Create Contact
curl --request POST \
--url https://public.watermelon.ai/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email_address": "<string>",
"telephone_number": "<string>",
"from_integration": true,
"integration": "<string>",
"from_whatsapp": true,
"from_email": true,
"fields": [
{
"id": 1,
"company_id": 123,
"icon": "information",
"name": "Order number",
"type": "text",
"order": 123,
"value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"is_unique": true
}
]
}
'import requests
url = "https://public.watermelon.ai/api/v1/contacts"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email_address": "<string>",
"telephone_number": "<string>",
"from_integration": True,
"integration": "<string>",
"from_whatsapp": True,
"from_email": True,
"fields": [
{
"id": 1,
"company_id": 123,
"icon": "information",
"name": "Order number",
"type": "text",
"order": 123,
"value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"is_unique": True
}
]
}
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({
first_name: '<string>',
last_name: '<string>',
email_address: '<string>',
telephone_number: '<string>',
from_integration: true,
integration: '<string>',
from_whatsapp: true,
from_email: true,
fields: [
{
id: 1,
company_id: 123,
icon: 'information',
name: 'Order number',
type: 'text',
order: 123,
value: '<string>',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
deleted_at: '2023-11-07T05:31:56Z',
is_unique: true
}
]
})
};
fetch('https://public.watermelon.ai/api/v1/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://public.watermelon.ai/api/v1/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([
'first_name' => '<string>',
'last_name' => '<string>',
'email_address' => '<string>',
'telephone_number' => '<string>',
'from_integration' => true,
'integration' => '<string>',
'from_whatsapp' => true,
'from_email' => true,
'fields' => [
[
'id' => 1,
'company_id' => 123,
'icon' => 'information',
'name' => 'Order number',
'type' => 'text',
'order' => 123,
'value' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'deleted_at' => '2023-11-07T05:31:56Z',
'is_unique' => true
]
]
]),
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://public.watermelon.ai/api/v1/contacts"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"<string>\",\n \"telephone_number\": \"<string>\",\n \"from_integration\": true,\n \"integration\": \"<string>\",\n \"from_whatsapp\": true,\n \"from_email\": true,\n \"fields\": [\n {\n \"id\": 1,\n \"company_id\": 123,\n \"icon\": \"information\",\n \"name\": \"Order number\",\n \"type\": \"text\",\n \"order\": 123,\n \"value\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"deleted_at\": \"2023-11-07T05:31:56Z\",\n \"is_unique\": true\n }\n ]\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://public.watermelon.ai/api/v1/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"<string>\",\n \"telephone_number\": \"<string>\",\n \"from_integration\": true,\n \"integration\": \"<string>\",\n \"from_whatsapp\": true,\n \"from_email\": true,\n \"fields\": [\n {\n \"id\": 1,\n \"company_id\": 123,\n \"icon\": \"information\",\n \"name\": \"Order number\",\n \"type\": \"text\",\n \"order\": 123,\n \"value\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"deleted_at\": \"2023-11-07T05:31:56Z\",\n \"is_unique\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.watermelon.ai/api/v1/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 \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"<string>\",\n \"telephone_number\": \"<string>\",\n \"from_integration\": true,\n \"integration\": \"<string>\",\n \"from_whatsapp\": true,\n \"from_email\": true,\n \"fields\": [\n {\n \"id\": 1,\n \"company_id\": 123,\n \"icon\": \"information\",\n \"name\": \"Order number\",\n \"type\": \"text\",\n \"order\": 123,\n \"value\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"deleted_at\": \"2023-11-07T05:31:56Z\",\n \"is_unique\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"code": 123,
"message": "<string>",
"fields": "<string>"
}Contacts
Create Contact
POST
/
contacts
Create Contact
curl --request POST \
--url https://public.watermelon.ai/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email_address": "<string>",
"telephone_number": "<string>",
"from_integration": true,
"integration": "<string>",
"from_whatsapp": true,
"from_email": true,
"fields": [
{
"id": 1,
"company_id": 123,
"icon": "information",
"name": "Order number",
"type": "text",
"order": 123,
"value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"is_unique": true
}
]
}
'import requests
url = "https://public.watermelon.ai/api/v1/contacts"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email_address": "<string>",
"telephone_number": "<string>",
"from_integration": True,
"integration": "<string>",
"from_whatsapp": True,
"from_email": True,
"fields": [
{
"id": 1,
"company_id": 123,
"icon": "information",
"name": "Order number",
"type": "text",
"order": 123,
"value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"is_unique": True
}
]
}
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({
first_name: '<string>',
last_name: '<string>',
email_address: '<string>',
telephone_number: '<string>',
from_integration: true,
integration: '<string>',
from_whatsapp: true,
from_email: true,
fields: [
{
id: 1,
company_id: 123,
icon: 'information',
name: 'Order number',
type: 'text',
order: 123,
value: '<string>',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
deleted_at: '2023-11-07T05:31:56Z',
is_unique: true
}
]
})
};
fetch('https://public.watermelon.ai/api/v1/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://public.watermelon.ai/api/v1/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([
'first_name' => '<string>',
'last_name' => '<string>',
'email_address' => '<string>',
'telephone_number' => '<string>',
'from_integration' => true,
'integration' => '<string>',
'from_whatsapp' => true,
'from_email' => true,
'fields' => [
[
'id' => 1,
'company_id' => 123,
'icon' => 'information',
'name' => 'Order number',
'type' => 'text',
'order' => 123,
'value' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'deleted_at' => '2023-11-07T05:31:56Z',
'is_unique' => true
]
]
]),
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://public.watermelon.ai/api/v1/contacts"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"<string>\",\n \"telephone_number\": \"<string>\",\n \"from_integration\": true,\n \"integration\": \"<string>\",\n \"from_whatsapp\": true,\n \"from_email\": true,\n \"fields\": [\n {\n \"id\": 1,\n \"company_id\": 123,\n \"icon\": \"information\",\n \"name\": \"Order number\",\n \"type\": \"text\",\n \"order\": 123,\n \"value\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"deleted_at\": \"2023-11-07T05:31:56Z\",\n \"is_unique\": true\n }\n ]\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://public.watermelon.ai/api/v1/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"<string>\",\n \"telephone_number\": \"<string>\",\n \"from_integration\": true,\n \"integration\": \"<string>\",\n \"from_whatsapp\": true,\n \"from_email\": true,\n \"fields\": [\n {\n \"id\": 1,\n \"company_id\": 123,\n \"icon\": \"information\",\n \"name\": \"Order number\",\n \"type\": \"text\",\n \"order\": 123,\n \"value\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"deleted_at\": \"2023-11-07T05:31:56Z\",\n \"is_unique\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.watermelon.ai/api/v1/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 \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email_address\": \"<string>\",\n \"telephone_number\": \"<string>\",\n \"from_integration\": true,\n \"integration\": \"<string>\",\n \"from_whatsapp\": true,\n \"from_email\": true,\n \"fields\": [\n {\n \"id\": 1,\n \"company_id\": 123,\n \"icon\": \"information\",\n \"name\": \"Order number\",\n \"type\": \"text\",\n \"order\": 123,\n \"value\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"deleted_at\": \"2023-11-07T05:31:56Z\",\n \"is_unique\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"code": 123,
"message": "<string>",
"fields": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Created contact ID
Was this page helpful?
⌘I

