We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Valid email addresses getting rejected?

Jakob S
Regular Participant

Valid email addresses getting rejected?

It seems like perfectly valid email addresses are being rejected when I try to add new contacts via the API:

POST https://api.constantcontact.com/ws/customers/jakobs/contacts
<entry xmlns='http://www.w3.org/2005/Atom'><id>data:,none</id><title type='text'></title><summary type='text'>Contact</summary><content type='application/vnd.ctct+xml'><Contact xmlns='http://ws.constantcontact.com/ns/1.0/'><EmailAddress>jakob_skjerning@example.com</EmailAddress><FirstName>Jakob</FirstName><OptInSource>ACTION_BY_CONTACT</OptInSource><ContactLists><ContactList id='http://api.constantcontact.com/ws/customers/jakobs/lists/1'/></ContactLists></Contact></content><updated>2010-03-13T15:27:22+01:00</updated><author/></entry>

Results in a HTTP 400 response:

Error 400: Error: Line 1: cvc-pattern-valid: Value 'jakob_skjerning@example.com' is not facet-valid with respect to pattern '(+)@(+)' for type 'emailaddressstring'.
Error: Line 1: cvc-type.3.1.3: The value 'jakob_skjerning@example.com' of element 'EmailAddress' is not valid.

Suffice to say, that regex probably needs to be looked at and would likely work better as '(.+)@(.+)' so we once again can include dashes, underscores, plusses and other valid characters in email addresses.

Thanks in advance.

Jakob Skjerning

substancelab.com - crafting quality web applications


Occasional Participant

I am noticing this same problem, emails with a - are not going through (email@web-address.com) that are my own personal emails that work fine with everything else.  All other emails are going through fine, was driving me crazy for a while before I realized the correlation that all emails being added that weren't working had the dash in there.  Please let me know if there is anything I can do on my end to fix the problem!


I am getting

Error 400: Error: Line 2: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '\s*\S(.|\n|\r)*' for type 'emailaddressstring'. Error: Line 2: cvc-type.3.1.3: The value '' of element 'EmailAddress' is not valid.

Which is a different pattern than above.

OOPS: Obviously Value '' means there was no value ... I had a mismatch between my form variable in the form vs. script.  Never mind me ....


Thank you for the feedback.  We are looking into this issue and hope to have an update soon regarding it. 

Dave Berard
Senior Product Manager, Constant Contact
Regular Participant



I have as well an issue with uploading valid emails.

Would you be able to provide regex you're using? It would avoid playing cat and mouse with your API and simply use what you're using.




Hi Mariusz,


I'm sorry, but that regex is absolutely buried in our code (and not webservices code). I've tried before, and not been able to get a clear answer as to what our regex is.


If you want to utilize our regular expression, the only way to do it is to submit the email address through our API (or user interface). This also looks like a decent one, if you want to try to catch it on your side first. \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b


I normally advise people to do a minimal check (say, validate that the string submitted to you has a minimum of 5 characters and contains an @ and period, and then submit to us. Sorry again for the limitation of not being able to tell you the exact regex we use.


Best Regards,
Shannon Wallace
Partner API Support Engineer

Regular Participant

Thank you very much Shannon.


I have resolved the issue by supplying only ISO8859-1 complient characters as part of json payload.
I found information about it on your website.

Taking opportunity I wanted to ask about your API again.

My task is to compare two mailing lists and remove from one of them contacts that appear on second list.
It seems quite simple task but the best solution I found so far is to request contacts of entire mailing list collections, compare them in memory and then remove contacts from a list using Bulk Activities - Remove Contacts Endpoint

I was wondering if it's possible to do it simpler way.

Thanks for help again.


Hi there,


I see what you mean. Unfortunately I believe the way you're doing this is the only way to do it. It's the same through our user interface--it's a pretty manual process to make sure contacts on one list don't appear on another list.


Best Regards,

Shannon Wallace

Partner API Support Engineer

Occasional Participant

We are having the same problem on our site -- any email with an underscore "_" is getting rejected. Please fix soon, thanks! 

Developer Portal

View API documentation, code samples, get your API key.

Visit Page