Skip to main content

Document Creation

POST /document/save

This service allows generating a document dynamically from an Auco template or a previously created custom document. Unlike directly uploading a PDF file, in this flow the document is not attached as a file. Instead, only the information (variables) required by the template or base document is sent, which will be used to automatically generate the document and enable the signing flow.

info

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

Steps to create a document:

  1. Query available templates or custom documents: You should start by querying the available resources (own or Auco templates) to identify the base document you want to use.
  2. Obtain the identifier (_id) of the base document: Once the desired template or document is identified, obtain its _id to continue the process.
  3. Query required variables of the selected document: Use the corresponding service to retrieve the list of variables that need to be filled. This step is essential to correctly construct the document creation request.
  4. Build and send the creation request: With the variable information, you can assemble the request body (POST) to generate the document.

Below are the necessary 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 of the process creator.
documentStringRequiredID of the custom document or Auco template.
signBooleanRequiredParameter that defines if the process will be done through digital and electronic signature. Default is false, in which case the document will be sent by email for printing.
nameStringRequiredName of the document signing process, only if the attachment process includes document signing.
messageStringRequiredMessage that will be included in the email body notifying the signers or approvers of the document.
subjectStringRequiredSubject with which the notification email will be sent to the signers or approvers.
folderStringConditionalIf you want to save this process in a specific folder, you must enter the path of that folder in this parameter. Note that the folder must exist and belong to the process creator.
rememberNumberConditionalParameter that enables automatic reminders with the time interval (hours) between each notification. Must be a multiple of 3
expiredDateDateOptionalDocument expiration date. This must be greater than 3 days from the process creation date and is sent in JSON Date format.
cameraBooleanOptionalThis parameter indicates if photo validation is mandatory, default is false.
otpCodeBooleanOptionalThis parameter indicates if OTP code validation is mandatory, default is false.
optionsObjectOptionalThis parameter indicates the specifications of the identity validation. See more
notificationBooleanOptionalThis parameter defines if participants will be notified once the process is created, default is true
targetWebhooksArray[String]OptionalIf you have several webhooks, you can send the name of the webhook to which you want the updates of this process to be notified.
tagsArray[String]OptionalIf you want to classify processes with tags, you can send the names of the tags to relate the process to (They must exist).
dataArrayOptionalThis parameter sends all the data the template needs to generate the document.
data[x].keyStringRequiredName of the parameter registered in the template.
data[x].valueStringRequiredValue assigned to the parameter.
readersArrayOptionalThis parameter is a list of objects that defines participants who are not part of the signing process, but who should be able to observe each phase of the signing process.
readers[x].nameStringRequiredReader's name.
readers[x].emailStringRequiredReader's email.
readers[x].emailStringRequiredReader's email.

🧪 Usage Examples

tip

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

  • Remember that email addresses and phone numbers among signers must not be repeated.
  • Readers will receive notifications for each update in the signing process.
  • Date format: 'DD/MM/YYYY'
  • Phone numbers must include the country code, for example: +57, +1, +52...

Base signing process

curl --location 'https://dev.auco.ai/v1.5/ext/document/save' \
--header 'Authorization: prk_private_key_company' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "example@auco.ai",
"name": "PRUEBA 1",
"notification": false,
"data": [
{
"key": "name_customer",
"value": "Frimante 1"
},
{
"key": "document_type_customer",
"value": "cc"
},
{
"key": "cedula_customer",
"value": "1234156"
},
{
"key": "email_customer",
"value": "example@auco.ai"
},
{
"key": "phone_customer",
"value": "+573173654513"
}
],
"document": "64823dc5ce28a265e02d68f3",
"sign": true
}'

📥 Response Examples

Process creation

{
"document": "DOCUMENTCODE",
"signProfile": [
{
"id": "ZR",
"email": "example@auco.ai"
}
]
}

🔸 Sending the compress attribute

info

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

{
"package": "PROCESSID",
"code": "DOCUMENTCODE",
"url": "signed_url"
}

⚠️ Error Responses

CodeDescription
400Missing parameters, or some validations do not meet applicability conditions
401Invalid or missing authentication