Check a template's roles and fields
Runs the same check a save runs, and saves nothing. Send roles and
fields to check a change; leave either out to use what is stored.
Permission: signing:read @ workspace/{workspaceId}/signingTemplate/{signingTemplateId}
Authorization
ServiceAccountKey A service account API key, sent whole as a bearer token:
hsk_<40 hex>.hss_<64 hex>.
In: header
Path Parameters
The template to act on. IDs come from List templates.
Query Parameters
The workspace the template or document belongs to. Send it in the query string on every call, including the PDF upload. IDs come from List workspaces.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/signing/templates/RVeFlYdDGgoESUXespsR/check-layout?workspaceId=ws_a1b2c3" \ -H "Content-Type: application/json" \ -d '{}'{ "success": true, "ok": true, "errors": [ { "code": "string", "level": "error", "fieldId": "string", "roleId": "string", "otherFieldId": "string", "message": "string" } ], "warnings": [ { "code": "string", "level": "error", "fieldId": "string", "roleId": "string", "otherFieldId": "string", "message": "string" } ], "layoutVersion": 0}Copy a template POST
A new template with the same PDF, roles, fields and description. The PDF is copied file to file, so the copy has its own file. The original is not changed. | | The copy | | --- | --- | | `name` | Your `name`, or the original's name with " (copy)" | | `duplicatedFrom` | The original's `id` | | `layoutVersion` | Starts at 0 | | `previousPdfs` | Empty: that history belongs to the original | | `archivedAt` | `null`, even when the original is archived | An archived template can be copied, which is how an old layout comes back. **New wording, same layout, keep the old template.** Copy it, then [replace the copy's PDF](/docs/api-reference/signing/templates/replaceSigningTemplatePdf). The console's **Duplicate and replace** does exactly these two calls. **Permission:** `signing:read` @ `workspace/{workspaceId}/signingTemplate/{signingTemplateId}` and `signing:manage` @ `workspace/{workspaceId}`. Both are checked. #### Get the template ID first ```bash curl "$HOS_API/signing/templates?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" ``` #### Copy it ```bash curl -X POST "$HOS_API/signing/templates/tpl_a1b2c3/duplicate?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Service agreement 2027" }' ``` #### Replace the copy's PDF Use the `template.id` from the answer. ```bash curl -X POST "$HOS_API/signing/templates/tpl_d4e5f6/pdf?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" \ -F "[email protected]" ```
Get a template's layout version GET
The current `layoutVersion` and who made the last change, without the roles and fields. Ask it to learn that someone else saved. **Permission:** `signing:read` @ `workspace/{workspaceId}/signingTemplate/{signingTemplateId}`