Skip to main content
PATCH
/
api
/
v1
/
documents
/
{id}
/
fields
/
{fieldId}
Update a document field
curl --request PATCH \
  --url https://app.sajn.se/api/v1/documents/{id}/fields/{fieldId} \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '
{
  "type": "TEXT",
  "position": 123,
  "key": "<string>",
  "fieldMeta": "<unknown>"
}
'
{
  "message": "<string>"
}

Headers

authorization
string
required

Bearer token for API authentication

Path Parameters

id
string
required
fieldId
string
required

Body

application/json

Body

type
enum<string>

Field type

Available options:
TEXT,
HTML,
FORM,
PDF,
PRODUCT_TABLE,
TABLE
position
number

Field position/order

key
string

Unique key identifier for API access

Pattern: ^[a-z0-9_-]*$
fieldMeta
any

Field-specific metadata. For FORM subfield updates via key: prefix, pass the subfield metadata structure with properties like type and value (e.g., {"type": "input", "value": "new value"}).

Response

Error response

Error response

message
string
required

Error message describing what went wrong