WhatsApp Cloud API - Media API | Developer Documentation
WhatsApp Cloud API - Media API
Copy for LLM
Version
Retrieve and delete uploaded media files by media ID.
Get media URLs with file metadata including size, MIME type, and SHA256 hash.
Media URLs are valid for 5 minutes after retrieval.
Base
|
|
Endpoints
GET
/{Version}/{Media-ID}
/{{Media-ID}}?phone_number_idRetrieve Media URLDelete MediaRequest Syntax
Select language
curl --request GET \ --url 'https://graph.facebook.com/{Version}/{Media-ID}' \ --header 'Authorization: Bearer <Token>' \ --header 'Content-Type: application/json' \ --data '{}'
Select status code
{ "Retrieve Media URL": { "value": { "file_size": "303833", "id": "2621233374848975", "messaging_product": "whatsapp", "mime_type": "image/jpeg", "sha256": "<HASH>", "url": "<URL>" } } }
/{{Media-ID}}?phone_number_idRetrieve Media URLDelete Mediacurl --request GET \ --url 'https://graph.facebook.com/{Version}/{Media-ID}' \ --header 'Authorization: Bearer <Token>' \ --header 'Content-Type: application/json' \ --data '{}'
{ "Retrieve Media URL": { "value": { "file_size": "303833", "id": "2621233374848975", "messaging_product": "whatsapp", "mime_type": "image/jpeg", "sha256": "<HASH>", "url": "<URL>" } } }
DELETE /{Version}/{Media-ID}
To delete media, make a DELETE call to the ID of the media you want to delete.
Prerequisites
Media object ID from either uploading media endpoint or media message Webhooks
Request
Syntax
curl --request DELETE \ --url 'https://graph.facebook.com/{Version}/{Media-ID}' \ --header 'Authorization: Bearer <Token>' \ --header 'Content-Type: application/json' \ --data '{}'
{ "Delete Media": { "value": { "success": true } } }
Responses
To delete media, make a DELETE call to the ID of the media you want to delete.
Prerequisites
Media object ID from either uploading media endpoint or media message Webhooks
200
Delete Media
Content Type: application/json
Schema: object
Show child attributes
successboolean
Select language
curl --request DELETE \ --url 'https://graph.facebook.com/{Version}/{Media-ID}' \ --header 'Authorization: Bearer <Token>' \ --header 'Content-Type: application/json' \ --data '{}'
Select status code
{ "Delete Media": { "value": { "success": true } } }
Authentication
Scheme
Type
Location
bearerAuth
HTTP Bearer
Header:
AuthorizationUsage Examples
bearerAuth:
Include
Authorization: Bearer your-token-here in request headersGlobal Authentication Requirements
All endpoints require:
bearerAuth