const leadId = '4ef30123-90c2-4dc0-bd28-b43eee8664ea';
const options = {
method: 'GET',
headers: {
'x-api-key': '<your-api-key>',
},
};
fetch(`https://api-v2.getomni.ai/api/v1/leads/${leadId}/documents`, options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
[
{
"id": "4fa0d0de-6958-4d1f-9468-ebb8629eae8c",
"filename": "vital-checking-june-25.pdf",
"mimeType": "application/pdf",
"size": 153143,
"metadata": {
"extractionStatus": "completed",
"Matched checklist items": [
{
"leadChecklistItemId": "fb6c17f3-4d7e-4979-a262-9c287ae0e6dd",
"label": "Bank Statements"
}
]
},
"signedUrl": "https://omniai-server-v2-prod.s3.us-east-2.amazonaws.com/...",
"leadChecklistItemDocument": [
{
"id": "0e66ab12-af87-4dbc-956a-2063b4ecb552",
"leadChecklistItemId": "fb6c17f3-4d7e-4979-a262-9c287ae0e6dd",
"documentId": "4fa0d0de-6958-4d1f-9468-ebb8629eae8c",
"overallValid": true,
"validationResult": {
"otherNotes": "",
"overallValid": true,
"validationResults": [
{
"isValid": true,
"ruleName": "Files must be business bank statements",
"isValidReason": "The document is a business bank statement..."
}
]
}
}
]
}
]
Fetch all documents associated with a specific lead
const leadId = '4ef30123-90c2-4dc0-bd28-b43eee8664ea';
const options = {
method: 'GET',
headers: {
'x-api-key': '<your-api-key>',
},
};
fetch(`https://api-v2.getomni.ai/api/v1/leads/${leadId}/documents`, options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
[
{
"id": "4fa0d0de-6958-4d1f-9468-ebb8629eae8c",
"filename": "vital-checking-june-25.pdf",
"mimeType": "application/pdf",
"size": 153143,
"metadata": {
"extractionStatus": "completed",
"Matched checklist items": [
{
"leadChecklistItemId": "fb6c17f3-4d7e-4979-a262-9c287ae0e6dd",
"label": "Bank Statements"
}
]
},
"signedUrl": "https://omniai-server-v2-prod.s3.us-east-2.amazonaws.com/...",
"leadChecklistItemDocument": [
{
"id": "0e66ab12-af87-4dbc-956a-2063b4ecb552",
"leadChecklistItemId": "fb6c17f3-4d7e-4979-a262-9c287ae0e6dd",
"documentId": "4fa0d0de-6958-4d1f-9468-ebb8629eae8c",
"overallValid": true,
"validationResult": {
"otherNotes": "",
"overallValid": true,
"validationResults": [
{
"isValid": true,
"ruleName": "Files must be business bank statements",
"isValidReason": "The document is a business bank statement..."
}
]
}
}
]
}
]
Show documents
Show leadChecklistItemDocument
Show validationResult
const leadId = '4ef30123-90c2-4dc0-bd28-b43eee8664ea';
const options = {
method: 'GET',
headers: {
'x-api-key': '<your-api-key>',
},
};
fetch(`https://api-v2.getomni.ai/api/v1/leads/${leadId}/documents`, options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
[
{
"id": "4fa0d0de-6958-4d1f-9468-ebb8629eae8c",
"filename": "vital-checking-june-25.pdf",
"mimeType": "application/pdf",
"size": 153143,
"metadata": {
"extractionStatus": "completed",
"Matched checklist items": [
{
"leadChecklistItemId": "fb6c17f3-4d7e-4979-a262-9c287ae0e6dd",
"label": "Bank Statements"
}
]
},
"signedUrl": "https://omniai-server-v2-prod.s3.us-east-2.amazonaws.com/...",
"leadChecklistItemDocument": [
{
"id": "0e66ab12-af87-4dbc-956a-2063b4ecb552",
"leadChecklistItemId": "fb6c17f3-4d7e-4979-a262-9c287ae0e6dd",
"documentId": "4fa0d0de-6958-4d1f-9468-ebb8629eae8c",
"overallValid": true,
"validationResult": {
"otherNotes": "",
"overallValid": true,
"validationResults": [
{
"isValid": true,
"ruleName": "Files must be business bank statements",
"isValidReason": "The document is a business bank statement..."
}
]
}
}
]
}
]