Create Attachments Process
POST /attachments
This service allows initiating a process to request attachments for signing or simply attachments without signing. Each attachment can be configured as mandatory or optional.
If you want to include a signing process, you can send a PDF document in base64 format. If you want both the signing 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 need 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 signing process, only if the attachments process includes document signing. |
packageName | String | Required | Name for the folder that will contain the attachments and the document to be signed (if included). |
message | String | Required | Message that will be included in the body of the email notification sent to signers or approvers. |
subject | String | Required | Subject of 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 format 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 . The service will return 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 here. The folder must exist and belong to the process creator. |
remember | Number | Conditional | Enables automatic reminders with the time lapse (in hours) between each notification. Must be a multiple of 3. |
expiredDate | Date | Optional | Expiration date of the document. Must be at least 3 days after the process creation date and should be sent in JSON Date format. |
camera | Boolean | Optional | Indicates if photo validation is required. Default is false . |
otpCode | Boolean | Optional | Indicates if OTP code validation is required. Default is false . |
options | Object | Optional | Specifies the identity validation settings. |
notification | Boolean | Optional | Defines whether participants will be notified once the process is created. Default is true . |
signProfile | Array | Required | List of objects containing information about each signer or approver for notification and signing. |
signProfile[x].name | String | Required | Name of the attachment user. |
signProfile[x].email | String | Required | Email address of the attachment user. |
signProfile[x].phone | String | Required | Phone number of the attachment user. |
signProfile[x].role | String | Conditional | Defines the participant's role; can be 'APPROVER' or 'SIGNER' . |
signProfile[x].order | String | Conditional | Defines the order in which the notification process for signing or approval will occur. |
signProfile[x].label | Boolean | Conditional | Indicates whether signature positioning will be done using labels in the PDF. |
signProfile[x].position | Array | Conditional | Signature positions for this signer on each page. Signature positions can be preloaded in templates. Get more information in the documentation. |
signProfile[x].type | Array | Conditional | Identifier for 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 individual validations per signer, this parameter accepts the same fields as the global options . You can combine global and individual validations, applying global ones by default and individual ones where special treatment is required. |
signProfile[x].camera | Boolean | Optional | To have individual validations per signer and require photo or video validation, set this parameter to true . Default is false . |
signProfile[x].otpCode | Boolean | Optional | To have individual validations per signer and require OTP validation, set this parameter to true . Default is false . |
signProfile[x].both | Boolean | Optional | To have individual validations per signer and allow the signing process to be completed via WhatsApp and/or email, set this parameter to true . Default is false . |
signProfile[x].files | Array | Required | List of attachment files that will be requested from the signer. |
signProfile[x].files[x].name | String | Required | Name of the attachment file. |
signProfile[x].files[x].optional | Boolean | Optional | If any attachment file is optional, send this parameter as true . Default is false . |
🧪 Usage Examples
You can copy any of the examples according to your preferred language.
Optional Attachments with Document Signature (PDF Base64)
- curl
- Python
- Node.js
curl --location 'https://dev.auco.ai/v1.5/ext/package/upload' \
--header 'Authorization: prk_prk_tuLlavePrivada' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Contratación de prueba upload 1",
"email": "owner@auco.ai",
"message": "Cargar adjuntos de prueba",
"subject": "Solicitud de adjuntos",
"packageName": "Adjuntos api prueba",
"file": Base64,
"signProfile": [
{
"name": "Nombre Firmante 1",
"email": "example@auco.ai",
"phone": "+573000000000",
"position": [
{
"page": 1,
"x": 0.5854166461564629,
"y": 0.8034861200774693,
"w": 100,
"h": 50
}
],
"files": [
{
"name": "cedula de ciudadanía"
},
{
"name": "hoja de vida"
},
{
"name": "pasaporte",
"optional": true
}
]
}
],
}'
import requests
import json
url = "https://dev.auco.ai/v1.5/ext/package/upload"
payload = json.dumps({
"name": "Contratación de prueba upload 1",
"email": "owner@auco.ai",
"message": "Cargar adjuntos de prueba",
"subject": "Solicitud de adjuntos",
"packageName": "Adjuntos api prueba",
"file": Base64,
"signProfile": [
{
"name": "Nombre Firmante 1",
"email": "example@auco.ai",
"phone": "+573000000000",
"position": [
{
"page": 1,
"x": 0.5854166461564629,
"y": 0.8034861200774693,
"w": 100,
"h": 50
}
],
"files": [
{
"name": "cedula de ciudadanía"
},
{
"name": "hoja de vida"
},
{
"name": "pasaporte",
"optional": True
}
]
}
],
})
headers = {
'Authorization': 'prk_prk_tuLlavePrivada',
'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: 'Contratación de prueba upload 1',
email: 'owner@auco.ai',
message: 'Cargar adjuntos de prueba',
subject: 'Solicitud de adjuntos',
packageName: 'Adjuntos api prueba',
file: Base64,
file:
signProfile: [
{
name: 'Nombre Firmante 1',
email: 'example@auco.ai',
phone: '+573000000000',
position: [
{
page: 1,
x: 0.5854166461564629,
y: 0.8034861200774693,
w: 100,
h: 50,
},
],
files: [
{
name: 'cedula de ciudadanía',
},
{
name: 'hoja de vida',
},
{
name: 'pasaporte',
optional: true,
},
],
},
],
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dev.auco.ai/v1.5/ext/package/upload',
headers: {
Authorization: 'prk_tuLlavePrivada',
'Content-Type': 'application/json',
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Optional Attachments with Document Signature (PDF compress and individual validations)
- 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",
"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": "email"
},
"files": [
{
"name": "certificado"
}
]
}
],
"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",
"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": "email"
},
"files": [
{
"name": "certificado"
}
]
}
],
"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: 'email',
},
files: [
{
name: 'certificado',
},
],
},
],
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 using 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 |