curl --request POST \
--url https://api.protodesk.io/v1/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Inquiry for 2BR Villa in Canggu",
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "inquiry_123",
"status": "open",
"priority": "normal",
"channel": "whatsapp",
"team": "canggu-rentals",
"tags": [
"villa",
"lead"
],
"metadata": {
"source": "owner_app"
},
"channelIdentityId": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"routing": {
"teamKey": "canggu-rentals",
"assigneeId": "<string>",
"assigneeType": "user",
"assigneeExternalId": "<string>",
"priority": "<string>",
"tags": [
"<string>"
],
"strategy": "<string>"
}
}
'import requests
url = "https://api.protodesk.io/v1/conversations"
payload = {
"subject": "Inquiry for 2BR Villa in Canggu",
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "inquiry_123",
"status": "open",
"priority": "normal",
"channel": "whatsapp",
"team": "canggu-rentals",
"tags": ["villa", "lead"],
"metadata": { "source": "owner_app" },
"channelIdentityId": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"routing": {
"teamKey": "canggu-rentals",
"assigneeId": "<string>",
"assigneeType": "user",
"assigneeExternalId": "<string>",
"priority": "<string>",
"tags": ["<string>"],
"strategy": "<string>"
}
}
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({
subject: 'Inquiry for 2BR Villa in Canggu',
customerId: 'cus_x6q5vl75f5d53m7oet2k4r5w6a',
externalId: 'inquiry_123',
status: 'open',
priority: 'normal',
channel: 'whatsapp',
team: 'canggu-rentals',
tags: ['villa', 'lead'],
metadata: {source: 'owner_app'},
channelIdentityId: 'cid_x6q5vl75f5d53m7oet2k4r5w6a',
routing: {
teamKey: 'canggu-rentals',
assigneeId: '<string>',
assigneeType: 'user',
assigneeExternalId: '<string>',
priority: '<string>',
tags: ['<string>'],
strategy: '<string>'
}
})
};
fetch('https://api.protodesk.io/v1/conversations', 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/conversations",
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([
'subject' => 'Inquiry for 2BR Villa in Canggu',
'customerId' => 'cus_x6q5vl75f5d53m7oet2k4r5w6a',
'externalId' => 'inquiry_123',
'status' => 'open',
'priority' => 'normal',
'channel' => 'whatsapp',
'team' => 'canggu-rentals',
'tags' => [
'villa',
'lead'
],
'metadata' => [
'source' => 'owner_app'
],
'channelIdentityId' => 'cid_x6q5vl75f5d53m7oet2k4r5w6a',
'routing' => [
'teamKey' => 'canggu-rentals',
'assigneeId' => '<string>',
'assigneeType' => 'user',
'assigneeExternalId' => '<string>',
'priority' => '<string>',
'tags' => [
'<string>'
],
'strategy' => '<string>'
]
]),
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/conversations"
payload := strings.NewReader("{\n \"subject\": \"Inquiry for 2BR Villa in Canggu\",\n \"customerId\": \"cus_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"externalId\": \"inquiry_123\",\n \"status\": \"open\",\n \"priority\": \"normal\",\n \"channel\": \"whatsapp\",\n \"team\": \"canggu-rentals\",\n \"tags\": [\n \"villa\",\n \"lead\"\n ],\n \"metadata\": {\n \"source\": \"owner_app\"\n },\n \"channelIdentityId\": \"cid_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"routing\": {\n \"teamKey\": \"canggu-rentals\",\n \"assigneeId\": \"<string>\",\n \"assigneeType\": \"user\",\n \"assigneeExternalId\": \"<string>\",\n \"priority\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"strategy\": \"<string>\"\n }\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/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"Inquiry for 2BR Villa in Canggu\",\n \"customerId\": \"cus_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"externalId\": \"inquiry_123\",\n \"status\": \"open\",\n \"priority\": \"normal\",\n \"channel\": \"whatsapp\",\n \"team\": \"canggu-rentals\",\n \"tags\": [\n \"villa\",\n \"lead\"\n ],\n \"metadata\": {\n \"source\": \"owner_app\"\n },\n \"channelIdentityId\": \"cid_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"routing\": {\n \"teamKey\": \"canggu-rentals\",\n \"assigneeId\": \"<string>\",\n \"assigneeType\": \"user\",\n \"assigneeExternalId\": \"<string>\",\n \"priority\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"strategy\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/conversations")
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 \"subject\": \"Inquiry for 2BR Villa in Canggu\",\n \"customerId\": \"cus_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"externalId\": \"inquiry_123\",\n \"status\": \"open\",\n \"priority\": \"normal\",\n \"channel\": \"whatsapp\",\n \"team\": \"canggu-rentals\",\n \"tags\": [\n \"villa\",\n \"lead\"\n ],\n \"metadata\": {\n \"source\": \"owner_app\"\n },\n \"channelIdentityId\": \"cid_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"routing\": {\n \"teamKey\": \"canggu-rentals\",\n \"assigneeId\": \"<string>\",\n \"assigneeType\": \"user\",\n \"assigneeExternalId\": \"<string>\",\n \"priority\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"strategy\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "conv_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "inquiry_123",
"subject": "Inquiry for 2BR Villa in Canggu",
"status": "open",
"priority": "normal",
"channel": "whatsapp",
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a",
"assignee": {
"id": "owner_456",
"type": "user"
},
"team": "canggu-rentals",
"tags": [
"<string>"
],
"externalObject": {
"type": "villa_listing",
"id": "listing_123",
"title": "2BR Villa in Canggu",
"url": "https://example.com/listings/listing_123",
"metadata": {
"ownerId": "owner_456",
"agencyId": "agency_789"
}
},
"metadata": {},
"channelIdentityId": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"routingNotes": {}
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Create a conversation
curl --request POST \
--url https://api.protodesk.io/v1/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Inquiry for 2BR Villa in Canggu",
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "inquiry_123",
"status": "open",
"priority": "normal",
"channel": "whatsapp",
"team": "canggu-rentals",
"tags": [
"villa",
"lead"
],
"metadata": {
"source": "owner_app"
},
"channelIdentityId": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"routing": {
"teamKey": "canggu-rentals",
"assigneeId": "<string>",
"assigneeType": "user",
"assigneeExternalId": "<string>",
"priority": "<string>",
"tags": [
"<string>"
],
"strategy": "<string>"
}
}
'import requests
url = "https://api.protodesk.io/v1/conversations"
payload = {
"subject": "Inquiry for 2BR Villa in Canggu",
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "inquiry_123",
"status": "open",
"priority": "normal",
"channel": "whatsapp",
"team": "canggu-rentals",
"tags": ["villa", "lead"],
"metadata": { "source": "owner_app" },
"channelIdentityId": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"routing": {
"teamKey": "canggu-rentals",
"assigneeId": "<string>",
"assigneeType": "user",
"assigneeExternalId": "<string>",
"priority": "<string>",
"tags": ["<string>"],
"strategy": "<string>"
}
}
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({
subject: 'Inquiry for 2BR Villa in Canggu',
customerId: 'cus_x6q5vl75f5d53m7oet2k4r5w6a',
externalId: 'inquiry_123',
status: 'open',
priority: 'normal',
channel: 'whatsapp',
team: 'canggu-rentals',
tags: ['villa', 'lead'],
metadata: {source: 'owner_app'},
channelIdentityId: 'cid_x6q5vl75f5d53m7oet2k4r5w6a',
routing: {
teamKey: 'canggu-rentals',
assigneeId: '<string>',
assigneeType: 'user',
assigneeExternalId: '<string>',
priority: '<string>',
tags: ['<string>'],
strategy: '<string>'
}
})
};
fetch('https://api.protodesk.io/v1/conversations', 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/conversations",
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([
'subject' => 'Inquiry for 2BR Villa in Canggu',
'customerId' => 'cus_x6q5vl75f5d53m7oet2k4r5w6a',
'externalId' => 'inquiry_123',
'status' => 'open',
'priority' => 'normal',
'channel' => 'whatsapp',
'team' => 'canggu-rentals',
'tags' => [
'villa',
'lead'
],
'metadata' => [
'source' => 'owner_app'
],
'channelIdentityId' => 'cid_x6q5vl75f5d53m7oet2k4r5w6a',
'routing' => [
'teamKey' => 'canggu-rentals',
'assigneeId' => '<string>',
'assigneeType' => 'user',
'assigneeExternalId' => '<string>',
'priority' => '<string>',
'tags' => [
'<string>'
],
'strategy' => '<string>'
]
]),
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/conversations"
payload := strings.NewReader("{\n \"subject\": \"Inquiry for 2BR Villa in Canggu\",\n \"customerId\": \"cus_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"externalId\": \"inquiry_123\",\n \"status\": \"open\",\n \"priority\": \"normal\",\n \"channel\": \"whatsapp\",\n \"team\": \"canggu-rentals\",\n \"tags\": [\n \"villa\",\n \"lead\"\n ],\n \"metadata\": {\n \"source\": \"owner_app\"\n },\n \"channelIdentityId\": \"cid_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"routing\": {\n \"teamKey\": \"canggu-rentals\",\n \"assigneeId\": \"<string>\",\n \"assigneeType\": \"user\",\n \"assigneeExternalId\": \"<string>\",\n \"priority\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"strategy\": \"<string>\"\n }\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/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"Inquiry for 2BR Villa in Canggu\",\n \"customerId\": \"cus_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"externalId\": \"inquiry_123\",\n \"status\": \"open\",\n \"priority\": \"normal\",\n \"channel\": \"whatsapp\",\n \"team\": \"canggu-rentals\",\n \"tags\": [\n \"villa\",\n \"lead\"\n ],\n \"metadata\": {\n \"source\": \"owner_app\"\n },\n \"channelIdentityId\": \"cid_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"routing\": {\n \"teamKey\": \"canggu-rentals\",\n \"assigneeId\": \"<string>\",\n \"assigneeType\": \"user\",\n \"assigneeExternalId\": \"<string>\",\n \"priority\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"strategy\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/conversations")
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 \"subject\": \"Inquiry for 2BR Villa in Canggu\",\n \"customerId\": \"cus_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"externalId\": \"inquiry_123\",\n \"status\": \"open\",\n \"priority\": \"normal\",\n \"channel\": \"whatsapp\",\n \"team\": \"canggu-rentals\",\n \"tags\": [\n \"villa\",\n \"lead\"\n ],\n \"metadata\": {\n \"source\": \"owner_app\"\n },\n \"channelIdentityId\": \"cid_x6q5vl75f5d53m7oet2k4r5w6a\",\n \"routing\": {\n \"teamKey\": \"canggu-rentals\",\n \"assigneeId\": \"<string>\",\n \"assigneeType\": \"user\",\n \"assigneeExternalId\": \"<string>\",\n \"priority\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"strategy\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "conv_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "inquiry_123",
"subject": "Inquiry for 2BR Villa in Canggu",
"status": "open",
"priority": "normal",
"channel": "whatsapp",
"customerId": "cus_x6q5vl75f5d53m7oet2k4r5w6a",
"assignee": {
"id": "owner_456",
"type": "user"
},
"team": "canggu-rentals",
"tags": [
"<string>"
],
"externalObject": {
"type": "villa_listing",
"id": "listing_123",
"title": "2BR Villa in Canggu",
"url": "https://example.com/listings/listing_123",
"metadata": {
"ownerId": "owner_456",
"agencyId": "agency_789"
}
},
"metadata": {},
"channelIdentityId": "cid_x6q5vl75f5d53m7oet2k4r5w6a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"routingNotes": {}
}{
"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.
Headers
Optional retry key for safely replaying create requests. Reusing the same key with a different request body returns 409.
8 - 255"8db8e596-7c1a-4fd5-a728-4d6c99f4e66b"
Body
1"Inquiry for 2BR Villa in Canggu"
"cus_x6q5vl75f5d53m7oet2k4r5w6a"
Your stable id for this conversation.
"inquiry_123"
Workspace-defined status key. Every workspace is seeded with open, pending, resolved, and closed; workspaces can define their own. Use GET /v1/statuses to list the keys valid for your workspace. Unknown keys are rejected with conversations.unknown_status.
^[a-z0-9][a-z0-9_-]{0,62}$"open"
Workspace-defined priority key. Every workspace is seeded with low, normal, high, and urgent; workspaces can define their own. Use GET /v1/priorities to list the keys valid for your workspace. Unknown keys are rejected with conversations.unknown_priority.
^[a-z0-9][a-z0-9_-]{0,62}$"normal"
"whatsapp"
Who the conversation is assigned to. Set id to an empty string to clear the assignment.
Show child attributes
Show child attributes
External team or routing hint.
"canggu-rentals"
["villa", "lead"]
Snapshot of your business object attached to the conversation.
Show child attributes
Show child attributes
{ "source": "owner_app" }
The channel identity that opened this conversation (provenance).
"cid_x6q5vl75f5d53m7oet2k4r5w6a"
Routing hints resolved at create time. Unresolved hints never fail the create — they leave the conversation unassigned and are recorded in the response's routingNotes for debugging.
Show child attributes
Show child attributes
Response
Created conversation.
Every key is always present; optional fields are null when unset.
"conv_x6q5vl75f5d53m7oet2k4r5w6a"
"inquiry_123"
"Inquiry for 2BR Villa in Canggu"
Workspace-defined status key. Every workspace is seeded with open, pending, resolved, and closed; workspaces can define their own. Use GET /v1/statuses to list the keys valid for your workspace. Unknown keys are rejected with conversations.unknown_status.
^[a-z0-9][a-z0-9_-]{0,62}$"open"
Workspace-defined priority key. Every workspace is seeded with low, normal, high, and urgent; workspaces can define their own. Use GET /v1/priorities to list the keys valid for your workspace. Unknown keys are rejected with conversations.unknown_priority.
^[a-z0-9][a-z0-9_-]{0,62}$"normal"
"whatsapp"
"cus_x6q5vl75f5d53m7oet2k4r5w6a"
Null when the conversation is unassigned.
Show child attributes
Show child attributes
"canggu-rentals"
Null when no external object is attached.
Show child attributes
Show child attributes
The channel identity that opened this conversation, if any.
"cid_x6q5vl75f5d53m7oet2k4r5w6a"
Routing hints and resolution reasons recorded at create time (debugging).
