Update a contact
curl --request PATCH \
--url https://api.zavu.dev/v2/contacts/{contactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayName": "John Doe",
"metadata": {}
}
'import requests
url = "https://api.zavu.dev/v2/contacts/{contactId}"
payload = {
"displayName": "John Doe",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({displayName: 'John Doe', metadata: {}})
};
fetch('https://api.zavu.dev/v2/contacts/{contactId}', 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://api.zavu.dev/v2/contacts/{contactId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'displayName' => 'John Doe',
'metadata' => [
]
]),
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://api.zavu.dev/v2/contacts/{contactId}"
payload := strings.NewReader("{\n \"displayName\": \"John Doe\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.zavu.dev/v2/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"displayName\": \"John Doe\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v2/contacts/{contactId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"displayName\": \"John Doe\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"availableChannels": [
"<string>"
],
"verified": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "John Doe",
"phoneNumber": "+56912345678",
"primaryPhone": "+56912345678",
"primaryEmail": "john@example.com",
"countryCode": "CL",
"profileName": "John Doe",
"defaultChannel": "sms",
"channels": [
{
"id": "<string>",
"channel": "sms",
"identifier": "+14155551234",
"isPrimary": true,
"verified": true,
"createdAt": "2023-11-07T05:31:56Z",
"countryCode": "US",
"label": "work",
"metrics": {
"successCount": 123,
"failureCount": 123,
"totalAttempts": 123,
"avgDeliveryTimeMs": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z"
},
"lastInboundAt": "2023-11-07T05:31:56Z",
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "invalid_request",
"message": "<string>",
"details": {
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}
}{
"code": "invalid_request",
"message": "<string>",
"details": {
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}
}{
"code": "invalid_request",
"message": "<string>",
"details": {
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Human-readable name for this contact. Set to null to clear it and fall back to the contact's identifier. Contacts created automatically from an inbound message have no display name until you set one.
200"John Doe"
Preferred channel for this contact. Set to null to clear.
sms, whatsapp, telegram, email, instagram, messenger, voice Show child attributes
Show child attributes
Response
Updated.
List of available messaging channels for this contact.
Whether this contact has been verified.
Show child attributes
Show child attributes
Display name for the contact.
"John Doe"
DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format.
"+56912345678"
Primary phone number in E.164 format.
"+56912345678"
Primary email address.
"john@example.com"
"CL"
Contact's WhatsApp profile name. Only available for WhatsApp contacts.
"John Doe"
Preferred channel for this contact.
sms, whatsapp, telegram, email, instagram, messenger, voice All communication channels for this contact.
Show child attributes
Show child attributes
curl --request PATCH \
--url https://api.zavu.dev/v2/contacts/{contactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayName": "John Doe",
"metadata": {}
}
'import requests
url = "https://api.zavu.dev/v2/contacts/{contactId}"
payload = {
"displayName": "John Doe",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({displayName: 'John Doe', metadata: {}})
};
fetch('https://api.zavu.dev/v2/contacts/{contactId}', 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://api.zavu.dev/v2/contacts/{contactId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'displayName' => 'John Doe',
'metadata' => [
]
]),
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://api.zavu.dev/v2/contacts/{contactId}"
payload := strings.NewReader("{\n \"displayName\": \"John Doe\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.zavu.dev/v2/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"displayName\": \"John Doe\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v2/contacts/{contactId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"displayName\": \"John Doe\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"availableChannels": [
"<string>"
],
"verified": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "John Doe",
"phoneNumber": "+56912345678",
"primaryPhone": "+56912345678",
"primaryEmail": "john@example.com",
"countryCode": "CL",
"profileName": "John Doe",
"defaultChannel": "sms",
"channels": [
{
"id": "<string>",
"channel": "sms",
"identifier": "+14155551234",
"isPrimary": true,
"verified": true,
"createdAt": "2023-11-07T05:31:56Z",
"countryCode": "US",
"label": "work",
"metrics": {
"successCount": 123,
"failureCount": 123,
"totalAttempts": 123,
"avgDeliveryTimeMs": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z"
},
"lastInboundAt": "2023-11-07T05:31:56Z",
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "invalid_request",
"message": "<string>",
"details": {
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}
}{
"code": "invalid_request",
"message": "<string>",
"details": {
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}
}{
"code": "invalid_request",
"message": "<string>",
"details": {
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}
}