Skip to main content
PATCH
Add, update, or remove boxes on a PDF block

Authorizations

Authorization
string
header
required

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

Headers

Sajn-Version
enum<string>

API version for this request. Without it, the request uses the organization's default version; an organization without a default is pinned to the latest version by its first request.

Available options:
2026-09,
2026-10
Sajn-Workspace
string

ID of the workspace this request acts in, from GET /api/v1/workspaces. Without it, an API key acts in its default workspace. The token's user must be a member of the workspace; an OAuth token only accepts the workspace it was granted for. A workspace that doesn't exist or can't be reached returns 403 WORKSPACE_ACCESS_DENIED.

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.

Maximum string length: 255

Path Parameters

id
string
required

The document ID.

contentId
string
required

The content block ID.

Body

application/json

Body

upsert
object[]

Boxes to add or replace. A box whose id already exists on the field replaces that box and keeps its stacking order; any other box is added on top.

Maximum array length: 500

A box placed on a page of a PDF field

remove
string[]

Ids of boxes to remove from the field.

Maximum array length: 500
Minimum string length: 1

Response

200

id
string
required

Unique field identifier

documentId
string | null
required

Document this field belongs to

templateId
string | null
required

Template this field belongs to

type
enum<string>
required

Field type

Available options:
TEXT,
HTML,
FORM,
PDF,
PRODUCT_TABLE,
TABLE,
SPACER,
PAGE_BREAK,
DURATION
position
number
required

0-based order of the field among the document's content blocks

fieldMeta
object
required

Type-specific content. For PDF fields this includes placedFields (boxes placed on the PDF pages) and formFields (form fields extracted from the PDF).

createdAt
string<date-time> | null
required

Date and time when the field was created

updatedAt
string<date-time> | null
required

Date and time when the field was last updated