For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGet API key
DocumentationIntegrationsAPI Reference
DocumentationIntegrationsAPI Reference
  • API Reference
      • GETList Conversations
      • GETGet Conversation
      • PATCHUpdate Conversation
      • GETGet Conversation Messages
      • POSTSend Typing Indicator
      • POSTSet Chat Background
      • DELRemove Chat Background
LogoLogo
HomeGet API key
API Referenceconversations

Get Conversation Messages

GET
https://api.agentphone.ai/v1/conversations/:conversation_id/messages
GET
/v1/conversations/:conversation_id/messages
1const url = 'https://api.agentphone.ai/v1/conversations/conversation_id/messages';
2const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
3
4try {
5 const response = await fetch(url, options);
6 const data = await response.json();
7 console.log(data);
8} catch (error) {
9 console.error(error);
10}
1{
2 "data": [
3 {
4 "id": "string",
5 "body": "string",
6 "fromNumber": "string",
7 "toNumber": "string",
8 "direction": "string",
9 "receivedAt": "2024-01-15T09:30:00Z",
10 "channel": "string",
11 "mediaUrl": "string",
12 "mediaUrls": [
13 "string"
14 ],
15 "reactions": [
16 {
17 "id": "string",
18 "reactionType": "string",
19 "fromNumber": "string",
20 "direction": "string",
21 "createdAt": "2024-01-15T09:30:00Z"
22 }
23 ]
24 }
25 ],
26 "hasMore": true
27}

Get paginated messages for a conversation.

Use before/after for cursor-based pagination.

Was this page helpful?
Previous

Send Typing Indicator

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

conversation_idstringRequired

Query parameters

limitintegerOptional<=200Defaults to 50
beforedatetime or nullOptional
afterdatetime or nullOptional

Response

Successful Response
datalist of objects
hasMoreboolean

Errors

422
Unprocessable Entity Error