Webhook - ServiceNow Incident Sync

yeah so we’re getting intermittent 401s (401) on the ServiceNow webhook pipeline - specifically when it tries to refresh the OAuth token. Took like 2 hours to narrow it down, and it’s not the initial token grab, it’s the refresh.

Here’s the flow - pretty standard setup:

[CXone Webhook] --> [Mid-tier (JSON transform)] --> [ServiceNow REST API (POST /api/now/oauth/token)]
 ^
 | (refresh_token grant_type=refresh_token)
 |
 [ServiceNow OAuth Provider]

The initial token exchange works fine. It’s the subsequent refresh that’s failing. The transform’s sending the correct refresh token (verified with logs), and the URL’s correct. The payload looks like this:

{
 "grant_type": "refresh_token",
 "refresh_token": "YOUR_REFRESH_TOKEN"
}

ServiceNow’s OAuth provider is configured with a 30-minute token expiry - seems reasonable. The webhook’s hitting the /oauth/token endpoint, but it’s just returning the 401 (401) - no helpful error message beyond ‘invalid client’ which is… vague. We’ve checked the client ID and secret about a dozen times. ymmv, but seems like a ServiceNow config issue.