curl --request POST \
--url https://app.sajn.se/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"name": "<string>",
"signers": [],
"parties": [],
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"templateId": "<string>",
"responsibleUserId": "<string>",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"forceReadFullDocument": true,
"showChatToSigners": true,
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": true,
"internalRecipients": [
"[email protected]"
],
"signableAfterExpired": true,
"sendPlainTextEmailOnly": true,
"reminderIntervalDays": "<string>",
"allowDelegation": true,
"aiChatEnabled": true,
"sameDeviceSigning": true,
"documentCategoryId": "<string>"
},
"documentStyle": {
"paddingEnabled": true,
"backgroundColor": "<string>",
"backgroundOpacity": 0.5,
"backgroundImageUrl": "<string>",
"backgroundImageOpacity": 0.5
},
"customFields": [
{
"customInputId": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://app.sajn.se/api/v1/documents"
payload = {
"name": "<string>",
"signers": [],
"parties": [],
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"templateId": "<string>",
"responsibleUserId": "<string>",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"forceReadFullDocument": True,
"showChatToSigners": True,
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": True,
"internalRecipients": ["[email protected]"],
"signableAfterExpired": True,
"sendPlainTextEmailOnly": True,
"reminderIntervalDays": "<string>",
"allowDelegation": True,
"aiChatEnabled": True,
"sameDeviceSigning": True,
"documentCategoryId": "<string>"
},
"documentStyle": {
"paddingEnabled": True,
"backgroundColor": "<string>",
"backgroundOpacity": 0.5,
"backgroundImageUrl": "<string>",
"backgroundImageOpacity": 0.5
},
"customFields": [
{
"customInputId": "<string>",
"value": "<string>"
}
]
}
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
authorization: '<authorization>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
signers: [],
parties: [],
externalId: '<string>',
expiresAt: '2023-11-07T05:31:56Z',
templateId: '<string>',
responsibleUserId: '<string>',
documentMeta: {
subject: '<string>',
message: '<string>',
forceReadFullDocument: true,
showChatToSigners: true,
value: '<string>',
redirectUrl: '<string>',
redirectEnabled: true,
internalRecipients: ['[email protected]'],
signableAfterExpired: true,
sendPlainTextEmailOnly: true,
reminderIntervalDays: '<string>',
allowDelegation: true,
aiChatEnabled: true,
sameDeviceSigning: true,
documentCategoryId: '<string>'
},
documentStyle: {
paddingEnabled: true,
backgroundColor: '<string>',
backgroundOpacity: 0.5,
backgroundImageUrl: '<string>',
backgroundImageOpacity: 0.5
},
customFields: [{customInputId: '<string>', value: '<string>'}]
})
};
fetch('https://app.sajn.se/api/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.sajn.se/api/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'signers' => [
],
'parties' => [
],
'externalId' => '<string>',
'expiresAt' => '2023-11-07T05:31:56Z',
'templateId' => '<string>',
'responsibleUserId' => '<string>',
'documentMeta' => [
'subject' => '<string>',
'message' => '<string>',
'forceReadFullDocument' => true,
'showChatToSigners' => true,
'value' => '<string>',
'redirectUrl' => '<string>',
'redirectEnabled' => true,
'internalRecipients' => [
'[email protected]'
],
'signableAfterExpired' => true,
'sendPlainTextEmailOnly' => true,
'reminderIntervalDays' => '<string>',
'allowDelegation' => true,
'aiChatEnabled' => true,
'sameDeviceSigning' => true,
'documentCategoryId' => '<string>'
],
'documentStyle' => [
'paddingEnabled' => true,
'backgroundColor' => '<string>',
'backgroundOpacity' => 0.5,
'backgroundImageUrl' => '<string>',
'backgroundImageOpacity' => 0.5
],
'customFields' => [
[
'customInputId' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sajn.se/api/v1/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"signers\": [],\n \"parties\": [],\n \"externalId\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"templateId\": \"<string>\",\n \"responsibleUserId\": \"<string>\",\n \"documentMeta\": {\n \"subject\": \"<string>\",\n \"message\": \"<string>\",\n \"forceReadFullDocument\": true,\n \"showChatToSigners\": true,\n \"value\": \"<string>\",\n \"redirectUrl\": \"<string>\",\n \"redirectEnabled\": true,\n \"internalRecipients\": [\n \"[email protected]\"\n ],\n \"signableAfterExpired\": true,\n \"sendPlainTextEmailOnly\": true,\n \"reminderIntervalDays\": \"<string>\",\n \"allowDelegation\": true,\n \"aiChatEnabled\": true,\n \"sameDeviceSigning\": true,\n \"documentCategoryId\": \"<string>\"\n },\n \"documentStyle\": {\n \"paddingEnabled\": true,\n \"backgroundColor\": \"<string>\",\n \"backgroundOpacity\": 0.5,\n \"backgroundImageUrl\": \"<string>\",\n \"backgroundImageOpacity\": 0.5\n },\n \"customFields\": [\n {\n \"customInputId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.sajn.se/api/v1/documents")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"signers\": [],\n \"parties\": [],\n \"externalId\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"templateId\": \"<string>\",\n \"responsibleUserId\": \"<string>\",\n \"documentMeta\": {\n \"subject\": \"<string>\",\n \"message\": \"<string>\",\n \"forceReadFullDocument\": true,\n \"showChatToSigners\": true,\n \"value\": \"<string>\",\n \"redirectUrl\": \"<string>\",\n \"redirectEnabled\": true,\n \"internalRecipients\": [\n \"[email protected]\"\n ],\n \"signableAfterExpired\": true,\n \"sendPlainTextEmailOnly\": true,\n \"reminderIntervalDays\": \"<string>\",\n \"allowDelegation\": true,\n \"aiChatEnabled\": true,\n \"sameDeviceSigning\": true,\n \"documentCategoryId\": \"<string>\"\n },\n \"documentStyle\": {\n \"paddingEnabled\": true,\n \"backgroundColor\": \"<string>\",\n \"backgroundOpacity\": 0.5,\n \"backgroundImageUrl\": \"<string>\",\n \"backgroundImageOpacity\": 0.5\n },\n \"customFields\": [\n {\n \"customInputId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"signers\": [],\n \"parties\": [],\n \"externalId\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"templateId\": \"<string>\",\n \"responsibleUserId\": \"<string>\",\n \"documentMeta\": {\n \"subject\": \"<string>\",\n \"message\": \"<string>\",\n \"forceReadFullDocument\": true,\n \"showChatToSigners\": true,\n \"value\": \"<string>\",\n \"redirectUrl\": \"<string>\",\n \"redirectEnabled\": true,\n \"internalRecipients\": [\n \"[email protected]\"\n ],\n \"signableAfterExpired\": true,\n \"sendPlainTextEmailOnly\": true,\n \"reminderIntervalDays\": \"<string>\",\n \"allowDelegation\": true,\n \"aiChatEnabled\": true,\n \"sameDeviceSigning\": true,\n \"documentCategoryId\": \"<string>\"\n },\n \"documentStyle\": {\n \"paddingEnabled\": true,\n \"backgroundColor\": \"<string>\",\n \"backgroundOpacity\": 0.5,\n \"backgroundImageUrl\": \"<string>\",\n \"backgroundImageOpacity\": 0.5\n },\n \"customFields\": [\n {\n \"customInputId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"documentId": "<string>",
"signers": [
{
"signerId": "<string>",
"name": "<string>",
"role": "SIGNER",
"type": "INDIVIDUAL",
"email": "[email protected]",
"signingOrder": 123,
"companyName": "<string>",
"companyRole": "<string>",
"companyOrgNumber": "<string>",
"country": "<string>",
"contactId": "<string>"
}
],
"parties": [
{
"signerId": "<string>",
"name": "<string>",
"role": "SIGNER",
"type": "INDIVIDUAL",
"email": "[email protected]",
"signingOrder": 123,
"companyName": "<string>",
"companyRole": "<string>",
"companyOrgNumber": "<string>",
"country": "<string>",
"contactId": "<string>"
}
],
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}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.
CRM Link: Use integrationLink to link the document to a CRM record (currently HubSpot deals). When the workspace has a field mapping configured for the integration, mapped custom fields and product-table rows are prefilled from the record, and signing status is written back to it. Explicit customFields in the request take precedence over prefilled values.
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": "[email protected]",
"role": "SIGNER",
"signingOrder": 2,
"deliveryMethod": "SMS",
"requiredSignature": "DRAWING"
}
]
}
Per-Party Settings:
deliveryMethod- How to notify:EMAIL(default),SMS, orNONErequiredSignature- Signature type:DRAWING,BANKID(Swedish BankID),CLICK_TO_SIGN,MANUAL, or a national eID scheme. eID schemes are switched on market by market — callGET /api/v1/helpers/signature-methodsfor the set your account can actually use rather than hard-coding a listtwoStepVerification- identity gate passed BEFORE the document opens:NONE(default),PIN_BEFORE_SIGNING,SMS_BEFORE_SIGNING,EMAIL_BEFORE_SIGNING, or an eID gate such asBANKID_BEFORE_SIGNING— callGET /api/v1/helpers/two-step-verificationsfor the live list
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.
curl --request POST \
--url https://app.sajn.se/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"name": "<string>",
"signers": [],
"parties": [],
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"templateId": "<string>",
"responsibleUserId": "<string>",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"forceReadFullDocument": true,
"showChatToSigners": true,
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": true,
"internalRecipients": [
"[email protected]"
],
"signableAfterExpired": true,
"sendPlainTextEmailOnly": true,
"reminderIntervalDays": "<string>",
"allowDelegation": true,
"aiChatEnabled": true,
"sameDeviceSigning": true,
"documentCategoryId": "<string>"
},
"documentStyle": {
"paddingEnabled": true,
"backgroundColor": "<string>",
"backgroundOpacity": 0.5,
"backgroundImageUrl": "<string>",
"backgroundImageOpacity": 0.5
},
"customFields": [
{
"customInputId": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://app.sajn.se/api/v1/documents"
payload = {
"name": "<string>",
"signers": [],
"parties": [],
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"templateId": "<string>",
"responsibleUserId": "<string>",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"forceReadFullDocument": True,
"showChatToSigners": True,
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": True,
"internalRecipients": ["[email protected]"],
"signableAfterExpired": True,
"sendPlainTextEmailOnly": True,
"reminderIntervalDays": "<string>",
"allowDelegation": True,
"aiChatEnabled": True,
"sameDeviceSigning": True,
"documentCategoryId": "<string>"
},
"documentStyle": {
"paddingEnabled": True,
"backgroundColor": "<string>",
"backgroundOpacity": 0.5,
"backgroundImageUrl": "<string>",
"backgroundImageOpacity": 0.5
},
"customFields": [
{
"customInputId": "<string>",
"value": "<string>"
}
]
}
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
authorization: '<authorization>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
signers: [],
parties: [],
externalId: '<string>',
expiresAt: '2023-11-07T05:31:56Z',
templateId: '<string>',
responsibleUserId: '<string>',
documentMeta: {
subject: '<string>',
message: '<string>',
forceReadFullDocument: true,
showChatToSigners: true,
value: '<string>',
redirectUrl: '<string>',
redirectEnabled: true,
internalRecipients: ['[email protected]'],
signableAfterExpired: true,
sendPlainTextEmailOnly: true,
reminderIntervalDays: '<string>',
allowDelegation: true,
aiChatEnabled: true,
sameDeviceSigning: true,
documentCategoryId: '<string>'
},
documentStyle: {
paddingEnabled: true,
backgroundColor: '<string>',
backgroundOpacity: 0.5,
backgroundImageUrl: '<string>',
backgroundImageOpacity: 0.5
},
customFields: [{customInputId: '<string>', value: '<string>'}]
})
};
fetch('https://app.sajn.se/api/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.sajn.se/api/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'signers' => [
],
'parties' => [
],
'externalId' => '<string>',
'expiresAt' => '2023-11-07T05:31:56Z',
'templateId' => '<string>',
'responsibleUserId' => '<string>',
'documentMeta' => [
'subject' => '<string>',
'message' => '<string>',
'forceReadFullDocument' => true,
'showChatToSigners' => true,
'value' => '<string>',
'redirectUrl' => '<string>',
'redirectEnabled' => true,
'internalRecipients' => [
'[email protected]'
],
'signableAfterExpired' => true,
'sendPlainTextEmailOnly' => true,
'reminderIntervalDays' => '<string>',
'allowDelegation' => true,
'aiChatEnabled' => true,
'sameDeviceSigning' => true,
'documentCategoryId' => '<string>'
],
'documentStyle' => [
'paddingEnabled' => true,
'backgroundColor' => '<string>',
'backgroundOpacity' => 0.5,
'backgroundImageUrl' => '<string>',
'backgroundImageOpacity' => 0.5
],
'customFields' => [
[
'customInputId' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sajn.se/api/v1/documents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"signers\": [],\n \"parties\": [],\n \"externalId\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"templateId\": \"<string>\",\n \"responsibleUserId\": \"<string>\",\n \"documentMeta\": {\n \"subject\": \"<string>\",\n \"message\": \"<string>\",\n \"forceReadFullDocument\": true,\n \"showChatToSigners\": true,\n \"value\": \"<string>\",\n \"redirectUrl\": \"<string>\",\n \"redirectEnabled\": true,\n \"internalRecipients\": [\n \"[email protected]\"\n ],\n \"signableAfterExpired\": true,\n \"sendPlainTextEmailOnly\": true,\n \"reminderIntervalDays\": \"<string>\",\n \"allowDelegation\": true,\n \"aiChatEnabled\": true,\n \"sameDeviceSigning\": true,\n \"documentCategoryId\": \"<string>\"\n },\n \"documentStyle\": {\n \"paddingEnabled\": true,\n \"backgroundColor\": \"<string>\",\n \"backgroundOpacity\": 0.5,\n \"backgroundImageUrl\": \"<string>\",\n \"backgroundImageOpacity\": 0.5\n },\n \"customFields\": [\n {\n \"customInputId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.sajn.se/api/v1/documents")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"signers\": [],\n \"parties\": [],\n \"externalId\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"templateId\": \"<string>\",\n \"responsibleUserId\": \"<string>\",\n \"documentMeta\": {\n \"subject\": \"<string>\",\n \"message\": \"<string>\",\n \"forceReadFullDocument\": true,\n \"showChatToSigners\": true,\n \"value\": \"<string>\",\n \"redirectUrl\": \"<string>\",\n \"redirectEnabled\": true,\n \"internalRecipients\": [\n \"[email protected]\"\n ],\n \"signableAfterExpired\": true,\n \"sendPlainTextEmailOnly\": true,\n \"reminderIntervalDays\": \"<string>\",\n \"allowDelegation\": true,\n \"aiChatEnabled\": true,\n \"sameDeviceSigning\": true,\n \"documentCategoryId\": \"<string>\"\n },\n \"documentStyle\": {\n \"paddingEnabled\": true,\n \"backgroundColor\": \"<string>\",\n \"backgroundOpacity\": 0.5,\n \"backgroundImageUrl\": \"<string>\",\n \"backgroundImageOpacity\": 0.5\n },\n \"customFields\": [\n {\n \"customInputId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"signers\": [],\n \"parties\": [],\n \"externalId\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"templateId\": \"<string>\",\n \"responsibleUserId\": \"<string>\",\n \"documentMeta\": {\n \"subject\": \"<string>\",\n \"message\": \"<string>\",\n \"forceReadFullDocument\": true,\n \"showChatToSigners\": true,\n \"value\": \"<string>\",\n \"redirectUrl\": \"<string>\",\n \"redirectEnabled\": true,\n \"internalRecipients\": [\n \"[email protected]\"\n ],\n \"signableAfterExpired\": true,\n \"sendPlainTextEmailOnly\": true,\n \"reminderIntervalDays\": \"<string>\",\n \"allowDelegation\": true,\n \"aiChatEnabled\": true,\n \"sameDeviceSigning\": true,\n \"documentCategoryId\": \"<string>\"\n },\n \"documentStyle\": {\n \"paddingEnabled\": true,\n \"backgroundColor\": \"<string>\",\n \"backgroundOpacity\": 0.5,\n \"backgroundImageUrl\": \"<string>\",\n \"backgroundImageOpacity\": 0.5\n },\n \"customFields\": [\n {\n \"customInputId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"documentId": "<string>",
"signers": [
{
"signerId": "<string>",
"name": "<string>",
"role": "SIGNER",
"type": "INDIVIDUAL",
"email": "[email protected]",
"signingOrder": 123,
"companyName": "<string>",
"companyRole": "<string>",
"companyOrgNumber": "<string>",
"country": "<string>",
"contactId": "<string>"
}
],
"parties": [
{
"signerId": "<string>",
"name": "<string>",
"role": "SIGNER",
"type": "INDIVIDUAL",
"email": "[email protected]",
"signingOrder": 123,
"companyName": "<string>",
"companyRole": "<string>",
"companyOrgNumber": "<string>",
"country": "<string>",
"contactId": "<string>"
}
],
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}Authorizations
OAuth 2.0 access token for a connected application. Limited to the scopes granted at consent.
Headers
Bearer token for API authentication
Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.
255Body
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
Show child attributes
Show child attributes
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
Show child attributes
Show child attributes
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.
Show child attributes
Show child attributes
Document styling configuration including orientation, padding, background, and layout
Show child attributes
Show child attributes
Custom field values for the document
Show child attributes
Show child attributes
Link the document to a CRM record. Prefills mapped custom fields and product tables from the record (configured under Integrations) and enables status write-back to it.
Show child attributes
Show child attributes
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.
Show child attributes
Show child attributes
Array of created parties. Use GET /documents/:id/parties/:partyId to retrieve signing URLs.
Show child attributes
Show child attributes
Your external reference ID
Document expiration date
Was this page helpful?

