Microsoft Advertising API error 105: InvalidCredentials

Error 105 says authentication failed, and it is usually not your password. The most common cause is a token or developer token from one environment used against the other.

Start free →

Made with Hermoso

Code 105 covers three different problems under one name, which is why it is so confusing. Most of the time the credentials are valid, just for a different environment than the one you are calling.

The exact error

Microsoft's operation error codes list it as:

CodeErrorCodeDescription
105InvalidCredentials"Authentication failed. Reasons include, AccountInactive, InvalidAccessToken, or UserNotFound."

In a REST response it arrives in the operation errors list:

{
  "OperationErrors": [{
    "Code": 105,
    "ErrorCode": "InvalidCredentials",
    "Message": "..."
  }]
}

What it means

Microsoft names three reasons:

  • AccountInactive: the account is inactive.
  • InvalidAccessToken: usually an access token or developer token for the wrong environment. Microsoft's own example: credentials that are valid in production return code 105 when you target sandbox.
  • UserNotFound: the supplied credentials are invalid.

Compare code 106, UserIsNotAuthorized: "The user is not authorized to perform this action." Microsoft explains that 106 usually means the credentials are right for the environment, but the user has no access to an account or entity in the request.

Because one code covers three causes, the message alone cannot tell you which one you hit. Work through them in order of likelihood: environment first, then token expiry, then account status.

Why it happens

  • A production developer token sent to the sandbox endpoints, or the reverse.
  • An OAuth user who signed up in production, used against sandbox, or the reverse.
  • An expired or revoked access token.
  • An inactive ad account.

How to fix it

  1. Check the environment end to end. The service URLs, the developer token and the OAuth user must all belong to production, or all to sandbox. Microsoft's sandbox guide covers the sandbox token and user.
  2. Refresh the access token and retry, to rule out expiry.
  3. Sign in to the Microsoft Advertising interface with the same user and confirm the account is active.
  4. If you get 106 instead, check the CustomerId and CustomerAccountId headers match an account this user can access. Do not send them to the Customer Management service, which Microsoft says does not use them.

How Hermoso handles it

Hermoso keeps Microsoft's own message and, on code 105, adds what it almost always means: the developer token or the OAuth account does not belong to the environment the call went to. On code 106 it adds that the connected user does not have access to that account or customer, and to check the pairing.

Hermoso never claims 105 as a billing problem, even though one of its reasons is an inactive account, because the same code also means a bad token. It sends the customer and account headers only to the services that take them. You connect your own Microsoft Advertising accounts with a normal sign-in and pick which ones Hermoso can use. See Microsoft Ads over MCP.

Related

Every platform error we have documented is on the error reference. For app reviews and access levels, see how to get API access.

Sources

Frequently asked questions

What does Microsoft Advertising error 105 mean?

Authentication failed. Microsoft lists three reasons: an inactive account, an access or developer token for the wrong environment, or invalid credentials.

Why do my production credentials return 105 in sandbox?

Microsoft's docs say credentials valid in production return code 105 when targeting sandbox. Use the sandbox developer token and a sandbox user there.

What is the difference between error 105 and 106?

105 is failed authentication. 106 means the credentials are fine but the user cannot access an account or entity in the request.

Skip the error hunting: connect your accounts to Hermoso free, no card.

Start free →   See pricing