Create template (DOCX)
DOCX templates in ZapSign allow for the automation of documents with dynamic fields, facilitating the generation of contracts, agreements, and other recurring documents. Creating documents from a template is useful for various use cases, such as:
Sending a document to the signer to complete a form, and using that information to create the document. Examples include insurance policy applications, informed consent forms, event registrations, and more.
Sending the document to the signer partially filled out, allowing them to complete the form and fill in the missing fields. The document will be created, and the signer will proceed with the signing process. Examples include bank account openings and loan applications.
Filling in all dynamic fields to create the final document, where the signer only needs to sign it. Examples include employment contracts, promissory notes, and lease agreements.
Creating the Document in Word (DOCX)
Before using the endpoint to create a template in ZapSign, you need to prepare the DOCX file with dynamic fields that will be replaced with specific information during each document generation. Follow these steps:
1. Create the Base Document
Use Microsoft Word, Google Docs (exporting to DOCX), or any compatible DOCX editor.
Draft the document content, ensuring it is properly structured.
2. Define Dynamic Fields
Dynamic fields are represented with double curly braces
{{field}}
within the document.Example:
{{name}}
,{{date}}
,{{email}}
.
3. Avoid Images and Tables
We recommend avoiding images and tables in the DOCX document, as they may interfere with the proper functionality.
4. Save and Export
Save the file in
.docx
format.Verify that the dynamic fields are correctly written and placed.
Once the DOCX document is prepared, you can use the corresponding endpoint to upload the template to ZapSign and start generating documents automatically.
Create DOCX Template
POST
https://api.zapsign.com.br/api/v1/templates/create
Headers
Authorization*
string
apiToken ahead of the "Bearer" text.
Ex: Bearer c7f35c84-7893-4087-b4fb-d1f06c23
Request Body
name
string
Title of the document. String of up to 255 characters
url_docx
string
Public URL of the document (maximum file size: 10MB).
base64_docx
string
Document converted to a Base64 string.
lang
string
Document language. Possible values: "pt-br" (Portuguese), "es" (Spanish), "en" (English), "fr" (French). Default: "pt-br"
observers
array<string>
Represents document observers (limit 20), i.e. email addresses that will be notified upon completion of the signature flow. It's an array of strings.
first_signer
object
Document signer configuration
blank_email (boolean): If set to true, the signer's email will not be requested and will not be included in the signature report. It is mandatory to have either the email or the phone number of the signer. Default:
false
.blank_phone (boolean): If set to true, the signer's phone number will not be requested and will not be included in the signature report. It is mandatory to have either the email or the phone number of the signer. Default:
false
.qualification (string): The signer's role that will be displayed in the signature report. For example, "Witness" will be shown as "Signed as Witness". Default: "".
auth_mode (string): Select the authentication method for the signer. This adds extra security to the signed document. For more information on authentication methods, click here. Default: "assinaturaTela".
"assinaturaTela"
On-screen signature
Free
"tokenEmail"
Email token
Free
"assinaturaTela-tokenEmail"
On-screen signature and email token
Free
"tokenSms"
SMS token
Free
"assinaturaTela-tokenSms"
On-screen signature and SMS token
Free
"tokenWhatsapp"
WhatsApp token
5 credits = USD$0.1
"assinaturaTela-tokenWhatsapp"
On-screen signature and WhatsApp token
5 credits = USD$0.1
require_selfie_photo (boolean): If set to true, the signer will be asked to take a selfie during the signing process (no photo validation is performed). Default: false.
require_document_photo (boolean): If set to true, the signer will be asked to take a photo of the front and back of their identity document during the signing process (no photo validation is performed). Default: false.
selfie_validation_type (string): Advanced biometric methods to validate the signer's identity. To learn more about each method, click here.
liveness-document-match
Facial recognition that requires the signer to upload a photo of their identity document and record their face. It validates that the person is the same as in the document and that the person is present at the time of sign
CO, BR, MX, CL, PE
25 credits = $0.5 USD
identity-verification
Document validation and facial biometrics. It validates that the person is present at the time of signing, that the document is real, that the person is the same as in the document, and that the document is registered in government databases.
CO, MX, CL, PE
55 credits = $1.0 USD
identity-verification-global
Document validation and facial biometrics, ensuring that the signer is present, the document is authentic (using fraud detection models), and the name extracted from the document matches the signer's name. Note: it does not include validation against government databases.
Global
50 credits = $0.9 USD
Request
Response
Next Steps
If the signer needs to complete dynamic fields in the form during signing, you must configure the form using the "Template Form Configuration" endpoint.
To create documents from this template, go to the "Create Document via Template" section.
About Base64
Base64 is a simple way to convert files into text. If you want to learn more about what Base64 is, you can check out the full definition here. Converting a file to Base64 and sending it as text in the request body makes it easier to handle compared to formats like multipart/form-data
.
To test the API, you can manually convert your DOCX file to Base64 using various online tools, such as this one.
Once the API is integrated into your system, look for the appropriate function in your programming language to convert files to Base64.
Important: you must send the base64_pdf parameter only with the base64 file conversion. Dont send the data:application/pdf;base64, on your parameter.
Last updated
Was this helpful?