Event Hub webhook 403 on agent state updates

const options = {
 headers: { 'Content-Type': 'application/json' },
 method: 'POST',
 body: JSON.stringify({
 eventId: '12345',
 eventType: 'AGENT_STATE_CHANGE',
 payload: { agentId: '98765', newState: 'Available' }
 })
};

The webhook is returning a 403 Forbidden for AGENT_STATE_CHANGE events but works FINE for routing events. This is running on Node.js v18.16.0 and the subscription is active in Event Hub. The API key has all the right permissions. anyone seen this?

1 Like

Check the OAuth scope. Routing events and agent state changes often hit different permission checks.

Is the client using user_presence or just presence? Seen a few old community posts where missing the specific presence scope caused 403s on state updates while other notifications flowed fine.