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.

Random errors with code 400

Regular Participant

Random errors with code 400



When updating a contact's info/subscription using the API, sometimes I get the error:


Error 400: Update failed: Existing person 123456:789 has an invalid state: Status transition from O to S is not allowed when action by owner and confirm opt in is off


I'm guessing it's saying the user is being changed from Do Not Mail to Active and the action is by owner (ACTION_BY_CUSTOMER?).


However the xml posted has ACTION_BY_CONTACT specified.


This happens randomly (but quite frequent) as if I do the same update again, it would go through fine.



Regular Participant

Is there a way to prevent this error?


Hey Jason,


I'd be interested to see the XML behind this, both the original state of the Contact, and what is being pushed for the update. This can definitely help with figuring out the cause.

Nick Galbraith
Support Engineer
Regular Participant

I just ran some more testing and the error popped again.


Here's the xml before the update, basically it was the xml returned from cosntantcontact by using the get detailed contact info http get.


?xml version="1.0" encoding="UTF-8" standalone="no"?<entry xmlns="http://www.w3.org/2005/Atom">
  <link href="/ws/customers/abc/contacts/238" rel="edit"/>
  <title type="text">Contact: xyz@xyz.com</title>
    <name>Constant Contact</name>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/abc/contacts/238">
      <Status>Do Not Mail</Status>
      <Name> </Name>
    <title type="text">Contacts for Customer: abc</title>
    <link href="contacts"/>
    <link href="contacts" rel="self"/>


Below is the xml used to update this contact.

?xml version="1.0" encoding="UTF-8"?
<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Contact: xyz@xyz.com</title>
  <summary type="text">Update Contact</summary>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/abc/contacts/238">
        <ContactList id="http://api.constantcontact.com/ws/customers/abc/lists/2"></ContactList>
        <ContactList id="http://api.constantcontact.com/ws/customers/abc/lists/72"></ContactList>


If I run through the process again, it would work fine. Using the same xml pretty much.


Also, what does this error mean?

Error 400: Update failed: Existing person 123456:238 has an invalid state: Status transition from O to S is not allowed when action by owner and confirm opt in is off


[*Note from a CTCT Community Admin: I removed the beginning and ending brackets from the "?xml version="1.0"..." lines in your post above because those lines break the "Developer Support" tab in our CTCT "Labs JMML Q&A" Facebook app (apparently, the app is trying to render those lines as is, which wouldn't be acceptable in the middle of a page).]

Regular Participant

Hi, just wondering if this is being looked into.

Also are you able to reproduce this issue?

Hey, sorry for the lack of updates on this. I'm still trying to recreate on my end. Would you be able to PM me the username that you're working in, so I can make sure my account has all the same settings?

Nick Galbraith
Support Engineer
Regular Participant

Hi Nick,


Thanks for getting on it.  PM sent.

Developer Portal

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

Visit Page