Skip to main content

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:

  1. An account on the IQM platform
    • See Before you begin to create an account and request a Client ID and Client Secret
  2. An approved and running creative
  3. A conversion
  4. A PG deal (for PG campaigns)

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​

Create an insertion order​

You can use IQM MCP to create and manage IOs by providing the required details and settings for each type.

PromptResponse exampleNotes
Help me create a new insertion orderMCP 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 WorkspaceMCP 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.

PromptResponse exampleNotes
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.

PromptResponse exampleNotes
Help me create a new PG campaignMCP 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.

PromptResponse exampleNotes
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 A3MCP 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 1448MCP 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 nameDescriptionDocumentation
createCampaignIOCreate a new insertion orderCreate an insertion order
editIODetailsUpdate an existing insertion orderUpdate insertion order details
getIOBasicDetailsListList IOs with filters (status, budget type, owner)Get insertion order details
getBasicIODetailsByIdFetch one IO by IDGet insertion order details by ID
getIoMappedWithCampaignsDetailsList IOs with their attached campaignsGet list of campaign details grouped by insertion order ID
duplicateIOClone an existing IODuplicate an insertion order
updateIOStatusToDeleteSoft-delete an IODelete an insertion order

Advanced campaigns​

Tool nameDescriptionDocumentation
saveCampaignCreate an advanced campaign in pending statusCreate new campaign
saveDraftCampaignCreate an advanced campaign in draft status
editCampaignPatchUpdate a campaign (auto-promotes draft to pending)Update campaign
editDraftCampaignUpdate a draft campaign
duplicateCampaignClone an existing campaignDuplicate campaigns
updateCampaignStatusUpdate a campaign's statusUpdate campaign status
updateCampaignBudgetUpdate budgets without touching other fieldsChange campaign budget

PG campaigns​

Tool nameDescriptionDocumentation
addPGCampaignCreate a PG campaignCreate new PG campaign
addDraftPGCampaignCreate a PG campaign in draft status
editPGCampaignUpdate a PG campaignUpdate PG campaign
editDraftPGCampaignUpdate a draft PG campaign

Campaign details​

Tool nameDescriptionDocumentation
getCampaignFetch full details of one campaignGet campaign details by ID
getCampaignBasicDetailListPaginated list with rich filters (type, status, IO, creative type)Get basic details of campaigns
getCampaignListDataGet a list of campaignsGet list of campaigns
getCampaignBudgetInfoGet budget info and graph details for a campaignGet campaign budget details
getCostDetailsGet cost details for a campaignGet campaign cost details

Campaign targeting​

Tool nameDescriptionDocumentation
CampaignAudienceTargetingListBulk include/exclude/remove audiences across many campaigns (map-keyed by campaign ID)Update audience targeting in campaigns
createCampaignCreativeTargetingBulk assign/unassign creatives to campaignsUpdate creative targeting in campaigns
managePMPDealCampaignMappingsBulk assign/de-assign PMP deals to campaignsAssign PMP deals
managePgDealCampaignMappingsBulk assign/de-assign PG deals to campaignsAssign PG deals
includeExcludeInventoryGroupInclude or exclude campaigns from one or more inventory groupsInclude/exclude campaigns from inventory groups
Have a question?
Was this page helpful?