Are Documents being deprecated?

How do I create a Document via script? (and add it to entity)
I don’t see a “createDocument” call in the API.