curl --request POST \
--url https://api.protodesk.io/v1/customers/{customerId}/identities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "whatsapp",
"identifier": "+628123456789",
"verified": false,
"claimedEmail": "<string>",
"displayName": "<string>",
"avatarUrl": "<string>",
"primary": false
}
'import requests
url = "https://api.protodesk.io/v1/customers/{customerId}/identities"
payload = {
"channel": "whatsapp",
"identifier": "+628123456789",
"verified": False,
"claimedEmail": "<string>",
"displayName": "<string>",
"avatarUrl": "<string>",
"primary": False
}
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({
channel: 'whatsapp',
identifier: '+628123456789',
verified: false,
claimedEmail: '<string>',
displayName: '<string>',
avatarUrl: '<string>',
primary: false
})
};
fetch('https://api.protodesk.io/v1/customers/{customerId}/identities', 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.protodesk.io/v1/customers/{customerId}/identities",
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([
'channel' => 'whatsapp',
'identifier' => '+628123456789',
'verified' => false,
'claimedEmail' => '<string>',
'displayName' => '<string>',
'avatarUrl' => '<string>',
'primary' => false
]),
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.protodesk.io/v1/customers/{customerId}/identities"
payload := strings.NewReader("{\n \"channel\": \"whatsapp\",\n \"identifier\": \"+628123456789\",\n \"verified\": false,\n \"claimedEmail\": \"<string>\",\n \"displayName\": \"<string>\",\n \"avatarUrl\": \"<string>\",\n \"primary\": false\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://api.protodesk.io/v1/customers/{customerId}/identities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"whatsapp\",\n \"identifier\": \"+628123456789\",\n \"verified\": false,\n \"claimedEmail\": \"<string>\",\n \"displayName\": \"<string>\",\n \"avatarUrl\": \"<string>\",\n \"primary\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/customers/{customerId}/identities")
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 \"channel\": \"whatsapp\",\n \"identifier\": \"+628123456789\",\n \"verified\": false,\n \"claimedEmail\": \"<string>\",\n \"displayName\": \"<string>\",\n \"avatarUrl\": \"<string>\",\n \"primary\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"customerId": "<string>",
"channel": "whatsapp",
"identifier": "+628123456789",
"verified": true,
"primary": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"verifiedAt": "2023-11-07T05:31:56Z",
"claimedEmail": "<string>",
"displayName": "<string>",
"avatarUrl": "<string>",
"lastActiveAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
},
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Link a channel identity to a customer
API-created identities default verified=false. Passing verified=true asserts your system authenticated the identity (recorded with verifiedAt) and allows it to auto-merge. A (channel, identifier) already claimed by another customer returns 409 with the owning customerId.
curl --request POST \
--url https://api.protodesk.io/v1/customers/{customerId}/identities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "whatsapp",
"identifier": "+628123456789",
"verified": false,
"claimedEmail": "<string>",
"displayName": "<string>",
"avatarUrl": "<string>",
"primary": false
}
'import requests
url = "https://api.protodesk.io/v1/customers/{customerId}/identities"
payload = {
"channel": "whatsapp",
"identifier": "+628123456789",
"verified": False,
"claimedEmail": "<string>",
"displayName": "<string>",
"avatarUrl": "<string>",
"primary": False
}
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({
channel: 'whatsapp',
identifier: '+628123456789',
verified: false,
claimedEmail: '<string>',
displayName: '<string>',
avatarUrl: '<string>',
primary: false
})
};
fetch('https://api.protodesk.io/v1/customers/{customerId}/identities', 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.protodesk.io/v1/customers/{customerId}/identities",
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([
'channel' => 'whatsapp',
'identifier' => '+628123456789',
'verified' => false,
'claimedEmail' => '<string>',
'displayName' => '<string>',
'avatarUrl' => '<string>',
'primary' => false
]),
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.protodesk.io/v1/customers/{customerId}/identities"
payload := strings.NewReader("{\n \"channel\": \"whatsapp\",\n \"identifier\": \"+628123456789\",\n \"verified\": false,\n \"claimedEmail\": \"<string>\",\n \"displayName\": \"<string>\",\n \"avatarUrl\": \"<string>\",\n \"primary\": false\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://api.protodesk.io/v1/customers/{customerId}/identities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"whatsapp\",\n \"identifier\": \"+628123456789\",\n \"verified\": false,\n \"claimedEmail\": \"<string>\",\n \"displayName\": \"<string>\",\n \"avatarUrl\": \"<string>\",\n \"primary\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/customers/{customerId}/identities")
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 \"channel\": \"whatsapp\",\n \"identifier\": \"+628123456789\",\n \"verified\": false,\n \"claimedEmail\": \"<string>\",\n \"displayName\": \"<string>\",\n \"avatarUrl\": \"<string>\",\n \"primary\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"customerId": "<string>",
"channel": "whatsapp",
"identifier": "+628123456789",
"verified": true,
"primary": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"verifiedAt": "2023-11-07T05:31:56Z",
"claimedEmail": "<string>",
"displayName": "<string>",
"avatarUrl": "<string>",
"lastActiveAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
},
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Authorizations
Use a workspace API key in the Authorization header. Keys use pk_live_<key_id> for production and pk_test<key_id>_ for test mode.
Path Parameters
Body
Channel the identity belongs to (open string, e.g. whatsapp, slack, email).
"whatsapp"
The identity value on that channel.
"+628123456789"
True asserts your system authenticated this identity, allowing auto-merge. Recorded with verifiedAt.
A claimed (unverified) email; display and merge-suggestion input only.
Response
Created channel identity.
"cid_x6q5vl75f5d53m7oet2k4r5w6a"
"whatsapp"
"+628123456789"
