curl --request POST \
--url https://app.sajn.se/api/v1/documents/{id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"customMessage": "<string>",
"approverId": "<string>"
}
'import requests
url = "https://app.sajn.se/api/v1/documents/{id}/send"
payload = {
"customMessage": "<string>",
"approverId": "<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({customMessage: '<string>', approverId: '<string>'})
};
fetch('https://app.sajn.se/api/v1/documents/{id}/send', 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/{id}/send",
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([
'customMessage' => '<string>',
'approverId' => '<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/{id}/send"
payload := strings.NewReader("{\n \"customMessage\": \"<string>\",\n \"approverId\": \"<string>\"\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/{id}/send")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customMessage\": \"<string>\",\n \"approverId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents/{id}/send")
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 \"customMessage\": \"<string>\",\n \"approverId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"signingOrder": "PARALLEL",
"forceReadFullDocument": true,
"showChatToSigners": true,
"preferredLanguage": "sv",
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": true,
"internalRecipients": [
"<string>"
],
"signableAfterExpired": true,
"sendPlainTextEmailOnly": true,
"reminderIntervalDays": "<string>",
"allowDelegation": true,
"accessVerification": "NONE",
"aiChatEnabled": true,
"ssnDisplayMode": "FULL",
"sameDeviceSigning": true,
"documentCategoryId": "<string>"
},
"completedAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"signingOrder": "PARALLEL",
"forceReadFullDocument": true,
"showChatToSigners": true,
"preferredLanguage": "sv",
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": true,
"internalRecipients": [
"<string>"
],
"signableAfterExpired": true,
"sendPlainTextEmailOnly": true,
"reminderIntervalDays": "<string>",
"allowDelegation": true,
"accessVerification": "NONE",
"aiChatEnabled": true,
"ssnDisplayMode": "FULL",
"sameDeviceSigning": true,
"documentCategoryId": "<string>"
},
"completedAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}Send document for signing
Send a document to signers for signing.
Request Body:
customMessage(optional) - Custom message to include in the signing invitation emails/SMS. Supports newline characters (\n) for line breaks. Available template variables (use{{variableName}}syntax):{{firstName}},{{lastName}},{{fullName}},{{recipientFirstName}},{{recipientLastName}},{{recipientFullName}},{{recipientEmail}},{{recipientPhone}},{{recipientCompanyName}},{{recipientCompanyRole}},{{recipientCompanyOrgNumber}},{{recipientRole}},{{senderFirstName}},{{senderLastName}},{{senderFullName}},{{senderEmail}},{{senderCompanyName}},{{documentName}},{{documentId}},{{documentValue}},{{documentCreatedDate}},{{expirationDate}},{{signUrl}}. Custom fields are available as{{custom.<field-slug>}}using the slugified field name (e.g. “Avtalsdatum (demo)” becomes{{custom.avtalsdatum-demo}}); secured fields are excluded.approverId(optional) - User ID of the approver. Required if you lack the SEND_WITHOUT_APPROVAL permission. UseGET /api/v1/approversto list eligible approvers.
Prerequisites:
- Document must have at least one signer added via
POST /documents/{id}/signersor when creating the document - Each signer’s delivery method (
EMAIL,SMS, orNONE) and signature type (DRAWING,BANKID,CLICK_TO_SIGN) are configured per-signer when adding them
Responses:
- 200 - Document sent directly. Status changes from DRAFT to PENDING.
- 202 - Document submitted for approval. Status changes from DRAFT to PENDING_APPROVAL. The designated approver must approve before the document is sent.
- 403 with
code: "APPROVAL_REQUIRED"- You lack permission to send directly. Provide anapproverIdto submit for approval.
What happens when you send:
- Document status changes from
DRAFTtoPENDING - Signing invitations are sent to each signer based on their individual
deliveryMethodsetting - Signers with
deliveryMethod: NONEwon’t receive notifications - use their signing URLs directly
curl --request POST \
--url https://app.sajn.se/api/v1/documents/{id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"customMessage": "<string>",
"approverId": "<string>"
}
'import requests
url = "https://app.sajn.se/api/v1/documents/{id}/send"
payload = {
"customMessage": "<string>",
"approverId": "<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({customMessage: '<string>', approverId: '<string>'})
};
fetch('https://app.sajn.se/api/v1/documents/{id}/send', 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/{id}/send",
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([
'customMessage' => '<string>',
'approverId' => '<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/{id}/send"
payload := strings.NewReader("{\n \"customMessage\": \"<string>\",\n \"approverId\": \"<string>\"\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/{id}/send")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customMessage\": \"<string>\",\n \"approverId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents/{id}/send")
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 \"customMessage\": \"<string>\",\n \"approverId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"signingOrder": "PARALLEL",
"forceReadFullDocument": true,
"showChatToSigners": true,
"preferredLanguage": "sv",
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": true,
"internalRecipients": [
"<string>"
],
"signableAfterExpired": true,
"sendPlainTextEmailOnly": true,
"reminderIntervalDays": "<string>",
"allowDelegation": true,
"accessVerification": "NONE",
"aiChatEnabled": true,
"ssnDisplayMode": "FULL",
"sameDeviceSigning": true,
"documentCategoryId": "<string>"
},
"completedAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"documentMeta": {
"subject": "<string>",
"message": "<string>",
"signingOrder": "PARALLEL",
"forceReadFullDocument": true,
"showChatToSigners": true,
"preferredLanguage": "sv",
"value": "<string>",
"redirectUrl": "<string>",
"redirectEnabled": true,
"internalRecipients": [
"<string>"
],
"signableAfterExpired": true,
"sendPlainTextEmailOnly": true,
"reminderIntervalDays": "<string>",
"allowDelegation": true,
"accessVerification": "NONE",
"aiChatEnabled": true,
"ssnDisplayMode": "FULL",
"sameDeviceSigning": true,
"documentCategoryId": "<string>"
},
"completedAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}{
"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.
255Path Parameters
Body
Body
Send document for signing. If you lack permission to send directly, provide an approverId to submit for approval instead.
Optional custom message to include in the signing invitation. Supports newline characters (\n) for line breaks. Available template variables (use {{variableName}} syntax): {{firstName}}, {{lastName}}, {{fullName}}, {{recipientFirstName}}, {{recipientLastName}}, {{recipientFullName}}, {{recipientEmail}}, {{recipientPhone}}, {{recipientCompanyName}}, {{recipientCompanyRole}}, {{recipientCompanyOrgNumber}}, {{recipientRole}}, {{senderFirstName}}, {{senderLastName}}, {{senderFullName}}, {{senderEmail}}, {{senderCompanyName}}, {{documentName}}, {{documentId}}, {{documentValue}}, {{documentCreatedDate}}, {{expirationDate}}, {{signUrl}}. Custom fields are available as {{custom.}} using the slugified field name (e.g. "Avtalsdatum (demo)" becomes {{custom.avtalsdatum-demo}}); secured fields are excluded.
User ID of the approver. Required if you do not have SEND_WITHOUT_APPROVAL permission. Use GET /api/v1/approvers to list eligible approvers.
Response
200
Unique document identifier
Document name/title
Document status: DRAFT, SENDING, PENDING, COMPLETED, EXPIRED, CANCELLED, or IMPORTED
Date and time when the document was created
Date and time when the document was last updated
Your external reference ID for this document
Date and time when the document expires
Document metadata including subject, message, signing order, etc.
Show child attributes
Show child attributes
Date and time when all signers completed signing
Was this page helpful?

