> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Campaign Criteria

> Add, update or remove Microsoft Ads campaign criteria using native payloads, including location targeting, exclusions and ad schedules

Add, update or remove Microsoft Ads campaign criteria using native payloads, including location targeting, exclusions and ad schedules. Changing schedule days/hours requires explicit remove and add calls; no automatic rebuild is performed.

|                       |                                          |
| --------------------- | ---------------------------------------- |
| **App**               | Microsoft Ads                            |
| **Operation ID**      | `microsoft_ads_manage_campaign_criteria` |
| **Type**              | Action                                   |
| **Connection**        | `microsoft_ads` (required)               |
| **Credits per run**   | 1                                        |
| **Agent / MCP tool**  | Yes                                      |
| **Requires approval** | Yes (write operation)                    |

## Inputs

| Field              | Type                                                                      | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------ | ------------------------------------------------------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account`          | object or array of object or MicrosoftAdsAccountItem or string or integer | Yes      | -       | Select the Microsoft Ads account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `action`           | enum (`add`, `update`, `remove`)                                          | Yes      | -       | Add new campaign criteria, update existing criteria, or remove specified criterion IDs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `criteria_payload` | object or string                                                          | Yes      | -       | Native Microsoft Ads request body, as an object or JSON string, forwarded unchanged. Use CriterionType=Targets for locations, location intent, radii, day/time, age, gender and device mutations; use Audience for audience mutations or the appropriate native type for other criteria. Up to 100 criteria per request. Add a location: \{"CriterionType":"Targets","CampaignCriterions":\[\{"Type":"BiddableCampaignCriterion","CampaignId":123,"Criterion":\{"Type":"LocationCriterion","LocationId":456}}]}. To exclude a location use Type=NegativeCampaignCriterion. Update a bid adjustment: \{"CriterionType":"Targets","CampaignCriterions":\[\{"Type":"BiddableCampaignCriterion","CampaignId":123,"Id":789,"CriterionBid":\{"Type":"BidMultiplier","Multiplier":10}}]}. Remove: \{"CampaignId":123,"CampaignCriterionIds":\[789],"CriterionType":"Targets"}. Add/update rows include CampaignId; update rows also include Id. Ad schedules use DayTimeCriterion with Day, FromHour, FromMinute, ToHour and ToMinute. Changing schedule days/hours requires explicit remove then add calls; this operation does not rebuild criteria. Microsoft validates nested fields. |

### MicrosoftAdsAccountItem

| Field        | Type   | Required | Default | Description                                                                                                     |
| ------------ | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| `value`      | string | Yes      | -       |                                                                                                                 |
| `label`      | string | Yes      | -       |                                                                                                                 |
| `customerId` | string | No       | -       | The Microsoft Ads customer ID used for REST CustomerId headers. If omitted, it is resolved from the account ID. |

## Output

**Type**: `Dict`

Returns the native Microsoft mutation response, including created criterion IDs.
