Upload document
Requests a presigned URL to upload a document to the onboarding. Once obtained, the file must be uploaded directly via a PUT request to that URL.
POST
/v1/onboardings/{onboarding_id}/documentsRequest
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Content-Type | string | Yes | Must be application/json |
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
onboarding_id | string (uuid) | Yes | Onboarding ID obtained when creating the onboarding |
Not applicable: Query Parameters.
Body
| Field | Type | Required | Description |
|---|---|---|---|
cuit | string | Yes | CUIT of the document holder (11 digits) |
document | object | Yes | Document information to upload |
Document fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Document type. See document types |
extension | string | Yes | File MIME type. See supported extensions |
file_name | string | Yes | File name |
Response
2XX Success
| Field | Type | Description |
|---|---|---|
url | string | Presigned URL to upload the document via PUT |
expires_in_seconds | integer | How long the presigned URL stays valid, in seconds. Currently 600 (10 minutes), counted from the moment it is issued |
Error Codes
| Status | Description |
|---|---|
401 | Unauthorized — invalid or missing token |
403 | Forbidden — unauthorized client |
404 | Not Found — onboarding does not exist |
422 | Validation Error — submitted parameters are invalid |
500 | Internal Server Error — internal server error |
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X POST "https://b2b.allaria.cloud/v1/onboardings/ONBOARDING_ID/documents" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cuit": "20304050607",
"document": {
"type": "DNI_FRONT",
"extension": "image/jpeg",
"file_name": "dni_frente.jpg"
}
}'
# With the obtained URL, upload the file:
curl -X PUT "PRESIGNED_URL" \
-H "Content-Type: image/jpeg" \
--data-binary @dni_frente.jpg
const response = await fetch('https://b2b.allaria.cloud/v1/onboardings/ONBOARDING_ID/documents', {
method: 'POST',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cuit: '20304050607',
document: {
type: 'DNI_FRONT',
extension: 'image/jpeg',
file_name: 'dni_frente.jpg'
}
})
});
const { url } = await response.json();
// Upload the file to the presigned URL
await fetch(url, {
method: 'PUT',
headers: { 'Content-Type': 'image/jpeg' },
body: fileBlob
});
import requests
response = requests.post(
'https://b2b.allaria.cloud/v1/onboardings/ONBOARDING_ID/documents',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'cuit': '20304050607',
'document': {
'type': 'DNI_FRONT',
'extension': 'image/jpeg',
'file_name': 'dni_frente.jpg'
}
}
)
presigned_url = response.json()['url']
# Upload the file to the presigned URL
with open('dni_frente.jpg', 'rb') as f:
requests.put(presigned_url, data=f, headers={'Content-Type': 'image/jpeg'})
const axios = require('axios');
const fs = require('fs');
const { data } = await axios.post(
'https://b2b.allaria.cloud/v1/onboardings/ONBOARDING_ID/documents',
{
cuit: '20304050607',
document: {
type: 'DNI_FRONT',
extension: 'image/jpeg',
file_name: 'dni_frente.jpg'
}
},
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
}
}
);
// Upload the file to the presigned URL
await axios.put(data.url, fs.readFileSync('dni_frente.jpg'), {
headers: { 'Content-Type': 'image/jpeg' }
});
2XX Success
{
"url": "https://storage.example.com/upload/presigned-url?...",
"expires_in_seconds": 600
}
Document types
Individual (INDIVIDUAL)
| Type | Description |
|---|---|
DNI_FRONT | Front of the DNI |
DNI_BACK | Back of the DNI |
WORTH_STATEMENT | Net worth statement |
Business (BUSINESS)
| Type | Description |
|---|---|
BALANCE | Financial balance sheet |
WORTH_STATEMENT | Net worth statement |
SHARES_REGISTER | Share register book |
STATUTE | Corporate bylaws |
POA | Power of attorney |
AUTHORITIES | Board of directors minutes |
MEMBERS_NOTE | Members note |
SHAREHOLDERS_NOTE | Shareholders note |
TRUST_NOTE | Trust note |
PARTNERS_NOTE | Partners note |
PARTNERS_LIST | Partners list |
UIF_INSCRIPTION_CERTIFICATE | UIF registration certificate |
EXPENSE_LIQUIDATION | Expense liquidation |
HORIZONTAL_PROPERTY_REGULATIONS | Horizontal property regulations |
TRUST_CONSTITUTION_CONTRACT | Trust constitution contract |
CO_OWNER_LIST | Co-owner list |
OTHERS | Others |
Supported extensions
| Value | Description |
|---|---|
image/png | PNG image |
image/jpeg | JPEG image |
application/pdf | PDF document |
application/msword | Word document (.doc) |
application/vnd.openxmlformats-officedocument.wordprocessingml.document | Word document (.docx) |