Custom app connections are available on the Team plan. See White-label Connections for the overview.
Quick Connect vs Custom App
What You Need
Four values. Microsoft still requires a developer token on every API call, on top of the OAuth app that the user authorizes.
Access tokens last one hour; Markifact refreshes them with your client ID and secret on every run. Refresh tokens stay valid as long as they are used at least every 90 days.
Already have your own authorization flow? If your systems already hold a refresh token issued by your Azure app with these scopes, skip to Connect to Markifact.
Setting Up Your Custom Microsoft Ads App
1
Register the Azure App
- Open the Azure portal and go to Microsoft Entra ID > App registrations > New registration
- Enter your app name. This is the branding users see when they authorize
- Under Supported account types, choose Accounts in any organizational directory and personal Microsoft accounts, so both work and personal Microsoft accounts can sign in to Microsoft Advertising
- Under Redirect URI, choose Web and enter a URL you control (for example
https://www.youragency.com/microsoft-callback). Microsoft appends the auth code to this URL after authorization; the page does not need to do anything - Click Register and copy the Application (client) ID
2
Create a Client Secret
- In the app registration, open Certificates & secrets > New client secret
- Set a description and expiry, click Add, and copy the secret Value right away (it is shown only once)
3
Add the Microsoft Advertising Permission
- Open API permissions > Add a permission > APIs my organization uses
- Search for Microsoft Advertising and add the delegated permission msads.manage
- Also add offline_access, openid and email under Microsoft Graph delegated permissions
4
Get the Developer Token
- Sign in to the Microsoft Advertising developer portal with the Microsoft account that has access to the ad accounts you want to manage
- Request a token. A single-user token is issued immediately and works for that user; a universal token (any user) requires Microsoft’s approval
- Copy the developer token
5
Authorize and Get the Auth Code
- Open the following URL in a browser, replacing the client ID and redirect URI:
- Sign in with the Microsoft account that has access to the ad accounts (the same account as the developer token) and accept the permissions
- Microsoft redirects to your URL with
code=...in the query string. Copy the value. Auth codes expire after a few minutes, so do the next step right away
6
Exchange the Auth Code for a Refresh Token
Run this request, replacing the values (the redirect URI must match the one used above exactly):The response contains
refresh_token. Copy it.Important: Keep these values secure. Anyone holding the refresh token together with your client ID, secret and developer token can act on every ad account the user can reach.
7
Connect to Markifact
- In Markifact, go to the Connections page
- Click Connect on Microsoft Ads
- Select the Custom App (White-label) tab
- Enter a Connection Name (for example “Acme Agency Microsoft Ads”)
- Paste your Client ID, Client Secret, Refresh Token, and Developer Token
- Click Verify & Connect
Selecting Your Connection
Custom app connections appear under the name you chose, with a Custom app badge on the Connections page. Select them in Microsoft Ads nodes, agents, and MCP exactly like any other Microsoft Ads connection.Rotating or Replacing Credentials
Add the connection again with the same connection name and the new values (for example after a client secret expires). Markifact replaces the stored credentials in place, so workflows and agents bound to the connection keep working.Troubleshooting
Microsoft rejected the client ID or client secret (invalid_client)
Microsoft rejected the client ID or client secret (invalid_client)
Check the Application (client) ID and make sure you pasted the secret Value, not its ID. An expired client secret also fails this way; create a new one under Certificates & secrets.
Microsoft rejected the refresh token (invalid_grant)
Microsoft rejected the refresh token (invalid_grant)
The most common causes:
- The token was minted with a different client ID than the one you pasted
- The
offline_accessscope was missing, so no refresh token was issued - The token lapsed (90 days without use) or the user revoked the app under their Microsoft account’s Privacy > Apps and services
Microsoft Ads rejected the developer token or credentials (InvalidCredentials)
Microsoft Ads rejected the developer token or credentials (InvalidCredentials)
The developer token is wrong, or it belongs to a different Microsoft account than the one that minted the refresh token (a single-user developer token only works for its own user). Copy the token from the developer portal while signed in as the same account.
Summary
Related
White-label Connections
Overview of custom app connections across channels
Get Report
Pull Microsoft Ads performance data

