microCMS

DELETE /api/v2/media

This is the API for deleting media from the service.
It supports the deletion of both images and files.

Request Header

X-MICROCMS-API-KEY

This is the authentication key required for the request.
Please enable "Delete Media" permissions in the Management API and include it in the request header when sending.


cautionCaution

If the X-MICROCMS-API-KEY is identifiable, it may allow unauthorized manipulation of content by third parties. Please handle it with care. For more details, please refer to "API Key (API Authentication and Authorization Management)".

Query Parameters

This API allows you to specify parameters.

url

Specify the URL of the media you want to delete.

?url=https://images.microcms-assets.io/assets/xxxxx/yyyyy/hoge.jpg
?url=https://files.microcms-assets.io/assets/xxxxx/yyyyy/hoge.pdf
informationInformation

Request Body

Not needed.

Response

Status Code

If the content is successfully deleted, a 200 response will be returned.

informationInformation
  • Media referenced from the content cannot be deleted.

Response Body

If the content is successfully deleted, a response like the following will be returned.

{"id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}

id

This is the internal ID of the deleted media.