import Morphik from 'morphik';const client = new Morphik({ apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted});const document = await client.documents.updateFile('document_id', { file: fs.createReadStream('path/to/file'),});console.log(document.app_id);
Update a document by replacing its content with a new file.
POST
/
documents
/
{document_id}
/
update_file
JavaScript
Copy
Ask AI
import Morphik from 'morphik';const client = new Morphik({ apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted});const document = await client.documents.updateFile('document_id', { file: fs.createReadStream('path/to/file'),});console.log(document.app_id);