curl --request DELETE \
--url https://app.sajn.se/api/v1/documents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'authorization: <authorization>'import requests
url = "https://app.sajn.se/api/v1/documents/{id}"
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {authorization: '<authorization>', Authorization: 'Bearer <token>'}
};
fetch('https://app.sajn.se/api/v1/documents/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://app.sajn.se/api/v1/documents/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.sajn.se/api/v1/documents/{id}")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
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"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>"
}Delete a document
Move a document to the trash. It is marked as deleted but not yet removed — restore it, or let the workspace’s trash window purge it.
Works for every status, including COMPLETED. You are the controller of your data; deciding when a signed agreement goes is your call.
Note: Deleted documents are not included in list responses but can still be retrieved by ID.
To remove a document immediately and irreversibly, use POST /api/v1/documents/{id}/purge.
curl --request DELETE \
--url https://app.sajn.se/api/v1/documents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'authorization: <authorization>'import requests
url = "https://app.sajn.se/api/v1/documents/{id}"
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {authorization: '<authorization>', Authorization: 'Bearer <token>'}
};
fetch('https://app.sajn.se/api/v1/documents/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://app.sajn.se/api/v1/documents/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.sajn.se/api/v1/documents/{id}")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
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"
}{
"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
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?

