Use POST https://api.docuseal.com/submissions/pdf
API to create create a one-off submission request document from the given PDF with field text tags.
API request body should contain JSON payload with "file": '...'
encoded as base64 string value.
Learn more:
const docuseal = require('@docuseal/api');
const fs = require('fs')
const filePath = 'path/to/your/file.pdf';
const fileData = fs.readFileSync(filePath, { encoding: 'base64' });
docuseal.configure({ key: 'API_KEY', url: 'https://api.docuseal.com' });
const submission = await docuseal.createSubmissionFromPdf({
name: 'Rental Agreement',
documents: [
{
name: 'rental-agreement',
file: fileData
}
],
submitters: [
{
role: 'First Party',
email: '[email protected]'
}
]
});