Skip to main content
GET
/
api
/
v1
/
leads
/
{leadId}
/
documents
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..."
            }
          ]
        }
      }
    ]
  }
]
This endpoint fetches all documents associated with a specific lead.

Path Parameters

leadId
string
required
The unique identifier of the lead

Response

documents
array
Array of document objects
Signed URLs expire after 1 hour. Use Get Document API to get a fresh signed URL.
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..."
            }
          ]
        }
      }
    ]
  }
]