Outbound API: 400 INVALID_VALUE when creating contact list with custom fields

Hey folks,

Stuck on a weird one with the Outbound API. I’m trying to script the creation of a new contact list via POST /api/v2/outbound/contactlists because the UI is too slow for our volume.

The basic list creation works fine if I just send the name and description. The moment I add a contactFields array, though, the API slaps me with a 400 Bad Request. The error message is pretty vague:

{
 "errors": [
 {
 "code": "INVALID_VALUE",
 "context": "contactFields",
 "message": "Invalid value for field contactFields"
 }
 ]
}

I’ve been staring at the Swagger docs and the examples for an hour. My payload looks like this:

{
 "name": "Test List API",
 "description": "Created via script",
 "contactFields": [
 {
 "externalId": "phone_number",
 "name": "Phone Number",
 "type": "STRING"
 },
 {
 "externalId": "customer_id",
 "name": "Customer ID",
 "type": "STRING"
 }
 ]
}

I’ve tried changing type to NUMBER or INTEGER, but same error. I’ve also tried omitting the name field in the object, thinking maybe that’s redundant, but it just complains about missing fields then.

Is there a specific order these need to be in? Or maybe a hidden required field I’m missing? The docs imply externalId and type are the main things, but it feels like I’m hitting a wall.

Here’s the curl command I’m using for sanity check:

curl -X POST https://api.mypurecloud.com/api/v2/outbound/contactlists \
 -H 'Content-Type: application/json' \
 -H 'Authorization: Bearer <token>' \
 -d '{"name":"Test","description":"Test","contactFields":[{"externalId":"phone","type":"STRING"}]}'

Same 400 error.

Anyone else fought with this recently?