Setting up a webhook consumer to track call endings for our primary support queue. The goal is to keep the downstream Lambda lightweight by filtering events at the source. I’ve registered an event subscription targeting conversation.end, but it’s firing for every queue in the org. That’s way too much noise.
I tried adding a filter criteria in the subscription body using the queue ID. The docs mention filtering by conversation.queueId, but the event payload structure is tricky. Here’s the JSON I’m sending to POST /api/v2/analytics/events/subscription:
{
"name": "QueueSpecificEnd",
"type": "conversation.end",
"filter": {
"criteria": [
{
"field": "conversation.queueId",
"op": "eq",
"value": "8a204a8d-1234-5678-90ab-cdef12345678"
}
]
},
"target": {
"type": "webhook",
"url": "https://my-endpoint.example.com/hook"
}
}
The subscription creates successfully with a 200 OK, but the events still arrive for other queues. I checked the raw event payload in the logs, and the field looks like data.conversation.queueId, not just conversation.queueId. Maybe the filter path needs to be more specific? Or is this field not indexable for filtering in the subscription config?
I’ve also tried using data.conversation.queueId as the field name, but that resulted in a 400 Bad Request saying the field is invalid. I’m stuck between the filter not working and the field name being wrong. We need to stop processing irrelevant events before they hit the webhook. Anyone know the exact field path for queue-based filtering in event subscriptions? The documentation isn’t clear on nested object paths in the filter criteria.