# Media

> Upload media for sending and download inbound media by id. WhaBuzz never stores your bytes.

Canonical: https://docs.whabuzz.com/guides/media/

WhaBuzz never stores media. Uploads stream to Meta; downloads stream from Meta.

## Upload {#upload}

[`POST /v1/media`](https://docs.whabuzz.com/api/media.md#uploadMedia) is `multipart/form-data` with `file`, `type` (the file's MIME type) and `from` (your `phone_number_id`).

```bash
curl -X POST https://api.whabuzz.com/v1/media \
  -H "Authorization: Bearer $WHABUZZ_KEY" \
  -F from=1013622581841046 -F type=image/jpeg -F file=@invoice.jpg
# {"id":"1479537139182721"}
```

Use the id in a message: `{"type":"image","image":{"id":"1479537139182721"}}`. Meta's size and type limits apply and its errors pass through.

## Download inbound media {#download}

Inbound events carry a media `id`, not bytes. [`GET /v1/media/{media_id}?from=<phone_number_id>`](https://docs.whabuzz.com/api/media.md#downloadMedia) resolves Meta's temporary URL and streams the bytes back with the right `content-type`. Fetch promptly: Meta expires media about 30 days after receipt, and WhaBuzz caches only the resolved URL (a few minutes), never the file.

## Delete {#delete}

[`DELETE /v1/media/{media_id}`](https://docs.whabuzz.com/api/media.md#deleteMedia) deletes an upload from Meta.

## Template header media {#template-header}

Template header images, videos and documents use a different, resumable upload that produces a **handle** (not a media id). See [`POST /v1/templates/media-handle`](https://docs.whabuzz.com/api/templates.md#createTemplateMediaHandle) and [Templates](https://docs.whabuzz.com/guides/templates.md).
