Detect when a document is being processed / not available

I am using the API to create a list of filed documents for a company.

I would like to display a message similar to that on the Companies House website when a document is processing and not yet available: “This document is being processed and will be available in 5 days.”

What part of the API allows me to do this?

Thanks!

You will be looking for no document metadata, and ‘data.date’ < 5 days old.