Skip to main content
PATCH
/
orgs
/
{org_id}
/
contacts
/
{contact_id}
/
channels
/
{channel_id}
Update a contact channel (only for custom channels)
curl --request PATCH \
  --url https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "avatar": "<string>",
  "name": "<string>",
  "phone": "<string>",
  "username": "<string>",
  "email": "jsmith@example.com"
}
'
import requests

url = "https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_id}"

payload = {
"avatar": "<string>",
"name": "<string>",
"phone": "<string>",
"username": "<string>",
"email": "jsmith@example.com"
}
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({
avatar: '<string>',
name: '<string>',
phone: '<string>',
username: '<string>',
email: 'jsmith@example.com'
})
};

fetch('https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_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://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_id}",
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([
'avatar' => '<string>',
'name' => '<string>',
'phone' => '<string>',
'username' => '<string>',
'email' => 'jsmith@example.com'
]),
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.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_id}"

payload := strings.NewReader("{\n \"avatar\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\"\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.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"avatar\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/channels/{channel_id}")

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 \"avatar\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "user_id": "<string>",
  "avatar": "<string>",
  "name": "<string>",
  "username": "<string>",
  "email": "<string>",
  "phone": "<string>",
  "country": "<string>",
  "agent": "<string>",
  "ip": "<string>",
  "language": "<string>",
  "platform_data": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "link": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key

Path Parameters

org_id
string
required

Org ID

contact_id
string
required

Contact ID

channel_id
string
required

Channel ID

Body

Schema for updating a contact channel

avatar
string<uri> | null

The avatar for the contact channel, e.g X Avatar URL

Maximum string length: 2048
name
string | null

The name for the contact channel, e.g Full Name

Maximum string length: 256
phone
string | null

The phone number for the contact channel, e.g Phone Number

Maximum string length: 256
username
string | null

The username for the contact channel, e.g Username

Maximum string length: 256
email
string<email> | null

The email for the contact channel, e.g Email

Maximum string length: 256

Response

200 - application/json

Schema for the contact channel

id
string
required
type
enum<string>
required

ID of the connection integration

Available options:
internal,
org,
custom,
whatsapp_bot,
messenger_bot,
instagram_dm,
tiktok_dm,
telegram_bot,
gmail,
slack_bot,
twilio,
telnyx,
email
user_id
string
required

The unique identifier for the contact channel, e.g Phone Number or User ID

avatar
string | null
required

The avatar for the contact channel, e.g X Avatar URL

name
string | null
required

The name for the contact channel, e.g Full Name

username
string | null
required

The username for the contact channel, e.g Username

email
string | null
required

The email for the contact channel, e.g Email

phone
string | null
required

The phone number for the contact channel, e.g Phone Number

country
string | null
required

The country code associated with the contact channel, e.g US for United States

agent
string | null
required

The user agent associated with the contact channel

ip
string | null
required

The IP address associated with the contact channel

language
string | null
required

The language code associated with the contact channel, e.g en for English

platform_data
object
required

Schema for the platform-specific data of a contact channel

created_at
string<date-time>
required
updated_at
string<date-time>
required

A link to the contact channel, e.g a link to the social media profile