Retrieve the full signature chain for a document, showing its signing history from original to latest version.
Get Signature Chain
Endpoint: GET /api/sdk/v1/documents/:id/signature-chain
| Parameter | Type | Required | Description |
|---|
documentId | string | Yes | The document identifier |
Response (SignatureChain)
| Field | Type | Description |
|---|
originalDocumentId | string | ID of the original (first) document |
chainLength | number | Total documents in the chain |
documents | SignatureChainDocument[] | Ordered array of chain documents |
Chain Document Fields (SignatureChainDocument)
| Field | Type | Description |
|---|
id | string | Document ID |
name | string | Document name |
isSigned | boolean | Whether this version is signed |
signatureType | SignatureType? | Type of signature applied ('SIMPLE', 'ADVANCE', 'AES') |
signature | object? | Signature details (signedAt, certificateId, isPadesCompliant) |
signatureChainOrder | number | Position in the chain (0-based) |
isLatestVersion | boolean | Whether this is the most recent version |
parentDocumentId | string | null | ID of the parent document in chain |
originalDocumentId | string | null | ID of the original document |
createdAt | string | ISO 8601 creation timestamp |
Signature Types
| Type | Description |
|---|
'SIMPLE' | Simple electronic signature |
'ADVANCE' | Advanced electronic signature |
'AES' | Advanced Electronic Signature (qualified) |
Example
const chain = await sdk.documents.getSignatureChain('doc_abc123');
console.log(`Chain has ${chain.chainLength} versions`);
console.log(`Original document: ${chain.originalDocumentId}`);
for (const doc of chain.documents) {
const status = doc.isSigned ? `Signed (${doc.signatureType})` : 'Unsigned';
const latest = doc.isLatestVersion ? ' [LATEST]' : '';
console.log(` #${doc.signatureChainOrder}: ${doc.name} — ${status}${latest}`);