Skip to main content

Template Creation

This service allows you to create custom templates that can later be used to fill out documents for signature.

POST/templateprivate keyprk_

Authentication

Include your private key in the Authorization header.

Authorization: prk_xxx...

Creation Parameters

PropertyTypeRequiredDescription
namestringRequiredName of the automation
descriptionstringOptionalText describing the template, up to 500 characters
configarrayRequiredArray of questions for the user
signatureProfilearrayRequiredDefinition of signers and approvers
signarrayRequiredNames of required questions
preBuildbooleanRequiredIf true, includes automatic pre-fill
customobjectRequiredObject that allows customizing template characteristics
The description limit is 500 characters

description is informational: it does not change the template's behavior, and it helps your team recognize what each template is for. If you do not send it, the template has no description. If the text goes over 500 characters, the API responds 400 and does not create the template.

GET /template returns the field, both in the list and in the detail by id.

Creation Examples

curl -X POST https://api.auco.ai/v1.5/ext/template \
-H "Content-Type: application/json" \
-H "Authorization: your_private_key" \
-d '{
"name": "Test document variable modification",
"description": "Service agreement with a single signer, for the sales team",
"config": [
{
"name": "client_name",
"type": "name",
"description": "Enter the client name"
},
{
"description": "Select the document type for the client",
"name": "client_document_type",
"type": "clausula",
"value": "id_card",
"options": [
{
"name": "National ID Card",
"value": "id_card"
},
{
"name": "Foreign ID Card",
"value": "foreign_id"
}
]
},
{
"description": "Enter the national ID card number for the client",
"name": "client_id_card",
"type": "number",
"prereq": [
{
"k": "client_document_type",
"v": "id_card"
}
]
},
{
"description": "Enter the foreign ID number for the client",
"name": "client_foreign_id",
"type": "number",
"prereq": [
{
"k": "client_document_type",
"v": "foreign_id"
}
]
},
{
"name": "client_email",
"type": "email",
"description": "Enter the client email"
},
{
"name": "client_phone",
"type": "phone",
"description": "Enter the client phone"
}
],
"sign": [
"client_name",
"client_id_card",
"client_foreign_id",
"client_email",
"client_phone"
],
"signatureProfile": [
{
"email": "client_email",
"phone": "client_phone",
"identification": "client_id_card|client_foreign_id",
"name": "client_name",
"type": "client"
}
]
}'

Response Example

{
"id": "template_id",
"urls": {
"mask": "https://signed_url_mask",
"complete": "https://signed_url_complete"
}
}

Uploading HTML Complete and HTML Mask:

In the creation service response, you will find two response URLs. These have a lifespan of 5 minutes; after this time, they will no longer be valid. At this point, you should have the HTML Complete and HTML Mask files ready and upload the Binaries of these files in PUT requests to each of these URLs.

# Upload HTML Mask
curl -X PUT https://signed_url_mask \
-H "Content-Type: text/html" \
-d @mask.html

# Upload HTML Complete
curl -X PUT https://signed_url_complete \
-H "Content-Type: text/html" \
-d @complete.html
Important

Signed URLs expire in 5 minutes. You must complete the upload before this time expires.