Permit passing of document into api calls