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

# Upload Media

> Uploads a single image or video to a Meta ad account and returns its media reference (image_hash for images, video_id & auto-generated thumbnail_url for videos)

Uploads a single image or video to a Meta ad account and returns its media reference (image\_hash for images, video\_id & auto-generated thumbnail\_url for videos). Use this for edge cases where you need media reference to embed in a creative payload (for example with meta\_ads\_create\_ad\_creative). For creating a full ad with new media, prefer dedicated operations such as meta\_ads\_create\_single\_image\_ad.

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

## Inputs

| Field       | Type           | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                |
| ----------- | -------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `account`   | DynamicAccount | Yes      | -       | Ad account to upload the media into. Accepts an account ID with or without the 'act\_' prefix (for example 'act\_1234567890' or '1234567890')                                                                                                                                                                                                                                              |
| `image_url` | string         | No       | -       | Image to upload. Accepts a direct image URL or a Google Drive share link (set to 'Anyone with the link'); Markifact resolves it automatically. Provide either image\_url or video\_url, not both. Returns an image\_hash to use in an ad creative.                                                                                                                                         |
| `video_url` | string         | No       | -       | Video to upload. Accepts a direct video URL or a Google Drive share link (set to 'Anyone with the link'); Markifact resolves it automatically. Provide either image\_url or video\_url, not both. Returns a video\_id plus an auto-generated thumbnail\_url (a video creative's video\_data needs both: video\_id and image\_url). Note: video upload waits for Meta to finish processing. |

## Output

**Type**: `Dict`

Returns the uploaded media reference (image\_hash for images; video\_id plus an auto-generated thumbnail\_url for videos).

**Fields**: `account_id`, `media_type`, `image_hash`, `video_id`, `thumbnail_url`
