Skip to main content

Delete a Template

DELETE/templateprivate keyprk_

This service deletes a template from your organization: it erases its configuration, both of its HTML files —the Mask and the Complete— and the reference links that point to it. Once deleted, the template no longer appears in GET /template and no processes can be created with it.

Auco refuses to delete it while any process created from it is still in signature —not finished, not expired, and not rejected—, because that process still needs the template to build the signed PDF. Once all its processes finish, expire, or are rejected, you can delete it.

Deletion cannot be undone

There is no way to recover a deleted template, and creating it again with POST /template gives it a new id: integrations and reference links that used the previous one stop working. If you may need it again, download it first with GET /template?id=, which returns its configuration and the URLs to download both HTML files.


Authentication​

Include your private key in the Authorization header.

Authorization: prk_xxx...

Steps to delete a template:​

  1. Download the template with GET /template?id= if you may need it again.
  2. Call DELETE /template with the template's id.
  3. If the response is TEMPLATE_IN_USE, wait for the processes still in signature to finish, or cancel them with POST /document/cancel, and try again.

Query Parameters​

NameTypeDescription
idString requiredTemplate identifier, an ObjectId of 24 hexadecimal characters.

🧪 Usage Examples​

tip

You can copy any of the examples depending on your preferred language.

🔹 Delete a template by id​

curl --location --request DELETE 'https://api.auco.ai/v1.5/ext/template?id=64823dc5ce28a265e02d68f3' \
--header 'Authorization: prk_private_key_company'

📥 Response Examples​

🔹 Template deleted​

{
"id": "64823dc5ce28a265e02d68f3",
"deleted": true,
"references": 2
}

🔸 Template with processes in signature​

{
"message": "TEMPLATE_IN_USE"
}

📋 Response Fields​

FieldTypeDescription
idStringIdentifier of the deleted template, the same one you sent.
deletedBooleantrue: the template and both of its HTML files were deleted.
referencesNumberHow many reference links to the template were deleted along with it. 0 if it had none.

⚠️ Error Responses​

CodeDescription
400Invalid parameter or template that cannot be deleted: TEMPLATE_NOT_FOUND (the id does not match a template of your organization), TEMPLATE_IN_USE (a process created from the template is still in signature), or the validator's message if id is missing or is not an ObjectId
401Invalid or missing authentication

The validator's message describes the problem with id: "id" is required, "id" length must be 24 characters long, or "id" must only contain hexadecimal characters.

TEMPLATE_IN_USE does not say which processes

The response does not identify the processes that block the deletion. If you need to know, check in your integration the processes you created with that template and query their status with GET /document.