Skip to main content
PATCH
/
public
/
api
/
v1
/
inboxes
/
{inbox_identifier}
/
contacts
/
{contact_identifier}
Update a contact
curl --request PATCH \
  --url https://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier} \
  --header 'Content-Type: application/json' \
  --data '
{
  "identifier": "1234567890",
  "identifier_hash": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9",
  "email": "alice@acme.inc",
  "name": "Alice",
  "phone_number": "+123456789",
  "avatar": "<string>",
  "custom_attributes": {}
}
'
import requests

url = "https://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}"

payload = {
"identifier": "1234567890",
"identifier_hash": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9",
"email": "alice@acme.inc",
"name": "Alice",
"phone_number": "+123456789",
"avatar": "<string>",
"custom_attributes": {}
}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: '1234567890',
identifier_hash: 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9',
email: 'alice@acme.inc',
name: 'Alice',
phone_number: '+123456789',
avatar: '<string>',
custom_attributes: {}
})
};

fetch('https://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}', 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://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}",
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([
'identifier' => '1234567890',
'identifier_hash' => 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9',
'email' => 'alice@acme.inc',
'name' => 'Alice',
'phone_number' => '+123456789',
'avatar' => '<string>',
'custom_attributes' => [

]
]),
CURLOPT_HTTPHEADER => [
"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://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}"

payload := strings.NewReader("{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"<string>\",\n \"custom_attributes\": {}\n}")

req, _ := http.NewRequest("PATCH", url, payload)

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://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"<string>\",\n \"custom_attributes\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://airys.chat/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifier\": \"1234567890\",\n \"identifier_hash\": \"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9\",\n \"email\": \"alice@acme.inc\",\n \"name\": \"Alice\",\n \"phone_number\": \"+123456789\",\n \"avatar\": \"<string>\",\n \"custom_attributes\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "name": "<string>",
  "email": "<string>",
  "phone_number": "<string>",
  "identifier": "<string>",
  "blocked": true,
  "additional_attributes": {},
  "custom_attributes": {},
  "contact_type": "<string>",
  "country_code": "<string>",
  "last_activity_at": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "last_name": "<string>",
  "middle_name": "<string>",
  "location": "<string>",
  "account_id": 123,
  "company_id": 123,
  "label_list": [
    "<string>"
  ]
}
{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}

Path Parameters

inbox_identifier
string
required

The identifier obtained from API inbox channel

contact_identifier
string
required

The source id of contact obtained on contact create

Body

application/json
identifier
string

External identifier of the contact

Example:

"1234567890"

identifier_hash
string

Identifier hash prepared for HMAC authentication

Example:

"e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9"

email
string

Email of the contact

Example:

"alice@acme.inc"

name
string

Name of the contact

Example:

"Alice"

phone_number
string

Phone number of the contact

Example:

"+123456789"

avatar
file

Send the form data with the avatar image binary or use the avatar_url

custom_attributes
object

Custom attributes of the customer

Example:
{}

Response

Success

Full serialized contact record returned when the public API renders a Contact model directly.

id
integer

Id of the contact

name
string | null

Name of the contact when available

email
string | null

Email of the contact

phone_number
string | null

Phone number of the contact

identifier
string | null

Identifier of the contact

blocked
boolean

Whether the contact is blocked

additional_attributes
object | null

Additional attributes of the contact when present

custom_attributes
object | null

Custom attributes of the contact when present

contact_type
string | null

Contact type of the contact when available

country_code
string | null

Country code of the contact

last_activity_at
string | null

Last activity timestamp of the contact in ISO 8601 format

created_at
string | null

Created timestamp of the contact in ISO 8601 format

updated_at
string | null

Updated timestamp of the contact in ISO 8601 format

last_name
string | null

Last name of the contact

middle_name
string | null

Middle name of the contact

location
string | null

Location of the contact

account_id
integer

Account id of the contact

company_id
integer | null

Company id of the contact

label_list
string[]

Labels applied to the contact