Delete media by media ID

Permanently deletes a media file from WhatsApp servers using the mediaId. Once deleted, the operation cannot be undone.

📘

Rate limit: 10 requests per hour

Request Parameters

Key

Description

Value

Data type

Required/Optional

Constraints

Authorization

Access Token for the application

{{PARTNER_APP_TOKEN}}

String

Required

Should be a valid Partner App Access Token

appId

App ID to fetch the access token

{{APP_ID}}

String

Required

  • The Id should be a valid app Id of Gupshup.
  • The App must be associated with the account that owns the PARTNER_APP_TOKEN being used

mediaId

Media ID of the media which is being deleted

{{MEDIA_ID}}

String

Required

Valid media ID associated with the given app ID

Sample Request

curl --location --request DELETE 'https://partner.gupshup.io/partner/app/{{APP_ID}}/media/{{MEDIA_ID}}' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}'

Sample Responses

Status Code

Response

Comments

Success

200

{ "message": "Media deleted successfully", "status": "success" }

Media successfully deleted from WhatsApp servers

Error

400

{ "message": "Failed to delete media", "status": "error" }

Bad Request - Invalid media ID or deletion failed

400

{ "message": "Delete media operations are temporarily blocked for this app due to previous errors. Please try again later.", "status": "error" }

Temporary block due to previous errors

500

{

"status": "error","message": "Internal Server Error"}

For any Internal Error

Language
Click Try It! to start a request and see the response here!