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

Update Conversation

PATCH
https://api.agentphone.ai/v1/conversations/:conversation_id
PATCH
/v1/conversations/:conversation_id
1const url = 'https://api.agentphone.ai/v1/conversations/conversation_id';
2const options = {
3 method: 'PATCH',
4 headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
5 body: '{}'
6};
7
8try {
9 const response = await fetch(url, options);
10 const data = await response.json();
11 console.log(data);
12} catch (error) {
13 console.error(error);
14}
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}
Update conversation metadata (state). Use this to store custom context for AI agents: - Customer information (name, account ID) - Business context (order ID, ticket number) - Session state (current topic, preferences) The metadata is included in webhook payloads as `conversationState`.
Was this page helpful?
Previous

Get Conversation Messages

Next
Built with

Update conversation metadata (state).

Use this to store custom context for AI agents:

  • Customer information (name, account ID)
  • Business context (order ID, ticket number)
  • Session state (current topic, preferences)

The metadata is included in webhook payloads as conversationState.

Authentication

AuthorizationBearer

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

Path parameters

conversation_idstringRequired

Request

This endpoint expects an object.
metadataobject or nullOptional

Response

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

Errors

422
Unprocessable Entity Error