Update existing contacts with SMS numbers and consent via the API

Ahoy there,

I am hoping to add SMS numbers and consent details via the API. The following payload adds the SMS number to corresponding email and the "SMS status" appears as "No permission set". I am expecting the "SMS status" to be set to "Opt-in". What is supposed to happen here? How do I opt-in the contact to SMS messages via the API or import from a spreadsheet?

Here is the URL

BASE_URL = "https://api.cc.email/v3"

response = requests.post(f"{BASE_URL}/activities/contacts_json_import", headers=HEADERS, json=payload)

Here is the payload

{

"email": "<email_removed>",

"tag_ids": [

"tag_removed"

],

"sms_channel": {

"sms_number": "<phone_number_removed",

"sms_status": "explicit",

"sms_permission_to_send": "explicit",

"sms_consent_date": "2026-04-08"

}

}

1 reply
Best reply by Aarron G

Hi NetEnabledN ,

Thank you for reaching out to Constant Contact API Developer Support.

Your example payload doesn’t quite match the required request body schema for the /activities/contacts_json_import endpoint. The full schema can be found here.

The following is an example of a complete request payload. Note that there is no sms_channel object used within the items in the import_data array:

{
 "import_data": [
   {
     "email": "[email protected]",
     "sms_number": "5555555555",
     "sms_consent_date": "YYYY-MM-DD"
   }
 ],
 "list_ids": [
   "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
 ],
 "sms_permission_to_send": "explicit"
}

Your example also included a tag_ids array. Currently, this endpoint does not support tagging contacts as part of the import - which is why tags have been excluded from my example. I understand that the ability to include tags would be a useful feature, and as such, have opened a ticket to track this as a new feature request.

Your question also suggested that importing the contacts from a spreadsheet, via our website interface, may be a viable option for you. This method does support adding tags to the imported contacts. The following articles from our Knowledge Base cover formatting a file and importing it. If you have any questions on using our website interface, please reach out to our Support team via our main support phone number or our online chat support.

Regards,

Aarron G.
Tier II API Support Engineer

View original
4 Text Marketing Misses (and Their Fixes)

Join us for this free, 60-minute webinar as we break down the biggest mistakes that alienate customers and hold your business back.