PureCloudPlatformClientV2 handles the auth flow but doesn’t actually expose a direct method for the cache manager endpoints so we’re hitting /api/v2/flows/caches straight through axios with a Java backend. Building the atomic POST with endpointId references and a ttlDuration matrix keeps throwing a 422 because the integration engine rejects the invalidation strategy directives around the formatVerification flag. Here’s the payload we’re sending:
{
"endpointId": "ext_api_789",
"ttlDuration": 3600,
"invalidationStrategy": "conditional_header",
"maxEntries": 5000,
"formatVerification": true
}
Hash verification works locally but the stale data purge trigger misfires when the hit ratio drops below 60%, leaving the CDN webhook sync completely desynced.
Honestly, the docs miss this detail entirely. You’re hitting that 422 because the Cache Manager endpoint doesn’t actually accept a matrix for the TTL Setting, it just wants a flat integer value in seconds. The Integration Engine also drops the request when you pass custom directives into the Invalidation Strategy instead of sticking to the standard Boolean flags for Format Verification. We usually run these setups straight from the Architect Flow using the Set Data Node, but if you’re pushing it via HTTP, you’ll need to strip out the nested objects and make sure your Bearer token includes the flow:write scope. It’s pretty finicky with strict schema validation, so double-check that the Endpoint ID matches the exact Flow ID you’re targeting. Just flatten the payload and you’ll stop getting rejected. The axios POST to /api/v2/flows/caches will finally accept it once you drop the extra nesting. Here’s what the actual request body should look like:
{
"endpointId": "f8a3c2d1-9b7e-4f1a-8c5d-2e6f9a0b1c3d",
"ttlDuration": 300,
"invalidationStrategy": {
"formatVerification": true,
"autoPurge": false
}
}