Download a document's PDF

The document's own copy of the PDF, before signing. For the signed result use Download the finished PDF.

Permission: signing:read @ workspace/{workspaceId}/signingRequest/{signingRequestId}

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.

Response Body

application/pdf

application/json

application/json

application/json

application/json

GETDownload a document's PDF
curl -X GET "https://example.com/signing/requests/sZG0nWcpWKBF7zT8CqcN/pdf?workspaceId=ws_a1b2c3"
"string"
GET
/signing/requests/{signingRequestId}/pdf

Cancel a document POST

Stops a document that is out for signing, or a draft. Every link stops working. Refused once everyone has signed. **Permission:** `signing:send` @ `workspace/{workspaceId}/signingRequest/{signingRequestId}`

Replace a draft's PDF POST

Drafts only. A document that has been sent never changes. 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. The template the draft came from is not changed. A value you filled in goes with its field: it is removed with a deleted field and kept with a moved one. The replace is listed in the document's events (`pdf_replaced`) and in the audit pages of the finished document. **What changes.** The draft's file is overwritten at the same place. `snapshot.pdf` describes the new file, `layoutVersion` goes up by one (an editor holding the old version gets a 409 on its next save), and `previousPdfs` gains a note of the old file. People, the message and the other settings stay as they are. **Do it in this order.** Save your changes to the draft first: the replace works on the saved fields. One replace runs at a time per draft. To change a sent document, make a new draft with [Copy a document as a new draft](/docs/api-reference/signing/documents/duplicateSigningRequest) and replace that draft's PDF. **Permission:** `signing:send` @ `workspace/{workspaceId}/signingRequest/{signingRequestId}` #### Get the document ID first ```bash curl "$HOS_API/signing/requests?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" ``` #### Request ```bash curl -X POST "$HOS_API/signing/requests/req_a1b2c3/pdf?workspaceId=ws_a1b2c3" \ -H "Authorization: Bearer $HOS_KEY" \ -F "[email protected]" \ -F "missingPageFields=delete" ``` `missingPageFields` is needed only when fields sit on pages the new file does not have. Without it, that case answers 409 with `needsChoice` and changes nothing.