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": "6e1f8dd6-d582-4a92-8770-2a21b1f0573b",
    "filename": "driver-li.jpg",
    "mimeType": "image/jpeg",
    "size": 484222,
    "metadata": {
      "documentType": "Driver's License",
      "extractionStatus": "completed",
      "lastProcessed": "2025-10-13T19:45:42.292Z"
    },
    "signedUrl": "https://omniai-server-v2-dev.s3.us-east-2.amazonaws.com/...",
    "createdAt": "2025-10-13T19:45:00.215Z"
  }
]
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
id
string
Unique identifier for the document
filename
string
Original filename
mimeType
string
MIME type of the document (e.g., “application/pdf”, “image/jpeg”)
size
number
File size in bytes
metadata
object
Document metadata including classification and processing status
metadata.documentType
string
Classified document type
metadata.extractionStatus
string
Status of document extraction (e.g., “completed”)
signedUrl
string
Pre-signed URL for accessing the document (expires after 1 hour)
createdAt
string
ISO 8601 timestamp when the document was created
Signed URLs expire after 1 hour. Request a new document to get a fresh signed URL if needed.
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": "6e1f8dd6-d582-4a92-8770-2a21b1f0573b",
    "filename": "driver-li.jpg",
    "mimeType": "image/jpeg",
    "size": 484222,
    "metadata": {
      "documentType": "Driver's License",
      "extractionStatus": "completed",
      "lastProcessed": "2025-10-13T19:45:42.292Z"
    },
    "signedUrl": "https://omniai-server-v2-dev.s3.us-east-2.amazonaws.com/...",
    "createdAt": "2025-10-13T19:45:00.215Z"
  }
]