Skip to Content

Replace form document fields

You're viewing API version 2026-09, which is deprecated and stops working on October 1, 2027. To move your integration, see Upgrading to 2026-10.
PUT
/api/v1/forms/{id}/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.

Authorization

headerAuthorizationBearer <token>

Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.

Path Parameters

id*string

Header Parameters

authorization*string

Bearer token for API authentication

Idempotency-Key?string

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.

Lengthlength <= 255

Request Body

Body

application/json
  1. body
fields*array<>
Itemsitems <= 500

Response Body

200

application/json
  1. response
fields*array<>

Fields in position order

Example Request
curl -X PUT 'https://app.sajn.se/api/v1/forms/string/document/fields' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "fields": [    {      "type": "TEXT",      "position": 0,      "fieldMeta": {        "type": "TEXT"      }    }  ]}'
Example Response
{  "fields": [    {      "id": "string",      "documentId": "string",      "templateId": "string",      "type": "TEXT",      "position": 0,      "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      },      "createdAt": null,      "updatedAt": null    }  ]}

Was this page helpful?