> ## 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.

# Apply Ad Extension To Entities

> Attach EXISTING Microsoft Ads ad extensions to campaigns, ad groups or the whole account

Attach EXISTING Microsoft Ads ad extensions to campaigns, ad groups or the whole account. The create operations attach an extension as part of building it, so this is the only way to reuse one that already exists, such as putting a shared call extension on more campaigns. Works with every extension type. Note a campaign can hold only one call extension.

|                       |                                                |
| --------------------- | ---------------------------------------------- |
| **App**               | Microsoft Ads                                  |
| **Operation ID**      | `microsoft_ads_apply_ad_extension_to_entities` |
| **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 that owns the ad extension.                                                                                                                                                                   |
| `level`            | string or SelectableOption                                                | Yes      | -       | Where to attach the extension: 'ACCOUNT' applies it to every campaign, 'CAMPAIGN' to the campaigns listed below, 'AD\_GROUP' to the ad groups.                                                                                 |
| `ad_extension_ids` | array of string or SelectItem                                             | Yes      | -       | Existing ad extension IDs to attach. microsoft\_ads\_list\_ad\_extension\_associations returns the IDs already in use on the account. Any extension type works: call, sitelink, callout, image, price, promotion and the rest. |
| `campaign_ids`     | array of string or SelectItem                                             | No       | -       | Campaigns to attach the extension to. Required when level is CAMPAIGN.                                                                                                                                                         |
| `ad_group_ids`     | array of string or SelectItem                                             | No       | -       | Ad groups to attach the extension to. Required when level is AD\_GROUP.                                                                                                                                                        |

### 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. |

### SelectItem

| Field   | Type   | Required | Default | Description                                                                                          |
| ------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `value` | string | Yes      | -       | The value of the selectable item.                                                                    |
| `label` | string | Yes      | -       | The label of the selectable item, used for display purposes. If not provided, defaults to the value. |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `Dict`

Returns how many associations were created and where.

**Fields**: `applied_associations`, `ad_extension_ids`, `entity_ids`, `association_type`
