Devtechify
WhatsApp API

WhatsApp Data Privacy: Why We Delete Media Files Every Night

KarthikFounder & Full-Stack Engineer4 min read

A customer sends your support number a photo of their Aadhaar card, because the form asked for proof and they didn't know where else to put it. Now it's on your server. Nobody asked for it to be there, nobody has decided how long it stays, and next year nobody will remember it exists.

That small moment is why WA Getway deletes downloaded media files automatically every night. It's one of the less glamorous things we built, and one of the ones we'd defend the loudest.

What 'media' means in a gateway

When a customer sends a photo, document, voice note or video, a gateway often has to download it so your system can use it. That file now sits on storage you pay for, backed up, possibly copied, and quietly growing.

Text messages are small. Media is where the volume, and the sensitive material, accumulates. Photos of ID cards, bank statements, prescriptions, damaged products, children in school uniforms. None of that is what you wanted to collect when you set up a WhatsApp number, but all of it arrives anyway.

Why nightly deletion is a design choice, not a limitation

We could have kept every file forever. It's easier, nobody complains about missing data, and storage is cheap. But easy storage is exactly how businesses end up holding thousands of sensitive files they never intended to keep.

Deleting downloaded media nightly means the gateway acts as a pass-through, not an archive. If your system needs a file, it should fetch it and store it where you can actually control it: your own storage, with your own access rules and your own retention policy.

The trade-off is real, and we'd rather say it plainly. If you assume the gateway is your document store, you'll lose files. Build your workflow so that anything you need is copied out promptly.

What this means for how you build

  1. 1Decide which incoming files you actually need. A complaint photo, yes. A random forwarded video, no.
  2. 2Have your system fetch and save the file soon after it arrives, well before the nightly clean-up.
  3. 3Store it in your own system with access limited to the people who need it.
  4. 4Record why you kept it and for how long.
  5. 5Delete it from your own storage when that period ends.

If you use webhooks to be told when a message arrives, which our explainer on WhatsApp webhooks describes in plain language, that webhook is the natural moment to pick up the file.

Good privacy habits beyond the gateway

  • Tell customers what you do with what they send. A single line in your welcome message is enough.
  • Ask for the least you need. If a clinic only needs the prescription, don't accept the full file with the patient's address on it.
  • Keep API keys out of shared documents and chat groups. See how to keep API keys safe.
  • Give team members only the access they need, and remove it when they leave.
  • Honour opt-outs fast. Our post on handling STOP requests describes the basics.
Do not collect what you cannot protect

If you wouldn't be comfortable explaining to a customer how long you kept their document and who could see it, don't ask them to send it over WhatsApp in the first place.

The legal side, honestly

India's data protection rules have been evolving, and what applies to your business depends on what you collect and how. We're a software studio, not a law firm. Ask your lawyer or compliance adviser what obligations you have around consent, retention and customer rights, and don't treat our design choices as legal advice.

What we can say is that less data held means less data that can leak, be subpoenaed in a dispute or be misused by someone with access they shouldn't have. That's true under any legal regime.

A short audit you can do this week

Open your WhatsApp number and scroll through the last month of incoming media. Ask yourself three things. Did we need this? Where is it stored now? Who can open it? Most businesses are surprised by at least one answer.

Then check your gateway and the phones involved. Where does downloaded media go, how long does it stay, and does anybody have a backup of it that nobody remembers? Phone backups to a personal cloud account are a common leak.

If you're building something on WhatsApp that handles sensitive documents, such as insurance, healthcare or lending, talk to us early through our contact page. It's much cheaper to design the retention and access rules first than to retrofit them after a few thousand files have piled up.

data privacymedia retentionsecurityWA Getway

Talk to us

Have a project in mind? Tell us about it.

Four quick questions and we'll reply within one business day with an honest view on the fastest way to ship it, whether that's our own products, a custom build or an integration.

DevTechify

Start your project

Let’s build something great

1
2
3
4

Which industry does your business belong to?

Pick the closest match — we'll tailor the rest for you.