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

# Media updated

> Triggered when a media file is edited, replaced, or restored. The cdn_url stays the same while the file behind it changes.

Triggered when the file behind an existing media asset changes.

This event fires when:

* An image is edited with the built-in image editor (crop, rotate, circle)
* A media file is replaced with a new file
* A media file is restored to its original version

The `cdn_url` does not change when this happens. Pages that reference it
start serving the new file without any other signal, so subscribe to this
event if you rebuild a static site or purge a cache when content changes.

Editing an image from a content field, a page's media field, or a blog
post's featured image creates a new media asset and leaves the original
one untouched, so it does not fire this event.


## OpenAPI

````yaml /api/openapi/webhooks.yaml webhook media-updated
openapi: 3.1.0
info:
  title: ButterCMS Webhooks API
  version: 2.0.0
  description: >
    Webhook event notifications sent by ButterCMS when content changes occur in
    your account.
  contact:
    email: support@buttercms.com
  license:
    name: ButterCMS Terms of Service
    url: https://buttercms.com/terms/
servers:
  - url: https://api.buttercms.com/v2
    description: ButterCMS API v2
security: []
tags:
  - name: Page events
    description: >
      Webhook event notifications sent by ButterCMS when page content changes
      occur in your account.
  - name: Post events
    description: >
      Webhook event notifications sent by ButterCMS when blog post changes occur
      in your account.
  - name: Collection events
    description: >
      Webhook event notifications sent by ButterCMS when collection item changes
      occur in your account.
  - name: Media events
    description: >
      Webhook event notifications sent by ButterCMS when media changes occur in
      your account.
paths: {}

````