curl --request DELETE \
--url https://commerce.driv.ly/api/leads \
--header 'Authorization: <api-key>'{
"message": "<string>",
"errors": [
"<string>"
],
"docs": [
{
"updatedAt": "<string>",
"createdAt": "<string>",
"processStatuses": "Qualified Lead",
"reason": "Do Not Contact",
"latestEvent": 123,
"notes": "<string>",
"statusTracker": "<string>",
"searches": [
123
],
"attachments": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"call": "<string>",
"zipcode": "<string>",
"email": "<string>",
"loginEmail": "<string>",
"purchaseOption": "<string>",
"timeToPurchase": [
"ASAP"
],
"monthlyPayment": 123,
"budgetLower": "<string>",
"budgetUpper": "<string>",
"mileageLower": 123,
"mileageUpper": 123,
"cashDown": 123,
"newOrUsed": "<string>",
"bodyStyle": [
"truck"
],
"carStyle": [
"sedan"
],
"truckStyle": [
"crew"
],
"suvStyle": [
"small/compact"
],
"vanStyle": [
"cargo"
],
"yearLower": 123,
"yearUpper": 123,
"year": 123,
"make": "<string>",
"model": "<string>",
"exterior": [
"Silver"
],
"interior": [
"Black"
],
"fuelType": [
"Gasoline"
],
"drivetrain": [
"Four Wheel Drive"
],
"transmission": [
"Automatic"
],
"comfort": [
"Leather/premium Seats"
],
"safety": [
"Adaptive Cruise Control"
],
"entertainment": [
"Premium Audio System"
],
"utility": [
"Towing Package"
],
"subscribe": true,
"agree": true,
"customer": "<string>",
"messageNotifications": true,
"emailNotifications": true,
"emailAlerts": true,
"emailOffers": true,
"leadEvents": [
123
],
"cfZipcode": "<string>",
"cfState": "<string>",
"cfCity": "<string>",
"completedDate": "<string>",
"localTime": "<string>",
"trade": [
123
],
"messages": [
123
],
"creditScore": "<string>",
"contactScore": "<string>",
"contactBelongsTo": "<string>",
"contactType": "<string>",
"contactValid": true,
"testingCustomer": true,
"estimatedAgeRange": "<string>",
"estimatedAddress": "<string>",
"estimatedZipcode": "<string>",
"meetings": [
123
],
"makeAndModel": "<string>",
"conversation": "<string>",
"city": "<string>",
"state": "<string>",
"preApprovalId": "<string>",
"vdpEmails": [
123
],
"favorites": [
123
],
"calls": [
123
],
"salesRep": 123,
"preApprovals": [
123
],
"anonymousId": "<string>",
"manual": true,
"trim": "<string>",
"oneOwner": true,
"customers": 123
}
]
}Delete all Leads matching the where query
curl --request DELETE \
--url https://commerce.driv.ly/api/leads \
--header 'Authorization: <api-key>'{
"message": "<string>",
"errors": [
"<string>"
],
"docs": [
{
"updatedAt": "<string>",
"createdAt": "<string>",
"processStatuses": "Qualified Lead",
"reason": "Do Not Contact",
"latestEvent": 123,
"notes": "<string>",
"statusTracker": "<string>",
"searches": [
123
],
"attachments": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"call": "<string>",
"zipcode": "<string>",
"email": "<string>",
"loginEmail": "<string>",
"purchaseOption": "<string>",
"timeToPurchase": [
"ASAP"
],
"monthlyPayment": 123,
"budgetLower": "<string>",
"budgetUpper": "<string>",
"mileageLower": 123,
"mileageUpper": 123,
"cashDown": 123,
"newOrUsed": "<string>",
"bodyStyle": [
"truck"
],
"carStyle": [
"sedan"
],
"truckStyle": [
"crew"
],
"suvStyle": [
"small/compact"
],
"vanStyle": [
"cargo"
],
"yearLower": 123,
"yearUpper": 123,
"year": 123,
"make": "<string>",
"model": "<string>",
"exterior": [
"Silver"
],
"interior": [
"Black"
],
"fuelType": [
"Gasoline"
],
"drivetrain": [
"Four Wheel Drive"
],
"transmission": [
"Automatic"
],
"comfort": [
"Leather/premium Seats"
],
"safety": [
"Adaptive Cruise Control"
],
"entertainment": [
"Premium Audio System"
],
"utility": [
"Towing Package"
],
"subscribe": true,
"agree": true,
"customer": "<string>",
"messageNotifications": true,
"emailNotifications": true,
"emailAlerts": true,
"emailOffers": true,
"leadEvents": [
123
],
"cfZipcode": "<string>",
"cfState": "<string>",
"cfCity": "<string>",
"completedDate": "<string>",
"localTime": "<string>",
"trade": [
123
],
"messages": [
123
],
"creditScore": "<string>",
"contactScore": "<string>",
"contactBelongsTo": "<string>",
"contactType": "<string>",
"contactValid": true,
"testingCustomer": true,
"estimatedAgeRange": "<string>",
"estimatedAddress": "<string>",
"estimatedZipcode": "<string>",
"meetings": [
123
],
"makeAndModel": "<string>",
"conversation": "<string>",
"city": "<string>",
"state": "<string>",
"preApprovalId": "<string>",
"vdpEmails": [
123
],
"favorites": [
123
],
"calls": [
123
],
"salesRep": 123,
"preApprovals": [
123
],
"anonymousId": "<string>",
"manual": true,
"trim": "<string>",
"oneOwner": true,
"customers": 123
}
]
}Usage with the Drivly SDK
import { SDK } from '@drivly/commerce'
import type { leads } from '@drivly/commerce'
const sdk = new SDK(...)
const leads = await sdk.leads.unknown()
sort by field
pass a where query to constrain returned documents (complex type, see documentation)
Show child attributes
{
"or": [
{ "color": { "equals": "mint" } },
{
"and": [
{ "color": { "equals": "white" } },
{ "featured": { "equals": false } }
]
}
]
}limit the returned documents to a certain number
get a specific page of documents
number of levels to automatically populate relationships and uploads
retrieves document(s) in a specific locale
specifies a fallback locale if no locale value exists