Outbound contact list POST 400 INVALID_VALUE

Hitting 400 when trying to create a contact list via the Outbound API. The error payload points to the name field being invalid, but it’s just a string.

{
 "name": "Test List 001",
 "description": "test",
 "contactType": "PHONE",
 "knowledgeBaseId": null,
 "contactFields": [
 {
 "name": "phone_number",
 "type": "STRING"
 }
 ]
}

Checked the schema. Nothing obvious. What am I missing?

The payload you’re sending looks fine structurally, but the 400 error on name usually means the field is missing in the eyes of the API or the content type header is off. Double-check that you’re sending Content-Type: application/json.

If you’re using the Python SDK, make sure you’re instantiating the OutboundContactList object correctly before passing it to the create method. The SDK doesn’t always map raw JSON payloads directly if the types aren’t explicit.

from purecloudplatformclientv2 import OutboundApi, OutboundContactList, OutboundContactField

api_instance = OutboundApi()

# Define the contact field explicitly
contact_field = OutboundContactField(
 name="phone_number",
 type="STRING"
)

# Build the list object
body = OutboundContactList(
 name="Test List 001",
 description="test",
 contact_type="PHONE",
 contact_fields=[contact_field]
)

try:
 api_response = api_instance.post_outbound_contactlists(body=body)
 print(api_response)
except Exception as e:
 print("Exception when calling OutboundApi->post_outbound_contactlists: %s\n" % e)

If you’re sticking to raw curl, ensure the JSON is strictly double-quoted. Single quotes around the JSON body in the shell command can sometimes cause issues if not escaped properly.

curl -X POST "https://api.mypurecloud.com/api/v2/outbound/contactlists" \
 -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "name": "Test List 001",
 "description": "test",
 "contactType": "PHONE",
 "contactFields": [
 {
 "name": "phone_number",
 "type": "STRING"
 }
 ]
}'

Also check if you have any existing contact lists with that exact name. The API might be rejecting it due to a uniqueness constraint that isn’t explicitly documented in the basic error message. Try a unique name like “Test List 001 - $(date +%s)” to rule that out.