Trying to fire an outbound call via the CXone Personal Connection API from our New Relic integration node. The POST to /api/v2/outbound/campaigns/{id}/contacts/preview returns a 400 Bad Request. The JSON payload looks solid with valid from/to numbers and campaign IDs.
Here’s the snippet failing:
{"campaignId":"x","contact":{"phoneNumber":"+15550199"},"preview":true}
Error message says ‘Invalid campaign state’. Checked the docs, but nothing jumps out. Is the campaign actually running?
Check the campaign status first. preview mode only works on running or paused campaigns, not stopped or draft. You’ll hit that 400 immediately if the state isn’t active.
{
"campaignId": "your-campaign-id",
"contact": {
"phoneNumber": "+15550199"
},
"preview": true
}
The payload structure is fine. The issue is likely the campaign lifecycle state. Run this to verify:
GET /api/v2/outbound/campaigns/{id}
Look for "state": "running" in the response. If it’s stopped, kick it off with a PATCH to /api/v2/outbound/campaigns/{id} setting "state": "running".
Also double-check the integration user permissions. They need outbound:campaign:preview scope. Missing that scope sometimes returns a 403, but if the campaign is paused, it throws a 400 about invalid state. Don’t mix those up.