Campaign Monitor API OAuth error 120: fix and re-add contacts
Code 120 means Campaign Monitor read your credential as an OAuth token. With createsend-python, pass an API key as the api_key entry of the auth dict, not as an access token. Re-adding unsubscribed or suppressed contacts takes separate calls, and only for people who have given fresh consent.
Sohail Hussain8 min readShort answer
- Error code 120 usually means the library sent your API key as an OAuth token. Pass it as api_key in the auth dict, never as access_token.
- Fixing auth does not unsuppress anyone. Unsubscribed contacts, account-level suppressions and bounces are separate states, and each needs its own call.
- Re-add someone only if they opted in again after leaving. Otherwise leave them suppressed.
You are running a Python script against Campaign Monitor to bring back about 400 unsubscribed or suppressed contacts, and the call returns this:
OAUTH token error (code 120)
You copied the API key straight from your account, so the error looks wrong. It is rarely about the key itself.
Why the error happens
Campaign Monitor accepts two kinds of credentials: an API key and an OAuth access token. The createsend-python library picks the scheme from the keys in the auth dict you hand it. If the dict contains access_token, the library sends the value as an OAuth bearer token, and the server validates it as one. An API key is not a valid OAuth token, so the request fails with code 120.
Causes, most common first:
- The key is passed under
access_token, often because a sample written for OAuth was reused for an API-key setup. - The key has a trailing space or newline, usually from an
.envfile or shell variable. - The key and the list ID belong to different accounts or clients.
- You really are using OAuth, and the token has expired or was never refreshed. That needs the full flow with
access_tokenandrefresh_token.
I can't confirm how Campaign Monitor words every neighboring error code. Check the error table in Campaign Monitor's official API documentation for the codes next to 120 rather than relying on this page.
Fix the auth dict
1. Use the api_key form
from createsend import Subscriber
auth = {'api_key': 'YOUR_API_KEY'} # not 'access_token'
list_id = 'YOUR_LIST_ID'
Subscriber(auth).add(
list_id,
'person@example.com',
'Person Name',
[], # custom fields
True, # resubscribe
'Yes', # consent_to_track
)
Set consent_to_track to 'Yes' only when the person has agreed to tracking. Check the allowed values for your installed library version in its source or in Campaign Monitor's API docs.
2. Rule out the quiet causes
- Confirm the dict key is exactly
api_key. Anything namedaccess_tokenorrefresh_tokenselects OAuth. - Strip whitespace:
os.environ['CM_API_KEY'].strip(). - Check that the list ID comes from the same account as the key. Open the list in Campaign Monitor and look in its settings for the API list ID.
- Upgrade the library with
pip install --upgrade createsend. Theaddsignature has changed between versions, so aTypeErrorinstead of code 120 means you should compare your call with the source of the version you installed. - If you need OAuth (for example, you build an integration for other people's accounts), register the integration and run the full flow. An API key will not work there.
Keep the key out of logs
Do not paste the API key into a support ticket, a Git commit or a forum post. If it has leaked, regenerate it in your Campaign Monitor account settings.
Why re-adding suppressed contacts still fails
Once code 120 is gone, many of the 400 addresses may still not come back. That is expected, because "suppressed" covers several different states.
| State | What put them there | How to reactivate via API |
|---|---|---|
| Unsubscribed or deleted on one list | They clicked unsubscribe, or you removed them | add with resubscribe set to True |
| On the account's suppression list | Manual suppression, or a hard bounce or complaint | Use the unsuppress endpoint; confirm its exact name in the docs |
| Bounced or marked as a complaint | Mail server or recipient action | Fix the cause first; a hard bounce usually means the address is dead |
I am not certain of the exact method name for removing an address from the account-level suppression list in your installed createsend version, so do not script it from this page. Open the suppression section of Campaign Monitor's current API documentation, then check what your library exposes (dir(Client) in a Python shell is a quick way to see). If the library lacks a wrapper, the documented HTTP endpoint can be called directly with the same API key.
Import instead of looping add
For about 400 addresses, one import request beats 400 add calls. You get per-row failures back instead of a silent loop:
from createsend import Subscriber
auth = {'api_key': 'YOUR_API_KEY'}
rows = [
{'EmailAddress': 'a@example.com', 'Name': 'A', 'CustomFields': [], 'ConsentToTrack': 'Yes'},
{'EmailAddress': 'b@example.com', 'Name': 'B', 'CustomFields': [], 'ConsentToTrack': 'Yes'},
]
result = Subscriber(auth).import_subscribers(
'YOUR_LIST_ID', rows, True # resubscribe
)
Read the failure details in the result. Rows rejected because the address is suppressed show up there. Whether ConsentToTrack is required per row depends on the API version, so check the import section of the docs.
Consent comes before the script
An unsubscribe is a withdrawal of consent. Setting resubscribe to True is a technical switch; it does not make the mail lawful or welcome. Re-add a person only when you hold a fresh, documented opt-in from after they left: a new form submission, a reply asking to rejoin, a purchase with a clear marketing checkbox.
Flipping a whole list back is the quickest way to a spike in spam complaints, and complaints are exactly what put addresses on suppression lists. Our notes on suppression list management and double opt-in cover how to collect and record consent.
Filter before you import
Split your 400 contacts into two files: those with a dated opt-in record after they unsubscribed, and everyone else. Only import the first file.
The Zapier throttling error
A related report from Zapier users shows this message after a custom field was added:
Failed to create a subscriber in Campaign Monitor (Campaign Monitor throttling ...)
This is not an authentication failure, so it has nothing to do with code 120. The reports do not establish a cause, and I can't either. Reasonable steps:
- Confirm the custom field name and data type match what Campaign Monitor expects for that list.
- Slow the Zap down, and avoid bursts of many tasks at once.
- Send the exact error text and a timestamp to both Zapier and Campaign Monitor support.
Checklist before you run the script again
- The auth dict uses
api_key, with no whitespace in the value. - The list ID and the key belong to the same account.
createsendis up to date, and the methods you call exist in that version.- Every contact in the file has a documented opt-in dated after they left.
- Hard bounces and complaints are excluded.
- You tested with 2 or 3 addresses first and read the response.
If nothing works
Contact Campaign Monitor support if a freshly copied key still returns code 120 with the api_key form. Include:
- the full error response and the endpoint you called
- the request time with timezone
- your
createsendversion and Python version - what you already tried
Never send the key itself.
Subject: API error 120 (OAUTH token error) with api_key auth
Hi, my createsend-python calls fail with "OAUTH token error (code 120)"
even though I authenticate with {'api_key': ...} (not access_token).
Endpoint: add subscriber to list {your-list-id}
Time of request: {date, time, timezone}
Library: createsend {version}, Python {version}
Already tried: re-copied the key without whitespace, confirmed the
list ID is from the same account, upgraded the library.
Can you confirm the key is active for API use on this account?
Common questions
Can I use an OAuth token instead of an API key?
Yes, but only with the full OAuth flow, passing both access_token and refresh_token in the auth dict. A plain API key placed there gives you code 120.
Does resubscribe=True override an account-level suppression?
Not as far as I can confirm. Account-level suppression is a separate list, so check Campaign Monitor's API docs for the unsuppress method before assuming add handles it.
Is it legal to re-add people who unsubscribed?
Generally not without a new opt-in. Rules differ by country, so see our CAN-SPAM compliance guide and ask a lawyer about your case.
Why do some of my 400 contacts fail even with correct auth?
Hard bounces, complaints and manual suppressions stay blocked until you remove them from suppression. Read the failure list in the import response to see which rows were rejected and why.
Explore: Email Marketing Strategy
Related Articles
ActiveCampaign n8n error 301 on create contact: causes and fixes
A 301 from the ActiveCampaign node means the request went to a URL that redirects, so start with the API URL in your n8n credential. Copy it from Settings, then Developer, and check the scheme and path. Zapier 403 and cURL error 28 behind Cloudflare have different causes, covered below.
"Stage not on allowlist": Apollo to HubSpot sync fix
The error "Stage not on allowlist" means the contact's Apollo stage is not on the list of stages permitted to push to HubSpot. Open the HubSpot integration in Apollo, go to the Sync tab, and add that stage under "Stages for push contacts". Lifecycle stage mapping is a separate setting.
Salesmate "Authorization with Gmail failed": Gmail IMAP fix
Salesmate shows "Authorization with Gmail failed" when it can't read your Gmail account over IMAP. In Gmail settings, enable IMAP, choose "Do not limit the number of messages in an IMAP folder", and show All Mail in IMAP. Then reconnect the account in Salesmate. Other causes are covered below.
AWeber export "Stop Status" and "Stop Time" columns explained
In an AWeber subscriber export, a non-empty Stop Time and a non-zero Stop Status most likely mean the person has stopped receiving your mail, usually because they unsubscribed. AWeber doesn't explain the columns in the file, so verify against a few known unsubscribes, then import those rows as blocked, not subscribed.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free