curl --request POST \
--url https://api.protodesk.io/v1/conversations/{conversationId}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"body": "<string>",
"internal": false,
"sendAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 1,
"metadata": {}
}
]
}
'import requests
url = "https://api.protodesk.io/v1/conversations/{conversationId}/send"
payload = {
"body": "<string>",
"internal": False,
"sendAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 1,
"metadata": {}
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
body: JSON.stringify('<string>'),
internal: false,
sendAt: '2023-11-07T05:31:56Z',
attachments: [
{
id: '<string>',
url: '<string>',
filename: '<string>',
contentType: '<string>',
sizeBytes: 1,
metadata: {}
}
]
})
};
fetch('https://api.protodesk.io/v1/conversations/{conversationId}/send', 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/{conversationId}/send",
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([
'body' => '<string>',
'internal' => false,
'sendAt' => '2023-11-07T05:31:56Z',
'attachments' => [
[
'id' => '<string>',
'url' => '<string>',
'filename' => '<string>',
'contentType' => '<string>',
'sizeBytes' => 1,
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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/{conversationId}/send"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"internal\": false,\n \"sendAt\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 1,\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/{conversationId}/send")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"internal\": false,\n \"sendAt\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 1,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/conversations/{conversationId}/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\",\n \"internal\": false,\n \"sendAt\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 1,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "msg_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "msg_123",
"conversationId": "conv_x6q5vl75f5d53m7oet2k4r5w6a",
"sender": "customer",
"body": "Hi, is this villa available for yearly rental?",
"channel": "whatsapp",
"attachments": [
{
"id": "file_123",
"url": "https://example.com/files/inquiry.png",
"filename": "inquiry.png",
"contentType": "image/png",
"sizeBytes": 12345,
"metadata": {
"kind": "screenshot"
}
}
],
"metadata": {},
"internal": true,
"createdAt": "2023-11-07T05:31:56Z"
},
"queued": true,
"undoMsec": 123,
"scheduledFor": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Send a reply
Sends as an agent on the conversation’s channel. Email and WhatsApp delivery is queued atomically with the message; queued does not mean delivered. Chat replies appear in the visitor stream. Internal notes and test-thread replies stay in Protodesk. Requires messages:send; messages:write alone never authorizes delivery. Reuse the same Idempotency-Key and request body for uncertain retries.
curl --request POST \
--url https://api.protodesk.io/v1/conversations/{conversationId}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"body": "<string>",
"internal": false,
"sendAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 1,
"metadata": {}
}
]
}
'import requests
url = "https://api.protodesk.io/v1/conversations/{conversationId}/send"
payload = {
"body": "<string>",
"internal": False,
"sendAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 1,
"metadata": {}
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
body: JSON.stringify('<string>'),
internal: false,
sendAt: '2023-11-07T05:31:56Z',
attachments: [
{
id: '<string>',
url: '<string>',
filename: '<string>',
contentType: '<string>',
sizeBytes: 1,
metadata: {}
}
]
})
};
fetch('https://api.protodesk.io/v1/conversations/{conversationId}/send', 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/{conversationId}/send",
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([
'body' => '<string>',
'internal' => false,
'sendAt' => '2023-11-07T05:31:56Z',
'attachments' => [
[
'id' => '<string>',
'url' => '<string>',
'filename' => '<string>',
'contentType' => '<string>',
'sizeBytes' => 1,
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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/{conversationId}/send"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"internal\": false,\n \"sendAt\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 1,\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/{conversationId}/send")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"internal\": false,\n \"sendAt\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 1,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/conversations/{conversationId}/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\",\n \"internal\": false,\n \"sendAt\": \"2023-11-07T05:31:56Z\",\n \"attachments\": [\n {\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 1,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "msg_x6q5vl75f5d53m7oet2k4r5w6a",
"externalId": "msg_123",
"conversationId": "conv_x6q5vl75f5d53m7oet2k4r5w6a",
"sender": "customer",
"body": "Hi, is this villa available for yearly rental?",
"channel": "whatsapp",
"attachments": [
{
"id": "file_123",
"url": "https://example.com/files/inquiry.png",
"filename": "inquiry.png",
"contentType": "image/png",
"sizeBytes": 12345,
"metadata": {
"kind": "screenshot"
}
}
],
"metadata": {},
"internal": true,
"createdAt": "2023-11-07T05:31:56Z"
},
"queued": true,
"undoMsec": 123,
"scheduledFor": "2023-11-07T05:31:56Z"
}{
"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
8 - 255Path Parameters
Body
Reply text; required unless attachments are provided.
Store an internal note without customer delivery.
Optional future email delivery time, at most 30 days ahead.
Durable /api/media references owned by this workspace; arbitrary URLs are not accepted for sending.
Show child attributes
Show child attributes
Response
Reply recorded; inspect queued and message.metadata.deliveryStatus for delivery state.
Every key is always present; optional fields are null when unset.
Show child attributes
Show child attributes
True only when provider delivery has been durably queued.
Normal undo window in milliseconds; zero for scheduled or unqueued replies.
