curl --request PATCH \
--url https://app.sajn.se/api/v1/documents/{id}/field-values \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"values": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://app.sajn.se/api/v1/documents/{id}/field-values"
payload = { "values": [
{
"key": "<string>",
"value": "<string>"
}
] }
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
authorization: '<authorization>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({values: [{key: '<string>', value: '<string>'}]})
};
fetch('https://app.sajn.se/api/v1/documents/{id}/field-values', 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}/field-values",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'values' => [
[
'key' => '<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/{id}/field-values"
payload := strings.NewReader("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.sajn.se/api/v1/documents/{id}/field-values")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents/{id}/field-values")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"results": [
{
"key": "<string>",
"success": true,
"error": "<string>"
}
],
"remaining": [
"<string>"
],
"values": [
{
"key": "<string>",
"label": "<string>",
"kind": "form",
"fieldId": "<string>",
"type": "<string>",
"required": true,
"value": "<string>",
"filledBy": "sender",
"signerId": "<string>",
"options": [
"<string>"
]
}
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}Fill in values on a document
Fills in values by key, in one atomic request. The same request shape works for FORM subfields, AcroForm fields, and boxes placed on a PDF. Only documents with the status DRAFT or IMPORTED can be filled in.
Keys must match exactly. To find the keys, call GET /api/v1/documents/{id}/field-values. Set a key in the editor on a FORM subfield or a placed box, or send key when you create a placed box through the API, so that the key stays the same for every document created from a template.
The following example fills in a FORM subfield, a placed text box, and a PDF checkbox:
{
"values": [
{ "key": "customer-name", "value": "Example AB" },
{ "key": "org-number", "value": "556000-0000" },
{ "key": "accept-terms", "value": true }
]
}
A value fails, and the other values are still written, when its key doesn’t exist, when two fields share the key, when a party fills in the value at signing, or when the value doesn’t match the type or the allowed options. results lists the outcome for each key.
If another edit changes one of the fields while the request runs, nothing is written and the request fails with an HTTP 400 Bad Request status code. Send the request again.
curl --request PATCH \
--url https://app.sajn.se/api/v1/documents/{id}/field-values \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"values": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://app.sajn.se/api/v1/documents/{id}/field-values"
payload = { "values": [
{
"key": "<string>",
"value": "<string>"
}
] }
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
authorization: '<authorization>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({values: [{key: '<string>', value: '<string>'}]})
};
fetch('https://app.sajn.se/api/v1/documents/{id}/field-values', 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}/field-values",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'values' => [
[
'key' => '<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/{id}/field-values"
payload := strings.NewReader("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.sajn.se/api/v1/documents/{id}/field-values")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/documents/{id}/field-values")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"values\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"results": [
{
"key": "<string>",
"success": true,
"error": "<string>"
}
],
"remaining": [
"<string>"
],
"values": [
{
"key": "<string>",
"label": "<string>",
"kind": "form",
"fieldId": "<string>",
"type": "<string>",
"required": true,
"value": "<string>",
"filledBy": "sender",
"signerId": "<string>",
"options": [
"<string>"
]
}
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}Authorizations
Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.
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
The values to write, at most 100 per request.
1 - 100 elementsShow child attributes
Show child attributes
Response
200
True if every value was written; false otherwise.
One result per input value, in request order.
Show child attributes
Show child attributes
The keys of required sender values that are still empty.
Every value on the document after the write.
Show child attributes
Show child attributes
Was this page helpful?

