Create Document from Template
POST/createdocument/:template_id
The Create Document API allows you to generate new documents by just providing template_id instead of uploading a new file(in the form of base64 or binary) every time you need to create a document. Templates for repeatedly used files can be created from user interface at Debug UI or using the Create Template API.
Request
Path Parameters
objectId of Template
- application/json
Body
required
Array [
]
signers
object[]
required
This parameter allows you to specify whether you want emails to be sent to signers. The default value is "true". If the value of this parameter is "true" and no 'email_subject'/'email_body' parameters are specified default email templates will be used.
Custom mail subject for signature request. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.
Custom signature request email body. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.
If set to 'true', only the first signer will receive the signature request email initially. Emails to subsequent signers will be triggered sequentially, with each sent only after the previous signer has completed their signing. By default, sendInOrder is set to 'true'.
time to complete days is used to calculate expiry date of your document
true - this option will enable OTP verification. Users will receive a verification code via email, which they must enter to sign the document. false - this option will disable OTP verification, allowing users to sign the document directly without additional steps.
true - this option will enable a guided tour for signers, providing instructions during the signing process. false - disable the guided tour, ensuring a faster, uninterrupted signing experience.
Responses
- 200
- 400
- 405
In success response you will get url in response if you are also signer in document otherwise only get objectId, messsage
- application/json
- Schema
- Example (from schema)
Schema
{
"objectId": "hji2zxcv2P",
"url": "https://example.com",
"message": "Document sent successfully!"
}
If you haven't add widgets and signers in template or not provide signers along with their roles in body
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "Please setup template properly!"
}
Invalid API Token!
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "Invalid API token!"
}