Skip to main content

🔵 Create a Signature Package

POST /document/save

This service allows you to generate a package of documents from an Auco template or a PDF file. Once the process is completed, you will receive each document with its own signature certificate.

info

Before integrating this endpoint, you may need to see how to define signature positions and identity validation settings.

Steps to create a document package through an automated template:

  1. Query available templates or custom documents.
  2. Obtain the _id of the base document.
  3. Query required variables of the selected document.
  4. Construct and send the creation request.
info

If you want to do it using a PDF, it is not necessary to send the file in the initial request. At the end, a signed URL will be returned for each document in the package.

Below are the required parameters for this service, along with examples and possible system responses.


Authentication

Include your private key in the Authorization header.

Authorization: prk_xxx...

Creation Parameters

NameTypeRequiredDescription
emailStringRequiredEmail address of the process creator.
documentStringConditionalID of the custom document or Auco template. Only required if you want to use a template.
nameStringRequiredName of the document signing process. Required if the process includes document signing.
messageStringRequiredMessage that will be sent in the body of the email notifying signers or approvers of the document.
subjectStringRequiredSubject with which the notification email will be sent to signers or approvers.
folderStringConditionalIf you want to save this process in a specific folder, specify the path here. The folder must exist and belong to the process creator.
rememberNumberConditionalEnables automatic reminders with the time interval (in hours) between each notification. Must be a multiple of 3.
expiredDateDateOptionalExpiration date of the document. Must be at least 3 days after the process creation date and is sent in JSON Date format.
cameraBooleanOptionalIndicates if photo validation is required. Default is false.
otpCodeBooleanOptionalIndicates if OTP code validation is required. Default is false.
optionsObjectOptionalSpecifies identity validation settings. See more
notificationBooleanOptionalDefines whether participants will be notified once the process is created. Default is true.
dataArrayConditionalContains all the data required by the template to generate the document. Only required if using a template.
data[x].keyStringRequiredName of the parameter registered in the template.
data[x].valueStringRequiredValue assigned to the parameter.
documents *ArrayRequiredList of objects, each representing a document in the package.
documents[0].nameStringRequiredName of the document.
documents[0].readersArrayOptionalList of objects defining participants who are not part of the signing process but should observe each phase of the signing process.
documents[0].readers[x].nameStringRequiredName of the reader.
documents[0].readers[x].emailStringRequiredEmail address of the reader.
documents[0].signProfileArrayRequiredList of objects containing information for each signer or approver for notification and signing.
documents[0].signProfile[x].nameStringRequiredName of the signer.
documents[0].signProfile[x].emailStringRequiredEmail address of the signer.
documents[0].signProfile[x].phoneStringRequiredPhone number of the signer.
documents[0].signProfile[x].roleStringConditionalDefines the participant's role, can be 'APPROVER' or 'SIGNER'.
documents[0].signProfile[x].orderStringConditionalDefines the order in which the notification process for signing or approval will occur.
documents[0].signProfile[x].positionArrayConditionalSignature positions for this signer on each page. Signature positions can be preloaded in templates. See more in how to define signature positions.
documents[0].signProfile[x].typeArrayConditionalName used to identify the signer type if pre-saved in a template, e.g.: 'co-signer'.
documents[0].signProfile[x].labelBooleanConditionalIndicates if signature positioning will be done using labels in the PDF.
documents[0].signProfile[x].optionsObjectOptionalAllows defining custom validations for a specific signer. To apply validations individually per signer, see more.
documents[0].signProfile[x].cameraBooleanOptionalIf you want individual validations per signer and require photo or video validation, set this parameter to true. Default is false.
documents[0].signProfile[x].otpCodeBooleanOptionalIf you want individual validations per signer and require OTP validation, set this parameter to true. Default is false.
documents[0].signProfile[x].bothBooleanOptionalIf you want individual validations per signer and require the signing process to be possible via WhatsApp and/or email, set this parameter to true. Default is false.

🧪 Usage Examples

tip

You can copy any of the examples according to your preferred programming language.

  • Email addresses and phone numbers among signers must not repeat.
  • Readers will receive notifications for every update in the signature process.
  • Date format: 'DD/MM/YYYY'
  • Phone numbers must include the country code, e.g.: +57, +1, +52...

Document Package via PDF

curl --location 'https://dev.auco.ai/v1/ext/document/many' \
--header 'Authorization: prk_e1cd6a01ecdb4b4ea72ec118e33b18de' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Prueba paquete 2 documentos",
"email": "example@auco.ai",
"message": "Hola a todos, les comparto el paquete de documentos para la firma",
"options": {
"camera": "identification",
"whatsapp": true
},
"camera": true,
"otpCode": false,
"documents": [
{
"name": "Documento 1",
"signProfile": [
{
"type": "solicitante",
"name": "Firmante 1",
"phone": "+573000000000",
"email": "example1@auco.ai"
}
]
},
{
"name": "Documento 2",
"signProfile": [
{
"type": "solicitante",
"name": "Firmante 1",
"phone": "+573000000000",
"email": "example2@auco.ai"
}
]
}
]
}

Document Package via Custom Templates

curl --location 'https://dev.auco.ai/v1/ext/document/many' \
--header 'Authorization: prk_e1cd6a01ecdb4b4ea72ec118e33b18de' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Prueba notification2",
"email": "example@auco.ai",
"message": "Hola a todos, les comparto el paquete de documentos para la firma",
"options": {
"camera": "identification",
"whatsapp": true
},
"camera": true,
"otpCode": false,
"documents": [
{
"name": "Documento 1",
"document": "documentId",
"data": [
{"key": "signer_nombre", "value":"firmante 1"},
{"key": "signer_identification", "value":"cc"},
{"key": "signer_phone", "value":"+573000000000"},
{"key": "manager_name", "value":"manager 1"}
]
},
{
"name": "Documento 2",
"document": "documentId",
"data": [
{"key": "signer_nombre", "value":"firmante 1"},
{"key": "signer_identification", "value":"cc"},
{"key": "signer_phone", "value":"+573000000000"},
{"key": "manager_name", "value":"manager 1"}
]
}
]
}'

📥 Response Examples

Document Package via PDF

{
"id": "packageId",
"documents": [
{
"url": "https://signed_url_to_upload_PDF",
"name": "Documento 1",
"code": "CODEDOC1"
},
{
"url": "https://signed_url_to_upload_PDF",
"name": "Documento 2",
"code": "CODEDOC2"
}
]
}
info

The signed URL provided in the response is single-use and available only for 5 seconds. It must be used to upload the PDF document in binary format via an HTTP PUT request.

Via Custom Templates

{
"id": "packageId",
"documents": [
{
"name": "Documento 1",
"code": "CODEDOC1"
},
{
"name": "Documento 2",
"code": "CODEDOC2"
}
]
}

⚠️ Error Responses

CodeDescription
400Missing parameters, or one or more validations do not meet the applicability conditions.
401Invalid or missing authentication.