Create a new document
Create a new document in DRAFT status. You can optionally include parties, metadata, and responsible user during creation.
Document Types:
SIGNABLE(default) - Standard signing documentACCEPTABLE- Document that requires acceptance rather than signatureARCHIVE_IMPORTED- Imported from external archive
Template Support: Use templateId to create a document from a template. Template fields and template parties are automatically copied unless parties are explicitly provided in the request.
Responsible User: Use responsibleUserId to assign a specific team member as responsible for the document. Defaults to the creating user if not specified.
Adding Parties: Two approaches are supported:
- Contact-based (recommended): Provide
contactIdto reference existing contacts - automatically inherits all contact details - Manual: Provide
nameandemailto manually specify party details
Note: The legacy
signersfield is also accepted as input for backwards compatibility, but is deprecated and will stop working in API v2. Usepartiesgoing forward. If both are provided,partiestakes precedence.
Party Examples:
{
"parties": [
{
"contactId": "contact-123",
"role": "SIGNER",
"signingOrder": 1,
"deliveryMethod": "EMAIL",
"requiredSignature": "BANKID"
},
{
"name": "John Doe",
"email": "john@example.com",
"role": "SIGNER",
"signingOrder": 2,
"deliveryMethod": "SMS",
"requiredSignature": "DRAWING"
}
]
}
Per-Party Settings:
deliveryMethod- How to notify:EMAIL(default),SMS, orNONErequiredSignature- Signature type:DRAWING,BANKID, orCLICK_TO_SIGNtwoStepVerification- 2FA:NONE(default) orSMS_BEFORE_SIGNING
Complete Workflow with Templates:
- Create template (manually in dashboard) with FORM fields containing keys (e.g., “name”, “phone”, “email”)
- Create document from template (this endpoint) - include parties with their
deliveryMethodandrequiredSignaturesettings - Fill form fields using key-based updates:
PATCH /api/v1/documents/{docId}/fields/key:name - Add more parties if needed:
POST /api/v1/documents/{docId}/parties - Send for signing:
POST /api/v1/documents/{docId}/send
Note: Each party can have their own deliveryMethod (EMAIL, SMS, NONE) and requiredSignature (DRAWING, BANKID, CLICK_TO_SIGN) configured when adding them.
Example workflow:
# Step 1: Create document from template with parties
POST /api/v1/documents
{
"name": "Employment Contract",
"templateId": "template-id-with-form-fields",
"parties": [
{
"type": "contact",
"contactId": "contact-456",
"role": "SIGNER",
"deliveryMethod": "EMAIL",
"requiredSignature": "BANKID"
}
]
}
# Step 2: Fill form fields using keys
PATCH /api/v1/documents/{docId}/fields/key:name
{
"fieldMeta": {"type": "input", "value": "Andreas"}
}
PATCH /api/v1/documents/{docId}/fields/key:phone
{
"fieldMeta": {"type": "input", "value": "0767767712"}
}
# Step 3: Send for signing
POST /api/v1/documents/{docId}/send
{}
Response: Returns the created document ID, party IDs, tokens, and signing URLs for all added parties. The legacy signers field is also included in the response (same content as parties) for backwards compatibility, but is deprecated.
Documentation Index
Fetch the complete documentation index at: https://docs.sajn.se/llms.txt
Use this file to discover all available pages before exploring further.
Headers
Bearer token for API authentication
Body
Body
Document name/title
1[DEPRECATED — use parties instead, will be removed in API v2] Array of signers to add to the document during creation. If both signers and parties are provided, parties takes precedence.
- Option 1
- Option 2
Array of parties to add to the document during creation. Provide either contactId to reference existing contacts, or name and email to manually specify party details.
- Option 1
- Option 2
Your external reference ID for tracking this document
Expiration date for the document
Document type: SIGNABLE (default), ACCEPTABLE, or ARCHIVE_IMPORTED
SIGNABLE, ACCEPTABLE, ARCHIVE_IMPORTED Template ID to create document from. Template fields and template parties are copied by default.
User ID of the person responsible for this document. Must be a member of your organization. Defaults to the creating user.
Document metadata including subject, message, signing order, etc.
Document styling configuration including orientation, padding, background, and layout
Custom field values for the document
Response
200
Unique identifier for the created document
[DEPRECATED — use parties instead, will be removed in API v2] Array of created parties. Same content as parties.
Array of created parties. Use GET /documents/:id/parties/:partyId to retrieve signing URLs.
Your external reference ID
Document expiration date

