curl --request POST \
--url https://{projectID}.texterchat.com/server/api/v2/chats/{chatId}/crm-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"plan": "premium",
"tags": [
"vip",
"whale"
],
"customer": {
"first_name": "Niv",
"last_name": "Shteingart",
"lead_id": 641225
}
}
}
'{
"_id": "64de3b15398a8e09c47a9f62",
"title": "<string>",
"displayName": "<string>",
"personId": "<string>",
"image": "<string>",
"channelInfo": {
"name": "whatsapp",
"accountId": "972586640430",
"id": "972521234567",
"metadata": {}
},
"agent": {
"uid": "<string>",
"displayName": "<string>"
},
"departmentId": "<string>",
"status": 0,
"unreadCount": 123,
"labels": [
"urgent",
"billing"
],
"lastMessage": {
"type": "<string>",
"text": "<string>",
"media": [
{
"mediaType": "image",
"fileId": "6900c1eac29d42708adac92f",
"previewId": "<string>",
"filename": "offer_october_2025.pdf",
"contentType": "application/pdf",
"caption": "<string>",
"metadata": {
"frequentlyForwarded": false
},
"scanned": true,
"deleted": {
"timestamp": 123
},
"url": "<string>"
}
]
},
"last_message_timestamp": 123,
"lastIncomingMessageTimestamp": 123,
"created": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"pendingMessageTime": 123,
"pendingUpdateTime": 123,
"resolvedUpdateTime": 123,
"replyAction": {
"created": 123,
"expirationTime": 259200,
"chatStatus": 0,
"setBotNode": "<string>",
"bot": "<string>",
"replyText": "<string>",
"responsibleAgent": "<string>",
"responsibleDepartment": "<string>",
"replyToTemplateFile": {
"url": "<string>",
"name": "<string>"
},
"resolveTime": 123,
"status": 0
},
"sendingBulkAgent": "<string>",
"latestBulkSendId": "<string>",
"botState": {
"id": "<string>",
"flowVersion": {
"identifier": "onboarding-bot",
"version": 203
},
"node": "<string>",
"userState": {},
"store": {},
"latestAgentUid": "<string>",
"latestAgentName": "<string>"
},
"previousBotSession": {
"id": "<string>",
"flowVersion": {
"identifier": "onboarding-bot",
"version": 203
},
"node": "<string>",
"userState": {},
"store": {},
"latestAgentUid": "<string>",
"latestAgentName": "<string>"
},
"crmData": {},
"crmDeepLink": "<string>",
"crmLastTicketId": "<string>",
"lastMessageStoredInCRMTimestamp": 123,
"externalBot": true,
"unsubscribed": {
"date": "2023-11-07T05:31:56Z",
"bulkSendId": "<string>"
},
"blockedChat": {
"blocked": true,
"agent": "<string>"
},
"hasMessageError": true,
"language": "<string>",
"personChats": [
{
"name": "whatsapp",
"accountId": "972586640430",
"id": "972521234567",
"metadata": {}
}
],
"channel": "<string>",
"clientPhone": "<string>",
"clientPhoneE164": "<string>",
"entityPhone": "<string>",
"lastText": "<string>",
"unsubscribeTime": 123,
"blockTemplates": true
}{
"error": "<string>"
}{
"error": "Chat invalidChatID not found"
}Chats
Update CRM Data
Update the CRM data attached to a specific chat. Supports multiple merge strategies so you can fully replace, shallow merge, deep merge, or fill in missing fields only.
POST
https://{projectID}.texterchat.com/server/api/v2
/
chats
/
{chatId}
/
crm-data
curl --request POST \
--url https://{projectID}.texterchat.com/server/api/v2/chats/{chatId}/crm-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"plan": "premium",
"tags": [
"vip",
"whale"
],
"customer": {
"first_name": "Niv",
"last_name": "Shteingart",
"lead_id": 641225
}
}
}
'{
"_id": "64de3b15398a8e09c47a9f62",
"title": "<string>",
"displayName": "<string>",
"personId": "<string>",
"image": "<string>",
"channelInfo": {
"name": "whatsapp",
"accountId": "972586640430",
"id": "972521234567",
"metadata": {}
},
"agent": {
"uid": "<string>",
"displayName": "<string>"
},
"departmentId": "<string>",
"status": 0,
"unreadCount": 123,
"labels": [
"urgent",
"billing"
],
"lastMessage": {
"type": "<string>",
"text": "<string>",
"media": [
{
"mediaType": "image",
"fileId": "6900c1eac29d42708adac92f",
"previewId": "<string>",
"filename": "offer_october_2025.pdf",
"contentType": "application/pdf",
"caption": "<string>",
"metadata": {
"frequentlyForwarded": false
},
"scanned": true,
"deleted": {
"timestamp": 123
},
"url": "<string>"
}
]
},
"last_message_timestamp": 123,
"lastIncomingMessageTimestamp": 123,
"created": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"pendingMessageTime": 123,
"pendingUpdateTime": 123,
"resolvedUpdateTime": 123,
"replyAction": {
"created": 123,
"expirationTime": 259200,
"chatStatus": 0,
"setBotNode": "<string>",
"bot": "<string>",
"replyText": "<string>",
"responsibleAgent": "<string>",
"responsibleDepartment": "<string>",
"replyToTemplateFile": {
"url": "<string>",
"name": "<string>"
},
"resolveTime": 123,
"status": 0
},
"sendingBulkAgent": "<string>",
"latestBulkSendId": "<string>",
"botState": {
"id": "<string>",
"flowVersion": {
"identifier": "onboarding-bot",
"version": 203
},
"node": "<string>",
"userState": {},
"store": {},
"latestAgentUid": "<string>",
"latestAgentName": "<string>"
},
"previousBotSession": {
"id": "<string>",
"flowVersion": {
"identifier": "onboarding-bot",
"version": 203
},
"node": "<string>",
"userState": {},
"store": {},
"latestAgentUid": "<string>",
"latestAgentName": "<string>"
},
"crmData": {},
"crmDeepLink": "<string>",
"crmLastTicketId": "<string>",
"lastMessageStoredInCRMTimestamp": 123,
"externalBot": true,
"unsubscribed": {
"date": "2023-11-07T05:31:56Z",
"bulkSendId": "<string>"
},
"blockedChat": {
"blocked": true,
"agent": "<string>"
},
"hasMessageError": true,
"language": "<string>",
"personChats": [
{
"name": "whatsapp",
"accountId": "972586640430",
"id": "972521234567",
"metadata": {}
}
],
"channel": "<string>",
"clientPhone": "<string>",
"clientPhoneE164": "<string>",
"entityPhone": "<string>",
"lastText": "<string>",
"unsubscribeTime": 123,
"blockTemplates": true
}{
"error": "<string>"
}{
"error": "Chat invalidChatID not found"
}Required token scopes:
Omitting
Manage all chats
mergingMode | Behavior |
|---|---|
replace | Fully replaces existing CRM data with data |
assign | Shallow merge - replaces top-level keys with values from data |
merge | (Default) Deep recursive merge of nested objects and arrays |
defaults | Fills in top-level keys from data only where they don’t already exist |
defaultsDeep | Same as defaults but applied recursively to nested values |
data with mergingMode: "replace" effectively erases all CRM data on the chat.הרשאות
פרמטרי נתיב
גוף
application/json
תגובה
The updated chat object. Field-by-field reference: The Chat object
A conversation with a contact on a connected channel