Document Templates

Replace template field positions

PUT/document-templates/{id}/positions

Replaces the template's whole set of placements with positions (empty clears it) and returns it ordered by page, y, then id. Keys are snake_case, including element_type, element_id and style; unknown or camelCase keys are 422 prohibited. Business rules (page bounds, DocuSign elements) are 422 on the field positions, rule invalid. Needs only the scope. dry_run previews it. Emits document_template.updated with changed_fields ["positions"] after commit, only when the set differs; no email. Sending the old set undoes it.

Path parameters

  • idstring (uuid)Required#

    The record's id.

Query parameters

  • dry_runboolean#

    Validate and run the call without committing it, returning what the real call would return with meta.dry_run set.

Headers

  • Idempotency-Keystring#

    Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.

Request body

application/json, required

{
  "positions": [
    {
      "reference": "full_name",
      "page": 1,
      "x": 120.5,
      "y": 640,
      "width": 200,
      "height": 24,
      "style": {
        "font_size": 11,
        "align": "L"
      }
    }
  ]
}

Responses

200

The template's placements after the replacement.

DocumentTemplatePosition[]
{
  "data": [
    {
      "id": 4183,
      "reference": "full_name",
      "kind": "field",
      "element_type": null,
      "element_id": null,
      "required": true,
      "conditions": [],
      "page": 1,
      "x": 120.5,
      "y": 640,
      "width": 200,
      "height": 24,
      "style": {
        "font_size": 11,
        "align": "L"
      }
    }
  ]
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X PUT https://your-org-domain/kong/core/api/v2/document-templates/{id}/positions\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "positions": [
    {
      "reference": "full_name",
      "page": 1,
      "x": 120.5,
      "y": 640,
      "width": 200,
      "height": 24,
      "style": {
        "font_size": 11,
        "align": "L"
      }
    }
  ]
}'