Description
🐛 Describe the Bug
Search conversations API
-"query" field
-accepts a phone or an email address
-used to find the conversationId
Performance issues. If you create a conversation and immediately search using its phone or email address it does not return the conversationId. Another conversation coming in will see no conversation on search, attempt to create conversation, then see errors the conversationId already exists.
📍 Location
https://marketplace.gohighlevel.com/docs/ghl/conversations/search-conversation
✅ Expected Behavior
Return the conversationId.
💻 Screenshots or Code Samples
Search Conversations: (locationId: DjpolQ8Je7u1t7OauwFL)
{
"query": "+1757redacted",
"contactId": "rTDJGD7SjqDamyzrk5UW"
}
Response:
{
"conversations": [],
"total": 0,
"traceId": "3306f3ea-57c4-4aa6-99fb-bfa4275a62ed"
}
Create Conversation right after:
{
"contactId": "rTDJGD7SjqDamyzrk5UW"
}
Response:
[400] HttpException Conversation with the contact id:rTDJGD7SjqDamyzrk5UW already exists! cbf699cb-28e6-42d8-b49b-f6731af2560b
🧠 Additional Context
Proposed solutions in the interim:
Create Conversation API
-If you return an error the conversationId already exists give us the conversationId in the response
-Treat it like "upsert" and don't return an error if it exists and just give us the output payload