Database Source
Lead Fetch API
The Fetch Lead API allows users to retrieve stored lead data from the database source. This functionality is useful for validating data, generating reports, or ensuring seamless follow-ups.
GET
cURL
Overview
The Database Source Lead Fetch API retrieves lead records stored in a database source. It is designed for use cases such as lead validation lookups, deduplication checks, CRM syncs, and data exports. Leads can be looked up by field value (e.g.email or mobile) or retrieved as a paginated list.
Authentication uses the same database source API key as the Lead Posting API.
Endpoint
{db-source-id} with the MongoDB Object ID of the database source.
Authentication
Include the database source API key in theAuthorization header:
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
db-source-id | string | Yes | MongoDB Object ID of the database source |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | No | Filter by email address |
mobile | string | No | Filter by 10-digit phone number |
transaction_id | string | No | Fetch a specific lead by transaction ID |
lookup_id | string | No | Fetch by a custom lookup field value |
page | integer | No | Page number for paginated results (default: 1) |
limit | integer | No | Records per page (default: 10, max: 100) |
from | string | No | Start date filter (ISO 8601: YYYY-MM-DD) |
to | string | No | End date filter (ISO 8601: YYYY-MM-DD) |
Example Requests
Look Up by Email
Look Up by Mobile
Paginated List with Date Range
Example Responses
Success — Lead Found
Success — No Leads Found
Error — Invalid Source ID
Error — Unauthorized
Status Codes
| HTTP Code | Description |
|---|---|
| 200 | Request successful (leads array may be empty if none match) |
| 400 | Invalid source ID or query parameters |
| 401 | Invalid or missing API key |
| 500 | Internal server error |
Deduplication Check Endpoint
For a lightweight existence check (without retrieving the full record), use the dedupe check endpoint:isDuplicate flag and is faster than the full fetch for real-time deduplication at point of submission.
Tips
- Use specific filters. Fetching without filters pulls all leads and may be slow on large sources. Always filter by
email,mobile, ortransaction_idfor point lookups. - Pagination for exports. When exporting all leads, iterate through pages using
pageandlimit. ChecktotalRecordto determine how many pages to fetch (Math.ceil(totalRecord / limit)). - Field visibility. PII fields (email, mobile) are stored encrypted. The API decrypts and returns them in the response, but ensure your integration handles this data in compliance with your data privacy obligations.
- Atlas Search. Database sources with Elasticsearch/Atlas Search enabled support faster and case-insensitive field lookups. Contact your account manager to enable this for high-volume sources.
- Allowed fields. Only fields in the source’s allowed fields list are stored and returned. Fields outside this list are not present in fetch results.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Your database source ID
Query Parameters
Your lead's unique ID
Your lead's transaction ID
Your lead's mobile number
Your lead's email address
Your lead's unique identification code or unque code
cURL