curl --request PUT \
--url https://app.sajn.se/api/v1/forms/{id}/document/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"fields": [
{
"position": 4503599627370495,
"fieldMeta": {
"type": "TEXT",
"content": "<string>",
"locked": true,
"sectionStyle": {
"bleed": true,
"border": true
},
"hidden": true
},
"id": "<string>"
}
]
}
'import requests
url = "https://app.sajn.se/api/v1/forms/{id}/document/fields"
payload = { "fields": [
{
"position": 4503599627370495,
"fieldMeta": {
"type": "TEXT",
"content": "<string>",
"locked": True,
"sectionStyle": {
"bleed": True,
"border": True
},
"hidden": True
},
"id": "<string>"
}
] }
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
authorization: '<authorization>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fields: [
{
position: 4503599627370495,
fieldMeta: {
type: 'TEXT',
content: '<string>',
locked: true,
sectionStyle: {bleed: true, border: true},
hidden: true
},
id: '<string>'
}
]
})
};
fetch('https://app.sajn.se/api/v1/forms/{id}/document/fields', 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/forms/{id}/document/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
[
'position' => 4503599627370495,
'fieldMeta' => [
'type' => 'TEXT',
'content' => '<string>',
'locked' => true,
'sectionStyle' => [
'bleed' => true,
'border' => true
],
'hidden' => true
],
'id' => '<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/forms/{id}/document/fields"
payload := strings.NewReader("{\n \"fields\": [\n {\n \"position\": 4503599627370495,\n \"fieldMeta\": {\n \"type\": \"TEXT\",\n \"content\": \"<string>\",\n \"locked\": true,\n \"sectionStyle\": {\n \"bleed\": true,\n \"border\": true\n },\n \"hidden\": true\n },\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.sajn.se/api/v1/forms/{id}/document/fields")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": [\n {\n \"position\": 4503599627370495,\n \"fieldMeta\": {\n \"type\": \"TEXT\",\n \"content\": \"<string>\",\n \"locked\": true,\n \"sectionStyle\": {\n \"bleed\": true,\n \"border\": true\n },\n \"hidden\": true\n },\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/forms/{id}/document/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": [\n {\n \"position\": 4503599627370495,\n \"fieldMeta\": {\n \"type\": \"TEXT\",\n \"content\": \"<string>\",\n \"locked\": true,\n \"sectionStyle\": {\n \"bleed\": true,\n \"border\": true\n },\n \"hidden\": true\n },\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"fields": [
{
"id": "<string>",
"type": "TEXT",
"position": 123,
"fieldMeta": {
"type": "TEXT",
"content": "<string>",
"locked": true,
"sectionStyle": {
"background": "none",
"padding": "none",
"bleed": true,
"border": true
},
"visibilityRule": {
"customInputId": "<string>",
"equals": "<string>",
"mode": "SHOW_WHEN"
},
"hidden": true
},
"documentId": "<string>",
"templateId": "<string>",
"createdAt": null,
"updatedAt": null
}
]
}{
"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>"
]
}{
"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>"
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}Replace form document fields
Replace the complete ordered list of content blocks. Include existing IDs to retain fields; omit an ID to create a field. Missing fields are deleted. Existing field types cannot change. PDF ownership, metadata and section locks are validated. Read the form again to discover bindable keys and configure questions. Requires forms:write and documents:write, including for drafts.
curl --request PUT \
--url https://app.sajn.se/api/v1/forms/{id}/document/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"fields": [
{
"position": 4503599627370495,
"fieldMeta": {
"type": "TEXT",
"content": "<string>",
"locked": true,
"sectionStyle": {
"bleed": true,
"border": true
},
"hidden": true
},
"id": "<string>"
}
]
}
'import requests
url = "https://app.sajn.se/api/v1/forms/{id}/document/fields"
payload = { "fields": [
{
"position": 4503599627370495,
"fieldMeta": {
"type": "TEXT",
"content": "<string>",
"locked": True,
"sectionStyle": {
"bleed": True,
"border": True
},
"hidden": True
},
"id": "<string>"
}
] }
headers = {
"authorization": "<authorization>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
authorization: '<authorization>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fields: [
{
position: 4503599627370495,
fieldMeta: {
type: 'TEXT',
content: '<string>',
locked: true,
sectionStyle: {bleed: true, border: true},
hidden: true
},
id: '<string>'
}
]
})
};
fetch('https://app.sajn.se/api/v1/forms/{id}/document/fields', 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/forms/{id}/document/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
[
'position' => 4503599627370495,
'fieldMeta' => [
'type' => 'TEXT',
'content' => '<string>',
'locked' => true,
'sectionStyle' => [
'bleed' => true,
'border' => true
],
'hidden' => true
],
'id' => '<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/forms/{id}/document/fields"
payload := strings.NewReader("{\n \"fields\": [\n {\n \"position\": 4503599627370495,\n \"fieldMeta\": {\n \"type\": \"TEXT\",\n \"content\": \"<string>\",\n \"locked\": true,\n \"sectionStyle\": {\n \"bleed\": true,\n \"border\": true\n },\n \"hidden\": true\n },\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.sajn.se/api/v1/forms/{id}/document/fields")
.header("authorization", "<authorization>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": [\n {\n \"position\": 4503599627370495,\n \"fieldMeta\": {\n \"type\": \"TEXT\",\n \"content\": \"<string>\",\n \"locked\": true,\n \"sectionStyle\": {\n \"bleed\": true,\n \"border\": true\n },\n \"hidden\": true\n },\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/forms/{id}/document/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["authorization"] = '<authorization>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": [\n {\n \"position\": 4503599627370495,\n \"fieldMeta\": {\n \"type\": \"TEXT\",\n \"content\": \"<string>\",\n \"locked\": true,\n \"sectionStyle\": {\n \"bleed\": true,\n \"border\": true\n },\n \"hidden\": true\n },\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"fields": [
{
"id": "<string>",
"type": "TEXT",
"position": 123,
"fieldMeta": {
"type": "TEXT",
"content": "<string>",
"locked": true,
"sectionStyle": {
"background": "none",
"padding": "none",
"bleed": true,
"border": true
},
"visibilityRule": {
"customInputId": "<string>",
"equals": "<string>",
"mode": "SHOW_WHEN"
},
"hidden": true
},
"documentId": "<string>",
"templateId": "<string>",
"createdAt": null,
"updatedAt": null
}
]
}{
"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>"
]
}{
"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>"
]
}{
"message": "<string>",
"code": "<string>",
"errorId": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"requiredScopes": [
"<string>"
],
"grantedScopes": [
"<string>"
]
}2026-09, which is deprecated and stops working on October 1, 2027. To see the current version, select 2026-10 in the menu at the top of the sidebar. To move your integration, see Upgrading to 2026-10.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
500Show child attributes
Show child attributes
Response
200
Fields in position order
Show child attributes
Show child attributes
Was this page helpful?

