POST /api/v2/outbound/contactlists 400 INVALID_VALUE on name field

Trying to create a new outbound contact list via the Node.js SDK but hitting a 400 error. The response payload says INVALID_VALUE for the name field, yet it’s just a standard string like “Test List”.

Here’s the config object I’m passing to outboundApi.createContactList(config):

{
 name: "Test List",
 contactSpec: "s3://my-bucket/contacts.csv",
 contactSource: "s3",
 settings: {
 delimiter: ","
 }
}

Checked the docs and the schema looks right. What am I missing?

The name field isn’t just about the string value. It’s about uniqueness in your org. If “Test List” already exists, you’ll get that 400. The docs for POST /api/v2/outbound/contactlists state:

“The name must be unique within the organization.”

Check your existing lists first. Also, ensure you’re using the correct .NET SDK model structure. Here’s how I do it in C# to avoid these headaches:

var apiInstance = new OutboundApi();
var contactList = new ContactList
{
 Name = "Unique Test List " + DateTime.Now.ToString("yyyyMMddHHmmss"),
 ContactSpec = "s3://my-bucket/contacts.csv",
 ContactSource = "s3",
 Settings = new ContactListSettings
 {
 DeDuplicated = true
 }
};

try 
{
 var result = await apiInstance.PostOutboundContactLists(contactList);
}
catch (ApiException e)
{
 Console.WriteLine(e.Message);
}

Appending a timestamp usually bypasses the collision issue during testing. Don’t forget to check the contactSpec syntax too. It has to match the exact S3 path format expected by Genesys.