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

# Create Ad Extension

> Fallback Microsoft Ads ad extension create tool for types with no dedicated operation

Fallback Microsoft Ads ad extension create tool for types with no dedicated operation. Use this only when no focused operation covers the extension you need; if one exists, such as microsoft\_ads\_create\_sitelinks or microsoft\_ads\_create\_callouts, always use that dedicated operation instead. It takes a raw Microsoft ad extension object carrying a Type, which reaches the types that have no operation of their own: call, location, price, promotion, app, review, action, flyer, logo and filter link. Optionally attaches the new extension to campaigns or ad groups in the same run. The object is sent to Microsoft unchanged, so a rejection is Microsoft validating the payload rather than a Markifact fault: check the required fields for that extension type and fix the object.

|                       |                                     |
| --------------------- | ----------------------------------- |
| **App**               | Microsoft Ads                       |
| **Operation ID**      | `microsoft_ads_create_ad_extension` |
| **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 to create the ad extension in.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `extension`    | object or string                                                          | Yes      | -       | The ad extension object, as JSON, exactly as the Microsoft Advertising Campaign Management API version 13 defines it, sent unchanged to its AddAdExtensions operation. It must carry a Type naming one of: ActionAdExtension, AppAdExtension, CallAdExtension, CalloutAdExtension, FilterLinkAdExtension, FlyerAdExtension, ImageAdExtension, LocationAdExtension, LogoAdExtension, PriceAdExtension, PromotionAdExtension, ReviewAdExtension, SitelinkAdExtension, StructuredSnippetAdExtension. For example a call extension is \{"Type": "CallAdExtension", "CountryCode": "GB", "PhoneNumber": "01420 561661", "IsCallOnly": false}. The Type value is also the name of Microsoft's data object for that extension, so searching their Campaign Management reference for that name gives the exact fields and which are required. Id, Status and Version are set by Microsoft and are rejected on create. |
| `level`        | string or SelectableOption                                                | No       | -       | Optionally attach the new extension straight away: 'ACCOUNT', 'CAMPAIGN' or 'AD\_GROUP'. Leave empty to create it unattached and attach it later with microsoft\_ads\_apply\_ad\_extension\_to\_entities.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `campaign_ids` | array of string or SelectItem                                             | No       | -       | Campaigns to attach to. Required when level is CAMPAIGN.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `ad_group_ids` | array of string or SelectItem                                             | No       | -       | Ad groups to attach 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 the new extension ID and any associations made.

**Fields**: `ad_extension_id`, `type`, `level`, `entity_ids`, `associations_created`
