Triggering CXone outbound via Personal Connection API in Terraform

Is it possible to trigger a CXone outbound call using the Personal Connection API directly from a Terraform module? I’m trying to automate test calls during staging deployments. My current attempt uses local-exec with curl:

curl -X POST https://api.nice.incontact.com/.../personalconnection/outbound

Returns 401 Unauthorized even with valid OAuth token. Am I missing a specific scope for personalconnection or is this endpoint restricted from programmatic triggers in v2.0?

This looks like a scope mismatch.

Returns 401 Unauthorized

Personal Connection requires icm:personalconnection:write. Verify your token includes this. Also, Terraform local-exec is brittle for API calls. Use n8n with HTTP nodes for reliable token refresh and error handling in automation pipelines.