media_library

Delete one or more media library assets for a business. Assets are reusable image or video creatives at the business level, not Pins. At most 100 assets per request. Duplicate IDs in the same request are counted once, and an ID that is already deleted counts as a success. After a successful delete, GET for that asset_id returns 404.

Per-asset outcomes are reported in the response body, not in the HTTP status: an authorized, well-formed request returns 200 even when some or all of the requested assets were not deleted. Read status for the overall outcome and failures for the reason each asset was not deleted.

Access requires the token user to be the business owner or to have a Business Access role with media library edit access: Admin, Campaign Manager, or Profile Publisher.

delete/media_library/businesses/{business_id}/assets

Request

  • Base URL
    https://api.pinterest.com/v5
  • Auth
    OAuth 2
    Authorization codehttps://www.pinterest.com/oauth/
    Token URLhttps://api.pinterest.com/v5/oauth/token
    Scopesads:write

Path parameters

business_idstring required

Identifier of the business that owns the media library.

Query parameters

asset_idsPinterestLibIntegerFormatType[] required

IDs of the assets to delete. Between 1 and 100 ids may be deleted per request.

Response

The request has succeeded.

status'SUCCESS' | 'PARTIAL_SUCCESS' | 'ERROR' required

SUCCESS when every requested asset was deleted, PARTIAL_SUCCESS when only some were, ERROR when none were.

deleted_countinteger required

Number of assets that were successfully deleted. Already-deleted assets count as successes.

deleted_asset_idsPinterestLibIntegerFormatType[] required

IDs of the assets that were deleted.

failed_countinteger required

Number of assets that failed to delete.

Example response

{
  "deleted_count": 1,
  "deleted_asset_ids": [
    "1072720976992785066",
    "2859857184972667704"
  ],
  "failed_count": 1,
  "failures": [
    {
      "asset_id": "2859857184972667704",
      "error_code": "ASSET_NOT_FOUND",
      "message": "The requested asset was not found."
    }
  ]
}

Changes