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

# List Media

> Lists the media in an X Ads account Media Library with their media_key values, so existing images and videos can be reused in posts and cards

Lists the media in an X Ads account Media Library with their media\_key values, so existing images and videos can be reused in posts and cards.

|                      |                    |
| -------------------- | ------------------ |
| **App**              | X Ads              |
| **Operation ID**     | `x_ads_list_media` |
| **Type**             | Action             |
| **Connection**       | `x_ads` (required) |
| **Credits per run**  | 1                  |
| **Agent / MCP tool** | Yes                |

## Inputs

| Field        | Type                           | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                     |
| ------------ | ------------------------------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account`    | DynamicAccount                 | Yes      | -       | Select the X Ads account whose Media Library should be listed.                                                                                                                                                                                                                                                                                                  |
| `media_type` | enum (`IMAGE`, `VIDEO`, `GIF`) | No       | -       | Only return media of this type: IMAGE, VIDEO, or GIF.                                                                                                                                                                                                                                                                                                           |
| `q`          | string                         | No       | -       | Search the name, title, file name and description fields (case-insensitive term matching).                                                                                                                                                                                                                                                                      |
| `filters`    | array of FilterItem            | No       | -       | Additional filters applied to the returned media. The available fields to filter by are: - media\_key: Filter by media key - name: Filter by name - file\_name: Filter by file name - media\_type: Filter by type (IMAGE, VIDEO, GIF) Filters are combined using AND logic. If you want to use OR logic, use relevant operators like REGEXP\_MATCH or IN\_LIST. |
| `limit`      | integer                        | No       | `100`   | Maximum number of media items to return. Default: 100.                                                                                                                                                                                                                                                                                                          |

### FilterItem

| Field      | Type                       | Required | Default | Description                                                                                                                                                   |
| ---------- | -------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `field`    | string or SelectableOption | Yes      | -       | The field to filter on, must be one of the current selected metrics or dimensions.                                                                            |
| `operator` | string                     | Yes      | -       | The operator to use for filtering. Must be one of the supported values. Use REGEXP\_MATCH to search/filter by multiple OR values like '.*(summer\|holiday).*' |
| `value`    | string                     | Yes      | -       | The value to filter by. Can be a string, number, regex, or a list of strings.                                                                                 |

### SelectableOption

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

## Output

**Type**: `List[Dict]`

Returns the list of media library items with full details.

**Fields**: dynamic (depend on the inputs)
