Skip to main content

Template Update

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

PUT/templateprivate keyprk_

Authentication

Include your private key in the Authorization header.

Authorization: prk_xxx...

Update Parameters

PropertyTypeRequiredDescription
idstringRequiredTemplate identifier
namestringOptionalName of the automation
descriptionstringOptionalText describing the template, up to 500 characters
configarrayOptionalArray of questions for the user
signatureProfilearrayOptionalDefinition of signers and approvers
signarrayOptionalNames of required questions
preBuildbooleanOptionalIf true, includes automatic pre-fill
description is kept if you do not send it

Leaving description out of the PUT does not erase the description the template already has: the previous one stays. To change it, send the new text — up to 500 characters, or the API responds 400.

A saved description cannot be erased

Today there is no way to leave a template without a description once it has one: the validation rejects both the empty string ("") and null, and omitting the field keeps the previous value. If you need the text to stop showing, replace it with the right one.

Update Examples

curl -X PUT https://api.auco.ai/v1.5/ext/template \
-H "Content-Type: application/json" \
-H "Authorization: your_private_key" \
-d '{
"id": "your_template_id",
"name": "Test document variable modification",
"description": "Service agreement with a single signer, for the sales team",
"config": [
{
"name": "new_question",
"type": "name",
"description": "Example of new question"
},
{
"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",
"new_question"
]
}'

Response Example

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

Uploading HTML Complete and HTML Mask:

You will need to upload the HTML files again. In the update 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. If they expire, there is no way to regenerate them — you'll need to call PUT /template again.

Skip upload if HTML didn't change

If you're only updating config, sign, or signatureProfile and the HTML is unchanged, you can ignore the returned URLs and skip the upload entirely. The server will keep the HTMLs from the previous version.