Skip to Content

Create a template field

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.
POST
/api/v1/templates/{id}/fields

Add a field/section to a template. Same semantics as createField on documents — can create single field or multiple fields at once.

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
type*string
Value in"TEXT""HTML""FORM""PDF""PRODUCT_TABLE""TABLE""SPACER""PAGE_BREAK""DURATION"
position*integer
Range0 <= value <= 9007199254740991
key?string
Match^[a-z0-9_-]*$
fieldMeta*||||||||

Response Body

Error response

application/json
  1. response

Error response

message*string

Error message describing what went wrong

code?string

Machine-readable error code (e.g. APPROVAL_REQUIRED)

errorId?string

Identifier for this occurrence — quote it to support when reporting a 500

issues?array<>

Every validation issue, on a 400 for an invalid request

requiredScopes?array<string>

OAuth scopes the endpoint requires, on a 403 for a missing scope

grantedScopes?array<string>

OAuth scopes the token was granted, on a 403 for a missing scope

Example Request
curl -X POST 'https://app.sajn.se/api/v1/templates/string/fields' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "type": "TEXT",  "position": 0,  "fieldMeta": {    "type": "TEXT"  }}'
Example Response
{  "message": "string",  "code": "string",  "errorId": "string",  "issues": [    {      "path": "string",      "message": "string"    }  ],  "requiredScopes": [    "string"  ],  "grantedScopes": [    "string"  ]}

Was this page helpful?