Skip to main content
GET
/
v1
/
fetch-messages
/
{company_id}
/
{conversation_id}
Fetch messages for a conversation (paginated)
curl --request GET \
  --url https://api.salescaptain.com/v1/fetch-messages/{company_id}/{conversation_id} \
  --header 'Authorization: Bearer <token>'
{
  "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",
        "assigned_account_id": "d4e5f6a7-b8c9-0123-def1-234567890123",
        "created_at": "2026-03-15T08:00:00.000Z"
      }
    ],
    "pagination": {
      "page_number": 1,
      "items_per_page": 10,
      "total_count": 25,
      "total_pages": 3
    }
  }
}

Authorizations

Authorization
string
header
required

Authentication token required for accessing protected endpoints. The token should be obtained from the main SalesCaptain authentication service.

Path Parameters

company_id
string<uuid>
required

Unique identifier for the company

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

conversation_id
string<uuid>
required

Unique identifier for the conversation

Example:

"b2c3d4e5-f6a7-8901-bcde-f12345678901"

Query Parameters

page_number
integer
required

Page number for pagination (must be a positive integer)

Required range: x >= 1
Example:

1

items_per_page
integer
default:10

Number of items per page (10-100, default 10)

Required range: 10 <= x <= 100
Example:

10

sort_by
enum<string>

Field to sort by

Available options:
created_at
Example:

"created_at"

sort_dir
enum<string>
default:desc

Sort direction (default desc)

Available options:
asc,
desc
Example:

"desc"

Response

Messages fetched successfully or error response

message
string
Example:

"Messages fetched successfully!"

messages
object