Update Contact
curl --request PUT \
--url https://public.watermelon.ai/api/v1/contacts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"company_id": 123,
"first_name": "Walter",
"last_name": "Melon",
"email_address": "walter.melon@example.co",
"telephone_number": "+316123456789",
"avatar": "https://unsplash.com/photos/hUkZv0Y47Ic",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "offline",
"from_integration": true,
"integration": "Zapier",
"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/{id}"
payload = {
"id": 1,
"company_id": 123,
"first_name": "Walter",
"last_name": "Melon",
"email_address": "walter.melon@example.co",
"telephone_number": "+316123456789",
"avatar": "https://unsplash.com/photos/hUkZv0Y47Ic",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "offline",
"from_integration": True,
"integration": "Zapier",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
company_id: 123,
first_name: 'Walter',
last_name: 'Melon',
email_address: 'walter.melon@example.co',
telephone_number: '+316123456789',
avatar: 'https://unsplash.com/photos/hUkZv0Y47Ic',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
status: 'offline',
from_integration: true,
integration: 'Zapier',
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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'company_id' => 123,
'first_name' => 'Walter',
'last_name' => 'Melon',
'email_address' => 'walter.melon@example.co',
'telephone_number' => '+316123456789',
'avatar' => 'https://unsplash.com/photos/hUkZv0Y47Ic',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'status' => 'offline',
'from_integration' => true,
'integration' => 'Zapier',
'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/{id}"
payload := strings.NewReader("{\n \"id\": 1,\n \"company_id\": 123,\n \"first_name\": \"Walter\",\n \"last_name\": \"Melon\",\n \"email_address\": \"walter.melon@example.co\",\n \"telephone_number\": \"+316123456789\",\n \"avatar\": \"https://unsplash.com/photos/hUkZv0Y47Ic\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"status\": \"offline\",\n \"from_integration\": true,\n \"integration\": \"Zapier\",\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("PUT", 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.put("https://public.watermelon.ai/api/v1/contacts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"company_id\": 123,\n \"first_name\": \"Walter\",\n \"last_name\": \"Melon\",\n \"email_address\": \"walter.melon@example.co\",\n \"telephone_number\": \"+316123456789\",\n \"avatar\": \"https://unsplash.com/photos/hUkZv0Y47Ic\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"status\": \"offline\",\n \"from_integration\": true,\n \"integration\": \"Zapier\",\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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"company_id\": 123,\n \"first_name\": \"Walter\",\n \"last_name\": \"Melon\",\n \"email_address\": \"walter.melon@example.co\",\n \"telephone_number\": \"+316123456789\",\n \"avatar\": \"https://unsplash.com/photos/hUkZv0Y47Ic\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"status\": \"offline\",\n \"from_integration\": true,\n \"integration\": \"Zapier\",\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{
"code": 123,
"message": "<string>",
"fields": "<string>"
}Contacts
Update Contact
PUT
/
contacts
/
{id}
Update Contact
curl --request PUT \
--url https://public.watermelon.ai/api/v1/contacts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"company_id": 123,
"first_name": "Walter",
"last_name": "Melon",
"email_address": "walter.melon@example.co",
"telephone_number": "+316123456789",
"avatar": "https://unsplash.com/photos/hUkZv0Y47Ic",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "offline",
"from_integration": true,
"integration": "Zapier",
"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/{id}"
payload = {
"id": 1,
"company_id": 123,
"first_name": "Walter",
"last_name": "Melon",
"email_address": "walter.melon@example.co",
"telephone_number": "+316123456789",
"avatar": "https://unsplash.com/photos/hUkZv0Y47Ic",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "offline",
"from_integration": True,
"integration": "Zapier",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
company_id: 123,
first_name: 'Walter',
last_name: 'Melon',
email_address: 'walter.melon@example.co',
telephone_number: '+316123456789',
avatar: 'https://unsplash.com/photos/hUkZv0Y47Ic',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
status: 'offline',
from_integration: true,
integration: 'Zapier',
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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'company_id' => 123,
'first_name' => 'Walter',
'last_name' => 'Melon',
'email_address' => 'walter.melon@example.co',
'telephone_number' => '+316123456789',
'avatar' => 'https://unsplash.com/photos/hUkZv0Y47Ic',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'status' => 'offline',
'from_integration' => true,
'integration' => 'Zapier',
'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/{id}"
payload := strings.NewReader("{\n \"id\": 1,\n \"company_id\": 123,\n \"first_name\": \"Walter\",\n \"last_name\": \"Melon\",\n \"email_address\": \"walter.melon@example.co\",\n \"telephone_number\": \"+316123456789\",\n \"avatar\": \"https://unsplash.com/photos/hUkZv0Y47Ic\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"status\": \"offline\",\n \"from_integration\": true,\n \"integration\": \"Zapier\",\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("PUT", 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.put("https://public.watermelon.ai/api/v1/contacts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"company_id\": 123,\n \"first_name\": \"Walter\",\n \"last_name\": \"Melon\",\n \"email_address\": \"walter.melon@example.co\",\n \"telephone_number\": \"+316123456789\",\n \"avatar\": \"https://unsplash.com/photos/hUkZv0Y47Ic\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"status\": \"offline\",\n \"from_integration\": true,\n \"integration\": \"Zapier\",\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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"company_id\": 123,\n \"first_name\": \"Walter\",\n \"last_name\": \"Melon\",\n \"email_address\": \"walter.melon@example.co\",\n \"telephone_number\": \"+316123456789\",\n \"avatar\": \"https://unsplash.com/photos/hUkZv0Y47Ic\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"status\": \"offline\",\n \"from_integration\": true,\n \"integration\": \"Zapier\",\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{
"code": 123,
"message": "<string>",
"fields": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Example:
1
Example:
"Walter"
Example:
"Melon"
Example:
"walter.melon@example.co"
Example:
"+316123456789"
Example:
"https://unsplash.com/photos/hUkZv0Y47Ic"
Available options:
online, offline, minimized, disconnected Example:
"offline"
Example:
"Zapier"
Show child attributes
Show child attributes
Response
Contact updated
Was this page helpful?
⌘I

