Upload a PDF as a new template
Makes a template from one PDF, with no roles or fields yet. Add them with Change a template.
The PDF can be up to 25 MB and 200 pages. A password protected PDF is refused. To put a different file behind the same fields later, use Replace a template's PDF.
Send workspaceId in the query string. A workspaceId placed only in the
form fields is not read.
Permission: signing:manage @ workspace/{workspaceId}
Request
curl -X POST "$HOS_API/signing/templates?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" \ -F "[email protected]" \ -F "name=Service agreement"Authorization
ServiceAccountKey A service account API key, sent whole as a bearer token:
hsk_<40 hex>.hss_<64 hex>.
In: header
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
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/signing/templates?workspaceId=ws_a1b2c3" \ -F file="string" \ -F name="string"{ "success": true, "template": { "id": "string", "name": "string", "description": "string", "pdf": { "fileName": "string", "pageCount": 0, "pageSizes": [ { "w": 0, "h": 0 } ], "sha256": "string", "md5": "string", "bytes": 0 }, "roles": [ { "roleId": "client", "label": "Client", "order": 1 } ], "fields": [ { "fieldId": "client_sig", "roleId": "client", "type": "signature", "label": "string", "required": true, "page": 0, "x": 0, "y": 0, "w": 0, "h": 0 } ], "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archivedAt": "2019-08-24T14:15:22Z", "layoutVersion": 0, "layoutChangedBy": null, "duplicatedFrom": "string", "previousPdfs": [ { "sha256": "string", "fileName": "string", "pageCount": 0, "replacedAt": "2019-08-24T14:15:22Z", "replacedBy": "string" } ] }}