Download a template's PDF
The original PDF, as uploaded.
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.
Response Body
application/pdf
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/signing/templates/RVeFlYdDGgoESUXespsR/pdf?workspaceId=ws_a1b2c3""string"Change a template PUT
Changes the name, description, roles or fields. Send only what changes; `roles` and `fields` each replace the whole list. A template has 1 to 10 roles and up to 500 fields. Every field must point at a role in the template, sit on a page that exists, and fit inside the page. Documents already made from this template do not change. Send `baseVersion` (the template's `layoutVersion` when you read it) with `roles` or `fields`. If someone saved them since, nothing is saved and the answer is 409. A successful save returns `warnings`: things worth a look that did not stop the save. **Permission:** `signing:manage` @ `workspace/{workspaceId}/signingTemplate/{signingTemplateId}`
Replace a template's PDF POST
Puts a new PDF behind the same fields. Every field keeps its place on the page: positions are fractions of the page, so nothing is converted. The new file replaces the old one; only a note of the old file is kept (`previousPdfs`). The usual limits apply: 25 MB, 200 pages, no password. **Fields on pages the new file does not have.** If the new PDF has fewer pages and fields sit on the missing pages, send `missingPageFields`: `delete` removes them, `lastPage` moves them to the new last page at the same position (they can overlap boxes already there). Without it the answer is `409` with `needsChoice: true` and the `report`, and nothing is changed. A page that exists in both files but changed size is not refused. It is listed in `report.resizedPages`: check the fields there. Send `workspaceId` in the query string. Documents already made from this template keep their own copy and do not change. **What changes.** The file is overwritten at the same place, so the template's `id` and download link stay the same. `pdf` describes the new file. `layoutVersion` goes up by one, so an editor holding the old version gets a 409 on its next save and must read the template again. `previousPdfs` gains a note of the old file. Fields keep their `fieldId`, moved ones included. **Do it in this order.** Save your field changes first: the replace works on the saved fields. One replace runs at a time per template. HumaDocs never edits the text inside a PDF. Change the file elsewhere, then replace it. **Permission:** `signing:manage` @ `workspace/{workspaceId}/signingTemplate/{signingTemplateId}` #### Get the template ID first ```bash curl "$HOS_API/signing/templates?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" ``` #### Request ```bash curl -X POST "$HOS_API/signing/templates/tpl_a1b2c3/pdf?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" \ -F "[email protected]" ``` #### When the answer is 409 with `needsChoice` Send the same file again with the choice. Nothing changed the first time. ```bash curl -X POST "$HOS_API/signing/templates/tpl_a1b2c3/pdf?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" \ -F "[email protected]" \ -F "missingPageFields=lastPage" ``` After `lastPage`, `report.movedFieldIds` lists the fields to move off anything they now overlap.