✏️ Document Upload
POST /document/upload
This service allows initiating a process to request attachments for signature or just attachments without signature. Each attachment can be configured as mandatory or optional.
If you want to include a signature process, you can directly send a PDF document in base64 format. If you want the signature and attachment request to be part of a template, note that this flow cannot be configured directly through the endpoint; you must request support from our team.
Before integrating this endpoint, you may want to see how to define signature positions and identity validation settings.
Authentication
Include your private key in the Authorization
header.
Authorization: prk_xxx...
Creation Parameters
Name | Type | Required | Description |
---|---|---|---|
email | String | Required | Email address of the process creator. |
document | String | Conditional | If you want to create the process using a template, you must send the template ID in this field. To view and obtain templates, access this documentation. |
name | String | Required | Name of the document signing process, only if the attachments process includes document signing. |
message | String | Required | Message that will be included in the body of the email notifying signers or approvers of the document. |
subject | String | Required | Subject line for the notification email sent to signers or approvers. |
file | String | Conditional | If you want to upload the document in the same request, send the PDF file in Base64 in this parameter. (Only for small files) |
compress | Boolean | Conditional | If the PDF file to be uploaded is too large, it is recommended not to send the file parameter; instead, use compress: true . This way, the service returns a signed URL to upload the PDF file in binary format via a PUT request. |
folder | String | Conditional | If you want to save this process in a specific folder, provide the path of that folder in this parameter. Note that the folder must exist and belong to the process creator. |
remember | Number | Conditional | Parameter that enables automatic reminders with the time interval (in hours) between each notification. Must be a multiple of 3 |
expiredDate | Date | Optional | Expiration date of the document. This must be more than 3 days after the process creation date and is sent in JSON Date format. |
camera | Boolean | Optional | This parameter indicates if photo validation is required. Default is false . |
otpCode | Boolean | Optional | This parameter indicates if OTP code validation is required. Default is false . |
options | Object | Optional | This parameter specifies the identity validation settings. See more |
notification | Boolean | Optional | This parameter defines whether participants will be notified once the process is created. Default is true . |
readers | Array | Optional | This parameter is a list of objects defining participants who are not part of the signing process but should be able to observe each phase of the signing process. |
readers[x].name | String | Required | Name of the reader. |
readers[x].email | String | Required | Email of the reader. |
signProfile | Array | Required | This field is a list of objects containing information for each signer or approver for their notification and signature. |
signProfile[x].name | String | Required | Name of the signer. |
signProfile[x].email | String | Required | Email of the signer. |
signProfile[x].phone | String | Required | Phone number of the signer. |
signProfile[x].role | String | Conditional | This parameter defines the participant's role; it can be 'APPROVER' or 'SIGNER' . |
signProfile[x].order | String | Conditional | This parameter defines the order in which the notification process for signing or approval will take place. |
signProfile[x].label | Boolean | Conditional | Parameter indicating if signature positioning will be done using labels in the PDF. |
signProfile[x].position | Array | Conditional | In this parameter, the signature positions for this signer on each page are sent. Signature positions can be preloaded in templates. Obtain more information in the documentation. |
signProfile[x].type | Array | Conditional | Name used to identify the signer type if pre-saved in a template, e.g., 'co-signer' . |
signProfile[x].options | Object | Optional | Allows defining custom validations for a specific signer. If you want to apply validations individually by signer, See more. |
signProfile[x].camera | Boolean | Optional | If you want individual validations per signer and require photo or video validation, send this parameter as true . Default is false . |
signProfile[x].otpCode | Boolean | Optional | If you want individual validations per signer and require OTP validation, send this parameter as true . Default is false . |
signProfile[x].both | Boolean | Optional | If you want individual validations per signer and require the signing process to be possible via WhatsApp and/or email, send this parameter as true . Default is false . |
🧪 Usage Examples
You can copy any of the examples according to your preferred language.
- Remember that email addresses and phone numbers between signers must not be repeated.
- Readers will receive notifications for each update in the signing process.
Signing Process with Automatic Reminders (PDF Base64)
In this case, reminders will be sent every 3 hours.
- curl
- Python
- Node.js
curl --location 'https://dev.auco.ai/v1.5/ext/document/upload' \
--header 'Authorization: prk_private_key_company' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Documento de prueba",
"subject": "prueba auco",
"message": "prueba auco",
"remember": 3,
"email": "example@auco.ai",
"signProfile": [
{
"name": "Jhon Firma",
"email": "example@auco.ai",
"label": true
}
],
"readers":[{"email":"example2@auco.ai", "name":"Frimante 1"}],
"file": Base64
}'
import requests
import json
url = "https://dev.auco.ai/v1.5/ext/document/upload"
payload = json.dumps({
"name": "Documento de prueba",
"subject": "prueba auco",
"message": "prueba auco",
"remember": 3,
"email": "example@auco.ai",
"signProfile": [
{
"name": "Jhon Firma",
"email": "example@auco.ai",
"label": True
}
],
"readers": [
{
"email": "example2@auco.ai",
"name": "Frimante 1"
}
],
"file": Base64
})
headers = {
'Authorization': 'prk_private_key_company',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
name: 'Documento de prueba',
subject: 'prueba auco',
message: 'prueba auco',
remember: 3,
email: 'example@auco.ai',
signProfile: [
{
name: 'Jhon Firma',
email: 'example@auco.ai',
label: true,
},
],
readers: [
{
email: 'eyvasquezt30@gmail.com',
name: 'Frimante 1',
},
],
file: Base64,
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dev.auco.ai/v1.5/ext/document/upload',
headers: {
Authorization: 'prk_private_key_company',
'Content-Type': 'application/json',
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Document Signing with Individual Validations (compress - PDF binary)
- curl
- Python
- Node.js
curl --location 'https://dev.auco.ai/v1.5/ext/package/upload' \
--header 'Authorization: prk_private_key_company' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Prueba de Anexos Compress y validaciones individuales",
"email": "owner@auco.ai",
"message": "Cargar adjuntos de prueba",
"subject": "Solicitud de adjuntos",
"packageName": "Adjuntos api prueba 2",
"signProfile": [
{
"type": "firmante1",
"name": "Nombre Firmante 1",
"email": "example @auco.ai",
"camera": true,
"otpCode": true,
"options": {
"camera": "identification",
"video": true,
"whatsapp": true,
"otpCode": "email"
},
"phone": "+573000000000",
},
{
"type": "firmante2",
"name": "Nombre Firmante 2",
"email": "example2@auco.ai",
"phone": "+573000000000",
"otpCode": true,
"options": {
"otpCode": "email"
},
}
],
"compress": true
}'
import requests
import json
url = "https://dev.auco.ai/v1.5/ext/package/upload"
payload = json.dumps({
"name": "Prueba de Anexos Compress y validaciones individuales",
"email": "owner@auco.ai",
"message": "Cargar adjuntos de prueba",
"subject": "Solicitud de adjuntos",
"packageName": "Adjuntos api prueba 2",
"signProfile": [
{
"type": "firmante1",
"name": "Nombre Firmante 1",
"email": "example @auco.ai",
"camera": True,
"otpCode": True,
"options": {
"camera": "identification",
"video": True,
"whatsapp": True,
"otpCode": "email"
},
"phone": "+573000000000",
},
{
"type": "firmante2",
"name": "Nombre Firmante 2",
"email": "example2@auco.ai",
"phone": "+573000000000",
"otpCode": True,
"options": {
"otpCode": "email"
}
}
],
"compress": True
})
headers = {
'Authorization': 'prk_private_key_company',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
name: 'Prueba de Anexos Compress y validaciones individuales',
email: 'owner@auco.ai',
message: 'Cargar adjuntos de prueba',
subject: 'Solicitud de adjuntos',
packageName: 'Adjuntos api prueba 2',
signProfile: [
{
type: 'firmante1',
name: 'Nombre Firmante 1',
email: 'example @auco.ai',
camera: true,
otpCode: true,
options: {
camera: 'identification',
video: true,
whatsapp: true,
otpCode: 'email',
},
phone: '+573000000000',
files: [
{
name: 'cedula de ciudadanía',
},
{
name: 'hoja de vida',
},
{
name: 'pasaporte',
optional: true,
},
],
},
{
type: 'firmante2',
name: 'Nombre Firmante 2',
email: 'example2@auco.ai',
phone: '+573000000000',
otpCode: true,
options: {
otpCode: 'whatsapp',
},
},
],
compress: true,
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dev.auco.ai/v1.5/ext/package/upload',
headers: {
Authorization: 'prk_private_key_company',
'Content-Type': 'application/json',
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
📥 Response Examples
🔹 Sending PDF in Base64 via the 'file' attribute
{
"package": "PROCESSID",
"code": "DOCUMENTCODE"
}
🔸 Sending the 'compress' attribute
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
Code | Description |
---|---|
400 | Missing parameters, or some validations do not meet applicability conditions |
401 | Invalid or missing authentication |