Hello developer,
often it is necessary to prepare documents programmatically without sending them to the recipients immediately. In this module you will learn how to create documents in advance while they remain securely in draft status. This allows you or your users to make final touches in the sproof UI before the invitations are finally sent.
1. Preparing documents (without sending)
When you call this endpoint, the document is created and all submitted data is stored. However, the process pauses in the status "Draft". At this time, no emails are sent to the recipients.
Flexibility in signature placement: You can already define the signaturePositions in the API request or pass the field as an empty array []. The latter is ideal if the signature positions or additional form fields should only be placed later visually by a user in the sproof UI.
Endpoint: POST https://sign.sproof.com/api/v1/documents/prepare
Example request body (same as for the documents/signature endpoint):
JSON
{
"token": "{{token}}",
"inviteData": {
"sender": {
"email": "{{email}}",
"firstName": "sproof",
"lastName": "Sender"
},
"recipients": [
{
"email": "max.mustermann@sproof.com",
"firstName": "Max",
"lastName": "Mustermann"
}
]
},
"envelopeData": {
"documentDataArray": [
{
"data": "{{pdf_im_base64_format}}",
"fileName": "wichtiger_vertrag.pdf",
"recipientDetails": {
"max.mustermann@sproof.com": {
"role": "signer",
"signaturePositions": [
{"page": 0, "x": 0.57489, "y": 0.8455, "width": 0.35, "height": 0.1}
]
}
}
}
]
}
}
2. Seamless transition into the sproof UI
After the successful request you will receive a response in the same format as the /signature endpoint. Since the document is in draft status and no active invitations have been sent to the recipients yet, the members array (the list of invited persons) is empty.
The document was created exclusively for the sender in this step. The returned member object contains the sender's identity, which you need to reference the document for further editing.
Example of the response object:
{
"documents": [
{
"id": "c4507aa87823fc1bc9ae181c24a27ccc9a20a04c3373bd0a745e63b8d4bdbb4885a148",
"name": "wichtiger_vertrag",
//...additional properties truncated
"members": [],
"member": {
"id": "a395ae0985350956ffae7ce01f09e292bb5d5474f65c60f22d915823aaea5c17f71bdd",
"documentId": "c4507aa87823fc1bc9ae181c24a27ccc9a20a04c3373bd0a745e63b8d4bdbb4885a148",
"email": "sender@sproof.com",
"firstName": "sproof",
"lastName": "Sender",
"isAdmin": true,
//...additional properties truncated
}
}
]
}
-
Dashboard view: The document appears in the sender's sproof dashboard. Here you can open it manually at any time.
-
Direct forwarding: Use the
member.idfrom the API response to direct your users from your own application straight into the sproof editor. The link follows this pattern:https://sign.sproof.com/editor/{{memberId}} -
Manual refinement: In the editor you can now make final adjustments – such as placing form fields or moving signature positions – before the document is finally released with a click on "Send invitation".
-
Final sending: Once the document is finally sent in the UI, sproof triggers the email dispatch to all recipients. If you defined a
callbackUrlin the original request, you will from that moment receive status updates about the progress of the signatures as usual.
We wish you every success with the integration!