Skip to main content

Documents

Documents are the core of sajn. They represent contracts, agreements, or any other documents that need to be signed.

Document Lifecycle

A document goes through several stages:

Document Statuses

StatusDescription
DRAFTDocument is being prepared, not yet sent
SENDINGDocument is being sent to signers
PENDINGDocument sent, awaiting signatures
COMPLETEDAll signers have signed
EXPIREDDocument expired before all signatures collected
CANCELLEDDocument was cancelled
IMPORTEDDocument imported from external archive

Document Types

sajn supports different document types:

SIGNABLE (Default)

Standard documents that require signatures from one or more signers.
{
  "name": "Employment Contract",
  "type": "SIGNABLE"
}

ACCEPTABLE

Documents that require acceptance rather than a signature, useful for terms of service or policies.
{
  "name": "Terms of Service",
  "type": "ACCEPTABLE"
}

ARCHIVE_IMPORTED

Documents imported from external systems for archival purposes.

Document Metadata

Documents can have rich metadata to control the signing process:
{
  "documentMeta": {
    "subject": "Please sign the employment contract",
    "message": "Welcome to the team! Please review and sign.",
    "signingOrder": "SEQUENTIAL",
    "defaultSignatureType": "DRAWING",
    "distributionMethod": "EMAIL",
    "forceReadFullDocument": true,
    "showCommentsToSigners": false,
    "preferredLanguage": "sv",
    "validFrom": "2024-01-01T00:00:00Z",
    "validTo": "2024-12-31T23:59:59Z",
    "value": "500000"
  }
}

Key Metadata Fields

PARALLEL: All signers can sign simultaneously SEQUENTIAL: Signers must sign in order (1, 2, 3, etc.)
EMAIL: Send via email SMS: Send via SMS NONE: Don’t send automatically (use signing URLs directly)
DRAWING: Free-hand signature BANKID: Swedish BankID electronic signature MANUAL: Manual signature (for in-person signing)
When true, signers must scroll through the entire document before signing.

Document Fields

Documents can contain different types of fields:
  • TEXT: Rich text content sections
  • FORM: Form fields for signers to fill out
  • PDF: Embedded PDF files
  • PRODUCT_TABLE: Tables with products/services and pricing
Learn more in the Document Fields API reference.

Tags and Organization

Organize documents using:
  • Tags: Categorize documents (e.g., “Contract”, “NDA”, “Employment”)
  • Custom Fields: Add structured metadata (e.g., project name, department)
  • External ID: Link to your own system’s identifiers

Expiration

Set an expiration date to automatically expire documents that aren’t completed in time:
{
  "expiresAt": "2024-12-31T23:59:59Z"
}
When a document expires, its status changes to EXPIRED and signers can no longer access it.

Best Practices

Clear Naming

Use descriptive document names that clearly identify the content and purpose.

Appropriate Expiration

Set reasonable expiration dates - typically 7-30 days for most documents.

Sequential When Needed

Use sequential signing when the order matters (e.g., manager approval before employee signature).

External IDs

Use external IDs to link documents to records in your own systems.

Next Steps

I