MCP campaign tutorial
Use IQM Model Context Protocol (MCP) to interact with the Campaign API.
Overview
This tutorial guides you through using IQM MCP to access and manage campaigns and insertion orders (IOs) with the Campaign API.
The Campaign MCP supports a limited set of features of the Campaign API. For a comprehensive list of supported features and best practices for using the Campaign API, refer to the Campaign API guidelines.
Before you begin
To create an IO and campaign, the following are required:
- An account on the IQM platform
- See Before you begin to create an account and request a Client ID and Client Secret
- An approved and running creative
- A conversion
- A PG deal (for PG campaigns)
- See Create a deal tutorial
About IQM campaigns
IQM's campaigns define the individual marketing strategies of your ads. By specifying the supported parameters, you can use the API to create a new campaign.
More resources
- Campaigns overview Help Center article
- Campaign API guidelines
- Create a campaign quickstart guide
- Create a PG campaign tutorial
- Upload a creative quickstart guide
- Create a conversion tutorial
- Create a deal tutorial
Create an insertion order
You can use IQM MCP to create and manage IOs by providing the required details and settings for each type.
| Prompt | Response example | Notes |
|---|---|---|
| Help me create a new insertion order | MCP prompts the user for the required details and settings for the new insertion order. | |
| Let's update that IO with a new name: IOQ2 | ||
| Show me a list of active IOs on this Workspace | MCP identifies IO status ID 1 as "active" and retrieves a filtered list. |
Create an Advanced campaign
You can also use IQM MCP to create an Advanced campaign by providing the required details and settings for the campaign.
| Prompt | Response example | Notes |
|---|---|---|
| Help me create a new Advanced campaign for insertion order "IOQ2" | MCP prompts the user for the required details and settings for the new Advanced campaign. | |
| Let's update that campaign with a few parameters: change included device types to IDs 13 and 15; add PMP deal ID 1757; and include Pixel conversion ID 6808 | ||
| Show me details for campaign 594029 |
Create a PG campaign
You can also use IQM MCP to create a PG campaign by providing the required details and settings for the campaign.
| Prompt | Response example | Notes |
|---|---|---|
| Help me create a new PG campaign | MCP prompts the user for the required details and settings for the new PG campaign. | |
| Let's update that PG campaign. I want to use a different creative. Also, rename it to "PG Campaign 2026 Q3" | MCP retrieves a list of available creatives and updates the PG campaign with the selected creative and new name. | |
| Show me a list of PG campaigns |
Manage campaign targeting
You can manage campaign targeting by providing the required details and settings for the campaign.
| Prompt | Response example | Notes |
|---|---|---|
| I want to update the audience targeting for each of the A1-A5 campaigns. Include audience 1140761 for targeting in each of those campaigns. Then include audiences 1140753 and 1140752 in campaigns A2 and A3 | MCP may try to edit each campaign in parallel. Try prompting to use the "audience targeting tool" to update audience targeting for multiple campaigns at once. | |
| Now I want to assign multiple PMP deals to campaigns A2, A3, and A5. Assign these deal IDs: 440, 119, and 1448 | MCP identifies one PMP deal as inaccessible to the user and updates with the two that are accessible. | |
| Now let's assign creatives 715867, 714974, and 714821 to campaigns A1, A3, and A5 | ||
| Now show me a list of the A campaigns we have just updated with their details in a table |
Tools index
The table below summarizes the tools that the MCP uses to perform the actions in this tutorial. Here you can also find links to the API documentation for each of those tools to learn more about their functionality and capabilities.
Insertion orders
| Tool name | Description | Documentation |
|---|---|---|
createCampaignIO | Create a new insertion order | Create an insertion order |
editIODetails | Update an existing insertion order | Update insertion order details |
getIOBasicDetailsList | List IOs with filters (status, budget type, owner) | Get insertion order details |
getBasicIODetailsById | Fetch one IO by ID | Get insertion order details by ID |
getIoMappedWithCampaignsDetails | List IOs with their attached campaigns | Get list of campaign details grouped by insertion order ID |
duplicateIO | Clone an existing IO | Duplicate an insertion order |
updateIOStatusToDelete | Soft-delete an IO | Delete an insertion order |
Advanced campaigns
| Tool name | Description | Documentation |
|---|---|---|
saveCampaign | Create an advanced campaign in pending status | Create new campaign |
saveDraftCampaign | Create an advanced campaign in draft status | |
editCampaignPatch | Update a campaign (auto-promotes draft to pending) | Update campaign |
editDraftCampaign | Update a draft campaign | |
duplicateCampaign | Clone an existing campaign | Duplicate campaigns |
updateCampaignStatus | Update a campaign's status | Update campaign status |
updateCampaignBudget | Update budgets without touching other fields | Change campaign budget |
PG campaigns
| Tool name | Description | Documentation |
|---|---|---|
addPGCampaign | Create a PG campaign | Create new PG campaign |
addDraftPGCampaign | Create a PG campaign in draft status | |
editPGCampaign | Update a PG campaign | Update PG campaign |
editDraftPGCampaign | Update a draft PG campaign |
Campaign details
| Tool name | Description | Documentation |
|---|---|---|
getCampaign | Fetch full details of one campaign | Get campaign details by ID |
getCampaignBasicDetailList | Paginated list with rich filters (type, status, IO, creative type) | Get basic details of campaigns |
getCampaignListData | Get a list of campaigns | Get list of campaigns |
getCampaignBudgetInfo | Get budget info and graph details for a campaign | Get campaign budget details |
getCostDetails | Get cost details for a campaign | Get campaign cost details |
Campaign targeting
| Tool name | Description | Documentation |
|---|---|---|
CampaignAudienceTargetingList | Bulk include/exclude/remove audiences across many campaigns (map-keyed by campaign ID) | Update audience targeting in campaigns |
createCampaignCreativeTargeting | Bulk assign/unassign creatives to campaigns | Update creative targeting in campaigns |
managePMPDealCampaignMappings | Bulk assign/de-assign PMP deals to campaigns | Assign PMP deals |
managePgDealCampaignMappings | Bulk assign/de-assign PG deals to campaigns | Assign PG deals |
includeExcludeInventoryGroup | Include or exclude campaigns from one or more inventory groups | Include/exclude campaigns from inventory groups |