curl -O https://www.getdiro.com/api/v1/documents/d290f1ee-6c54-4b01-90e6-d701748f0851/download \
-H "Authorization: Bearer diro_your_api_key"
const documentId = 'd290f1ee-6c54-4b01-90e6-d701748f0851';
const response = await fetch(
`https://www.getdiro.com/api/v1/documents/${documentId}/download`,
{
headers: {
'Authorization': 'Bearer diro_your_api_key',
},
}
);
// Save the file
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'document.pdf';
a.click();
import requests
document_id = 'd290f1ee-6c54-4b01-90e6-d701748f0851'
response = requests.get(
f'https://www.getdiro.com/api/v1/documents/{document_id}/download',
headers={'Authorization': 'Bearer diro_your_api_key'},
)
with open('document.pdf', 'wb') as f:
f.write(response.content)
Binary file content (PDF or PNG)
Content-Type: application/pdf
Content-Disposition: attachment; filename="document-{id}.pdf"
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Document is not ready. Current status: processing"
},
"meta": {
"timestamp": "2025-01-22T10:35:00.000Z"
}
}
{
"success": false,
"error": {
"code": "DOCUMENT_NOT_FOUND",
"message": "Document not found"
},
"meta": {
"timestamp": "2025-01-22T10:35:00.000Z"
}
}
Documents
Download Document
Download the generated PDF or PNG file
GET
/
documents
/
{id}
/
download
curl -O https://www.getdiro.com/api/v1/documents/d290f1ee-6c54-4b01-90e6-d701748f0851/download \
-H "Authorization: Bearer diro_your_api_key"
const documentId = 'd290f1ee-6c54-4b01-90e6-d701748f0851';
const response = await fetch(
`https://www.getdiro.com/api/v1/documents/${documentId}/download`,
{
headers: {
'Authorization': 'Bearer diro_your_api_key',
},
}
);
// Save the file
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'document.pdf';
a.click();
import requests
document_id = 'd290f1ee-6c54-4b01-90e6-d701748f0851'
response = requests.get(
f'https://www.getdiro.com/api/v1/documents/{document_id}/download',
headers={'Authorization': 'Bearer diro_your_api_key'},
)
with open('document.pdf', 'wb') as f:
f.write(response.content)
Binary file content (PDF or PNG)
Content-Type: application/pdf
Content-Disposition: attachment; filename="document-{id}.pdf"
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Document is not ready. Current status: processing"
},
"meta": {
"timestamp": "2025-01-22T10:35:00.000Z"
}
}
{
"success": false,
"error": {
"code": "DOCUMENT_NOT_FOUND",
"message": "Document not found"
},
"meta": {
"timestamp": "2025-01-22T10:35:00.000Z"
}
}
Download the document file directly. Only available for documents with
completed status.
string
required
The document ID
curl -O https://www.getdiro.com/api/v1/documents/d290f1ee-6c54-4b01-90e6-d701748f0851/download \
-H "Authorization: Bearer diro_your_api_key"
const documentId = 'd290f1ee-6c54-4b01-90e6-d701748f0851';
const response = await fetch(
`https://www.getdiro.com/api/v1/documents/${documentId}/download`,
{
headers: {
'Authorization': 'Bearer diro_your_api_key',
},
}
);
// Save the file
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'document.pdf';
a.click();
import requests
document_id = 'd290f1ee-6c54-4b01-90e6-d701748f0851'
response = requests.get(
f'https://www.getdiro.com/api/v1/documents/{document_id}/download',
headers={'Authorization': 'Bearer diro_your_api_key'},
)
with open('document.pdf', 'wb') as f:
f.write(response.content)
Binary file content (PDF or PNG)
Content-Type: application/pdf
Content-Disposition: attachment; filename="document-{id}.pdf"
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Document is not ready. Current status: processing"
},
"meta": {
"timestamp": "2025-01-22T10:35:00.000Z"
}
}
{
"success": false,
"error": {
"code": "DOCUMENT_NOT_FOUND",
"message": "Document not found"
},
"meta": {
"timestamp": "2025-01-22T10:35:00.000Z"
}
}
You can also use the
pdfUrl from the document response to download the file directly without authentication.⌘I