List external conversation messages
Use to read what the guest and assistant said, including message types and stored media context. Discover conversationId with list_conversations. Use each stored messageId for get_message_status, get_conversation_attachment or, for an AI assistant answer, get_conversation_answer_trace. Action results are separate: use list_action_executions filtered by conversationId. Requires conversations:read. Returns customer-facing user and assistant messages in newest-first order, including shared locations, contacts, reactions, media, rendered cards/actions, referrals and delivery details when present. Pass nextCursor as cursor for older messages with the same conversationId; stop when hasMore is false. Internal system/tool activity is excluded. Use conversation.needsReply from metadata as the operator-action signal. Unknown delivery status is not delivery proof.
curl --request GET \
--url https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages', 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://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"conversationId": "<string>",
"messages": [
{
"messageId": "<string>",
"direction": "inbound",
"role": "user",
"text": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"status": "received",
"author": {
"type": "user",
"operatorId": "<string>",
"operatorName": "<string>",
"displayName": "<string>"
},
"media": [
{
"attachmentIndex": 1,
"type": "<string>",
"externalMediaId": "<string>",
"label": "<string>",
"contentType": "<string>",
"storageUrl": "<string>",
"transcriptText": "<string>",
"transcriptionStatus": "<string>",
"transcriptionError": "<string>",
"hasCaption": true,
"processingStatus": "unknown",
"processingReason": "<string>",
"processingAt": "2023-11-07T05:31:56Z",
"processingTerminal": true,
"mediaContextText": "<string>",
"mediaContextStatus": "<string>",
"mediaContextTruncated": true
}
],
"eventId": "<string>",
"externalMessageId": "<string>",
"statusReason": "<string>",
"senderId": "<string>",
"recipientId": "<string>",
"replyTo": {},
"deliveries": [
{}
],
"textOrigin": "provider",
"providerErrorCode": 123,
"reaction": "<string>",
"reactionAt": "2023-11-07T05:31:56Z",
"location": {
"latitude": 123,
"longitude": 123,
"name": "<string>",
"address": "<string>"
},
"contacts": [
{
"displayName": "<string>",
"phones": [
{
"number": "<string>",
"label": "<string>"
}
],
"emails": [
{
"address": "<string>",
"label": "<string>"
}
]
}
],
"contactCount": 123,
"contactsTruncated": true,
"originalText": "<string>",
"adapterOutput": {
"text": "<string>",
"cards": [
{
"text": "<string>",
"media": {
"mediaId": "<string>",
"type": "<string>",
"url": "<string>",
"contentType": "<string>",
"filename": "<string>",
"sizeBytes": 123,
"caption": "<string>",
"voice": true,
"requireNative": true
},
"actions": [
{
"id": "<string>",
"label": "<string>",
"kind": "reply",
"text": "<string>",
"url": "<string>",
"payload": {}
}
]
}
]
},
"displayCards": [
{
"text": "<string>",
"media": {
"mediaId": "<string>",
"type": "<string>",
"url": "<string>",
"contentType": "<string>",
"filename": "<string>",
"sizeBytes": 123,
"caption": "<string>",
"voice": true,
"requireNative": true
},
"actions": [
{
"id": "<string>",
"label": "<string>",
"kind": "reply",
"text": "<string>",
"url": "<string>",
"payload": {}
}
]
}
],
"displayActions": [
{
"id": "<string>",
"label": "<string>",
"kind": "reply",
"text": "<string>",
"url": "<string>",
"payload": {}
}
],
"referral": {
"type": "meta_ad",
"label": "<string>",
"sourceType": "<string>",
"sourceId": "<string>",
"sourceUrl": "<string>",
"ref": "<string>",
"adId": "<string>",
"source": "<string>",
"referralType": "<string>",
"headline": "<string>",
"body": "<string>",
"mediaType": "<string>",
"imageUrl": "<string>",
"videoUrl": "<string>",
"thumbnailUrl": "<string>",
"cachedThumbnailUrl": "<string>",
"cachedImageUrl": "<string>",
"mediaSummary": "<string>",
"mediaCacheStatus": "<string>",
"mediaCachedAt": "<string>",
"mediaCacheError": "<string>",
"welcomeText": "<string>",
"ctwaClid": "<string>",
"seenAt": "<string>"
},
"crmFollowUp": {
"followUpId": "<string>",
"mode": "draft"
},
"inputType": "<string>",
"awaitingMedia": true,
"mediaExpected": 123,
"mediaReadyCount": 123,
"mediaTimedOut": true,
"interactive": {
"type": "<string>",
"name": "<string>",
"title": "<string>",
"id": "<string>",
"payload": "<unknown>",
"payloadTruncated": true
},
"interaction": {
"actionId": "<string>",
"label": "<string>",
"sourceTurnEventId": "<string>",
"cardIndex": 123,
"resolved": true,
"errorReason": "<string>"
}
}
],
"nextCursor": "<string>",
"hasMore": true
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}Authorizations
Server-side tenant-scoped credential created from Build > API Keys.
Path Parameters
Stored conversationId from list_conversations; keep the connected business and conversation unchanged for continuation reads.
Query Parameters
1 <= x <= 200Opaque, conversation-bound cursor from the previous response. Retrieves older messages.
2048curl --request GET \
--url https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages', 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://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/conversations/{conversationId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"conversationId": "<string>",
"messages": [
{
"messageId": "<string>",
"direction": "inbound",
"role": "user",
"text": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"status": "received",
"author": {
"type": "user",
"operatorId": "<string>",
"operatorName": "<string>",
"displayName": "<string>"
},
"media": [
{
"attachmentIndex": 1,
"type": "<string>",
"externalMediaId": "<string>",
"label": "<string>",
"contentType": "<string>",
"storageUrl": "<string>",
"transcriptText": "<string>",
"transcriptionStatus": "<string>",
"transcriptionError": "<string>",
"hasCaption": true,
"processingStatus": "unknown",
"processingReason": "<string>",
"processingAt": "2023-11-07T05:31:56Z",
"processingTerminal": true,
"mediaContextText": "<string>",
"mediaContextStatus": "<string>",
"mediaContextTruncated": true
}
],
"eventId": "<string>",
"externalMessageId": "<string>",
"statusReason": "<string>",
"senderId": "<string>",
"recipientId": "<string>",
"replyTo": {},
"deliveries": [
{}
],
"textOrigin": "provider",
"providerErrorCode": 123,
"reaction": "<string>",
"reactionAt": "2023-11-07T05:31:56Z",
"location": {
"latitude": 123,
"longitude": 123,
"name": "<string>",
"address": "<string>"
},
"contacts": [
{
"displayName": "<string>",
"phones": [
{
"number": "<string>",
"label": "<string>"
}
],
"emails": [
{
"address": "<string>",
"label": "<string>"
}
]
}
],
"contactCount": 123,
"contactsTruncated": true,
"originalText": "<string>",
"adapterOutput": {
"text": "<string>",
"cards": [
{
"text": "<string>",
"media": {
"mediaId": "<string>",
"type": "<string>",
"url": "<string>",
"contentType": "<string>",
"filename": "<string>",
"sizeBytes": 123,
"caption": "<string>",
"voice": true,
"requireNative": true
},
"actions": [
{
"id": "<string>",
"label": "<string>",
"kind": "reply",
"text": "<string>",
"url": "<string>",
"payload": {}
}
]
}
]
},
"displayCards": [
{
"text": "<string>",
"media": {
"mediaId": "<string>",
"type": "<string>",
"url": "<string>",
"contentType": "<string>",
"filename": "<string>",
"sizeBytes": 123,
"caption": "<string>",
"voice": true,
"requireNative": true
},
"actions": [
{
"id": "<string>",
"label": "<string>",
"kind": "reply",
"text": "<string>",
"url": "<string>",
"payload": {}
}
]
}
],
"displayActions": [
{
"id": "<string>",
"label": "<string>",
"kind": "reply",
"text": "<string>",
"url": "<string>",
"payload": {}
}
],
"referral": {
"type": "meta_ad",
"label": "<string>",
"sourceType": "<string>",
"sourceId": "<string>",
"sourceUrl": "<string>",
"ref": "<string>",
"adId": "<string>",
"source": "<string>",
"referralType": "<string>",
"headline": "<string>",
"body": "<string>",
"mediaType": "<string>",
"imageUrl": "<string>",
"videoUrl": "<string>",
"thumbnailUrl": "<string>",
"cachedThumbnailUrl": "<string>",
"cachedImageUrl": "<string>",
"mediaSummary": "<string>",
"mediaCacheStatus": "<string>",
"mediaCachedAt": "<string>",
"mediaCacheError": "<string>",
"welcomeText": "<string>",
"ctwaClid": "<string>",
"seenAt": "<string>"
},
"crmFollowUp": {
"followUpId": "<string>",
"mode": "draft"
},
"inputType": "<string>",
"awaitingMedia": true,
"mediaExpected": 123,
"mediaReadyCount": 123,
"mediaTimedOut": true,
"interactive": {
"type": "<string>",
"name": "<string>",
"title": "<string>",
"id": "<string>",
"payload": "<unknown>",
"payloadTruncated": true
},
"interaction": {
"actionId": "<string>",
"label": "<string>",
"sourceTurnEventId": "<string>",
"cardIndex": 123,
"resolved": true,
"errorReason": "<string>"
}
}
],
"nextCursor": "<string>",
"hasMore": true
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}{
"error": {
"code": "M2M_AUTH_INSUFFICIENT_SCOPE",
"message": "M2M credential does not have required scope.",
"details": {
"requiredScopes": [
"conversations:write"
],
"missingScopes": [
"conversations:write"
]
}
}
}