Skip to content

Document Verification

Every document signed through inSigner includes a SHA-256 hash for tamper detection. You can verify that a signed document is authentic and unmodified using the verification API.

  1. When a document is uploaded, inSigner computes its SHA-256 hash (the “original hash”).
  2. When signing is completed, inSigner computes the signed document hash (the “signed hash”).
  3. You can verify any PDF against these hashes via the API.
  1. Compute the SHA-256 hash of the file you want to verify.
  2. Send it to the verification API to check against inSigner records.
  3. Check the responseverified: true means the document is authentic.
Terminal window
# Compute the hash
SHA256=$(shasum -a 256 "Sales Agreement - Signed.pdf" | awk '{print $1}')
# Verify
curl -X POST https://app.insigner.co/api/v1/verify \
-H "Authorization: Bearer isk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"hash\": \"$SHA256\"}"

The hashMatch field tells you which version of the document was matched:

ValueMeaning
"original"The file matches the original PDF that was uploaded before signing
"signed"The file matches the completed signed PDF
nullNo match found
// In your document processing pipeline
async function processUploadedDocument(filePath) {
const result = await verifyDocument(filePath);
if (!result.verified) {
throw new Error('Document failed verification');
}
if (result.status !== 'completed') {
throw new Error(`Document is ${result.status}, not completed`);
}
// Document is verified and fully signed — safe to process
await archiveDocument(filePath, result);
}
import { readdir } from 'fs/promises';
import { join } from 'path';
async function verifyFolder(folderPath) {
const files = await readdir(folderPath);
const pdfs = files.filter(f => f.endsWith('.pdf'));
const results = await Promise.all(
pdfs.map(async (file) => {
const result = await verifyDocument(join(folderPath, file));
return { file, ...result };
})
);
const verified = results.filter(r => r.verified);
const failed = results.filter(r => !r.verified);
console.log(`Verified: ${verified.length}/${results.length}`);
if (failed.length > 0) {
console.log('Failed files:', failed.map(r => r.file));
}
}