Hi Oscar harry,
Thank you for reaching out to the Microsoft Advertising Learn Q&A Platform!
The error message you're receiving "HTTP/1.1 401 Unauthorized" indicates that the API request to Microsoft Ads failed due to authentication issues. Here's a breakdown of what it means and how to resolve it.
- AuthenticationError: The request was rejected because the access token provided is either invalid or expired.
- InvalidCredentials: The token's signature is not valid. This could mean it's malformed, tampered with, or not issued correctly.
- TokenExpired: The token expired at 2025-10-28T13:30:00Z, so it’s no longer usable.
- AuthPolicyViolation: The client application is not authorized to access the requested resource scope. This could be due to missing permissions or incorrect configuration.
Here are the recommended steps to fix it:
- Acquire a New Access Token
- Use Microsoft Identity Platform to request a fresh OAuth 2.0 token.
- Ensure the token includes the correct scopes for Microsoft Ads API access (e.g., https://ads.microsoft.com/msads.manage).
- Verify Token Signature
- Make sure the token is generated correctly and hasn’t been altered.
- Use a trusted library or SDK to handle token generation and signing.
- Check App Permissions
- Confirm that the client application is registered in Azure AD and has the necessary API permissions.
- If using delegated permissions, ensure the user has granted consent.
- Update Authorization Header
- Include the new token in the Authorization header as:
Code Authorization: Bearer <access_token>
If the issue persists after refreshing the token and verifying permissions, it may help to review the app registration settings in Azure.
I hope the information provided here will at least partly answer your question. For us to make sure that we are able to address the issue, I'll be sending a private message on your inbox, please check your private message for further assistance.
Our support teams are happy to discuss your account in more detail via phone, chat or email to provide review assistance, please see our support page to reach out!
Kind regards,
Dagmara | Microsoft Advertising Support Specialist | 800-518-5689