Save a document as a new template

A new template from this document's PDF, roles and fields, in any status. It never changes an existing template, including the one the document came from. The PDF is copied file to file from this document's own copy, so a draft whose PDF was replaced becomes a template with the new file.

Not copied: the people, the values you filled in, the message, the sign-by date, reminders and the signing order. The roles and fields go through the same check as a template save, so a document whose fields would not pass that check answers 400.

Permission: signing:read @ workspace/{workspaceId}/signingRequest/{signingRequestId} and signing:manage @ workspace/{workspaceId}. Both are checked.

Authorization

ServiceAccountKey
AuthorizationBearer <token>

A service account API key, sent whole as a bearer token: hsk_<40 hex>.hss_<64 hex>.

In: header

Path Parameters

signingRequestId*string

The document to act on. IDs come from List documents.

Query Parameters

workspaceId*string

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

application/json

POSTSave a document as a new template
curl -X POST "https://example.com/signing/requests/sZG0nWcpWKBF7zT8CqcN/save-as-template?workspaceId=ws_a1b2c3" \  -H "Content-Type: application/json" \  -d '{    "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"      }    ]  }}
POST
/signing/requests/{signingRequestId}/save-as-template

Copy a document as a new draft POST

A new draft from any document, in any status: draft, sent, finished, declined, expired or cancelled. The original keeps its state; only the copy is new. The PDF is copied file to file from this document's own copy, so field changes made on this document come along. | Copied | Not copied | | --- | --- | | The PDF, roles, fields, signing order, message, reminder setting, the template it came from | The people (every role starts empty), the values you filled in, the sign-by date, `delivery` (the copy uses `email`) and the send-from address and number | The copy is named after the original with " (copy)" and starts with a `created` event whose `data.duplicatedFrom` is this document's id. To change a sent document's PDF, copy it, then [replace the copy's PDF](/docs/api-reference/signing/documents/replaceSigningRequestPdf). **Permission:** `signing:read` @ `workspace/{workspaceId}/signingRequest/{signingRequestId}` and `signing:send` @ `workspace/{workspaceId}`. Both are checked. #### Get the document ID first ```bash curl "$HOS_API/signing/requests?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" ``` #### Copy it ```bash curl -X POST "$HOS_API/signing/requests/req_a1b2c3/duplicate?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" ```

Get each person's current signing link GET

The link each person can use right now. Reading them changes nothing: the link a person was sent keeps working. Every person who has not finished is listed, in any turn. A person in a later turn can open their link, but it shows who signs first until their turn. A person is left out when the document is not out for signing, when they have finished or declined, or when no current link is held for them. For those, make one with [Make a new signing link](/docs/api-reference/signing/signers/issueSignerLink). **Each link is a secret.** Anyone holding it can sign as that person. Every read is recorded. **Permission:** `signing:send` @ `workspace/{workspaceId}/signingRequest/{signingRequestId}`