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

GET
https://api.agentphone.ai/v1/conversations/:conversation_id
GET
/v1/conversations/:conversation_id
1const url = 'https://api.agentphone.ai/v1/conversations/conversation_id';
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 "id": "string",
3 "phoneNumberId": "string",
4 "phoneNumber": "string",
5 "participant": "string",
6 "lastMessageAt": "2024-01-15T09:30:00Z",
7 "messageCount": 1,
8 "createdAt": "2024-01-15T09:30:00Z",
9 "messages": [
10 {
11 "id": "string",
12 "body": "string",
13 "fromNumber": "string",
14 "toNumber": "string",
15 "direction": "string",
16 "receivedAt": "2024-01-15T09:30:00Z",
17 "channel": "string",
18 "mediaUrl": "string",
19 "mediaUrls": [
20 "string"
21 ],
22 "reactions": [
23 {
24 "id": "string",
25 "reactionType": "string",
26 "fromNumber": "string",
27 "direction": "string",
28 "createdAt": "2024-01-15T09:30:00Z"
29 }
30 ]
31 }
32 ],
33 "agentId": "string",
34 "metadata": {}
35}
Get a conversation with its recent messages.
Was this page helpful?
Previous

Update Conversation

Next
Built with

Authentication

AuthorizationBearer

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

Path parameters

conversation_idstringRequired

Query parameters

message_limitintegerOptional<=100Defaults to 50

Response

Successful Response
idstring
phoneNumberIdstring
phoneNumberstring
participantstring
lastMessageAtdatetime
messageCountinteger
createdAtdatetime
messageslist of objects
agentIdstring or null
metadataobject or null

Errors

422
Unprocessable Entity Error