INVALID_VALUE on POST /api/v2/outbound/contactlists with .NET SDK

Trying to create a new contact list via the Genesys Cloud .NET SDK. Following the docs exactly, but getting a 400 Bad Request with INVALID_VALUE.

Here is the payload I’m sending:

var createContactList = new CreateContactListRequest()
{
 Name = "Test List DotNet",
 Type = "upload",
 Contacts = new List<OutboundContact>()
 {
 new OutboundContact()
 {
 Id = "12345",
 FirstName = "John",
 LastName = "Doe",
 Phone = new OutboundContactPhone()
 {
 Number = "+15551234567"
 }
 }
 }
};

var response = await _outboundApi.PostOutboundContactListsAsync(createContactList);

The error response body is just:

{
 "errors": [
 {
 "code": "INVALID_VALUE",
 "message": "Invalid value provided"
 }
 ]
}

I checked the Swagger spec. OutboundContact requires Id, FirstName, LastName. OutboundContactPhone requires Number. All present.

If I change Type to import it works fine. But upload fails. Docs say upload is valid for POST.

Am I missing a required field on the OutboundContact class that isn’t in the C# model? Or is this a bug in the SDK serialization?

The issue here is that the Id field in OutboundContact is strictly read-only when creating a list via the API. The server generates the unique identifier for each contact. If you pass a value there, the validation layer rejects it immediately with INVALID_VALUE.

You need to remove the Id assignment. You can also drop the Contacts array entirely if you just want to create the empty list structure first. Genesys handles the initial creation and the data upload as two separate steps usually.

Here is how I structure it in C#. I also set the Delimiter explicitly because the default can sometimes trip up the parser if your CSV doesn’t match expectations.

var createContactList = new CreateContactListRequest()
{
 Name = "Test List DotNet",
 Type = "upload", // or "manual" if you plan to add contacts via API later
 Delimiter = ",", 
 // Note: Do not include Contacts here if you are uploading a CSV file later.
 // If you are adding contacts via API, use the /api/v2/outbound/contacts endpoint separately.
};

try
{
 var result = await platformClient.Outbound.PostOutboundContactlists(createContactList);
 Console.WriteLine($"List created with ID: {result.Id}");
}
catch (Exception e)
{
 Console.WriteLine($"Error: {e.Message}");
}

If you actually need to populate the list with contacts via code, you’ll need the contactListId from the response above. Then you make a separate call to PostOutboundContacts. The SDK method is PostOutboundContactsAsync.

var contactToAdd = new OutboundContact()
{
 FirstName = "John",
 LastName = "Doe",
 PhoneNumbers = new List<OutboundContactPhoneNumber>()
 {
 new OutboundContactPhoneNumber()
 {
 E164Pattern = "+442071234567"
 }
 }
};

var addContactResult = await platformClient.Outbound.PostOutboundContacts(contactListId, new List<OutboundContact> { contactToAdd });

Watch out for the phone number format. The API is strict on E.164. If you pass a local format without the country code, it might accept it but fail during dialing. Always normalize to E.164 before sending it to Genesys.