Endpoint for creating a document