Hi everyone!
I’m integrating my CRM with SendPulse (CRM → SendPulse → Instagram), and I’ve run into an issue with the /contacts/send API method.
When I send a message via this endpoint:
the message is delivered to the user correctly,
but SendPulse immediately triggers a webhook with the event outgoing_message, containing the same text.
As a result, I get an echo effect in my CRM:
Operator: test
Bot: test
The problem is that /contacts/send only returns:
{"success": true, "data": true}So there’s no message ID (mid) in the response, which makes it impossible to properly distinguish:
operator messages (sent via API),
bot messages (actual outgoing messages).
Because of this, SendPulse treats messages sent via API as if they were sent by the bot and sends them back via webhook.
Ideally:
either messages sent via /contacts/send should not trigger outgoing_message webhooks,
or the API should return a message ID so we can deduplicate on the CRM side.
Right now, my workaround is to cache the last message sent by the operator and ignore outgoing webhooks for 20 seconds — but this feels like a hack.
Has anyone dealt with this? How are you solving it?