curl --request GET \
--url https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_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.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}",
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://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}"
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://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}")
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{
"message": "Messages fetched successfully!",
"messages": {
"data": [
{
"conversation_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"message_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"contact_id": "f6a7b8c9-d0e1-2345-f123-456789012345",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"conversation_profile_email": "[email protected]",
"conversation_profile_number": "+1987654321",
"type_of_message": "sms_message",
"direction": "inbound",
"message": "Hi, I'd like to schedule an appointment.",
"media": [
"https://cdn.example.com/media/image1.jpg"
],
"call_status": null,
"call_duration": null,
"assigned_account_id": "d4e5f6a7-b8c9-0123-def1-234567890123",
"created_at": "2026-03-15T08:00:00.000Z"
},
{
"conversation_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"message_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"contact_id": "f6a7b8c9-d0e1-2345-f123-456789012345",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"conversation_profile_email": "[email protected]",
"conversation_profile_number": "+1987654321",
"type_of_message": "call",
"direction": "inbound",
"message": null,
"recording_url": "https://cdn.example.com/recordings/call123.mp3",
"call_status": "completed",
"call_duration": 125,
"assigned_account_id": "d4e5f6a7-b8c9-0123-def1-234567890123",
"created_at": "2026-03-15T08:05:00.000Z"
}
],
"pagination": {
"page_number": 1,
"items_per_page": 10,
"total_count": 25,
"total_pages": 3
}
}
}List all messages by conversation ID
Retrieves a paginated list of messages for a specific conversation within a company. Supports sorting by created_at, pagination options, and optional created_before / created_after filters.
curl --request GET \
--url https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_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.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}",
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://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}"
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://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id}")
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{
"message": "Messages fetched successfully!",
"messages": {
"data": [
{
"conversation_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"message_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"contact_id": "f6a7b8c9-d0e1-2345-f123-456789012345",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"conversation_profile_email": "[email protected]",
"conversation_profile_number": "+1987654321",
"type_of_message": "sms_message",
"direction": "inbound",
"message": "Hi, I'd like to schedule an appointment.",
"media": [
"https://cdn.example.com/media/image1.jpg"
],
"call_status": null,
"call_duration": null,
"assigned_account_id": "d4e5f6a7-b8c9-0123-def1-234567890123",
"created_at": "2026-03-15T08:00:00.000Z"
},
{
"conversation_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"message_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"contact_id": "f6a7b8c9-d0e1-2345-f123-456789012345",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"conversation_profile_email": "[email protected]",
"conversation_profile_number": "+1987654321",
"type_of_message": "call",
"direction": "inbound",
"message": null,
"recording_url": "https://cdn.example.com/recordings/call123.mp3",
"call_status": "completed",
"call_duration": 125,
"assigned_account_id": "d4e5f6a7-b8c9-0123-def1-234567890123",
"created_at": "2026-03-15T08:05:00.000Z"
}
],
"pagination": {
"page_number": 1,
"items_per_page": 10,
"total_count": 25,
"total_pages": 3
}
}
}Authorizations
Authentication token required for accessing protected endpoints. The token should be obtained from the main SalesCaptain authentication service.
Path Parameters
Unique identifier for the company
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Unique identifier for the conversation
"b2c3d4e5-f6a7-8901-bcde-f12345678901"
Query Parameters
Page number for pagination (must be a positive integer)
x >= 11
Number of items per page (10-100, default 10)
10 <= x <= 10010
Field to sort by
created_at "created_at"
Sort direction (default desc)
asc, desc "desc"
Return only messages created before this ISO date-time
"2026-03-15T23:59:59.000Z"
Return only messages created after this ISO date-time
"2026-03-01T00:00:00.000Z"

