prospects. These examples use https://api.demand-iq.com/api/v1.0, which is separate from the AI Presentations API.
Export leads
Read leads from Demand IQ and save them in another system.
Import leads
Create a lead and add its contact information.
Two-way sync
Read leads and send agreed changes back to Demand IQ.
Create and store your key
- Open Settings → Company → API Keys in the Demand IQ dashboard.
- Select Add New API Key, then choose the objective that matches your connection. Use Custom to select permissions individually.
- Review the permissions before saving. The export and two-way sync presets include read and write permissions for several kinds of lead data. For a read-only export key, choose Custom and select only
prospects:read. A permission controls which data the key can read or change; an API may call it a scope. - Copy the key when it appears and store it in your server’s secret storage or your integration’s secure connection settings. Check its expiration date.
Authorization header on every request:
DIQ_API_KEY in your server environment. Each example checks the HTTP result before using the response.
Appointments, notes, attachments, and other related data have separate permissions. Only select them if your connection uses their endpoints. A key is associated with a company; use a key for the company whose leads you want to access.
Send leads to another tool
Required permission:prospects:read.
Read company leads over HTTP
CallGET /prospects/company to read company lead summaries, including available contact details. This endpoint requires company-level access; a key acting as a sales representative cannot use it.
An illustrative
200 OK response:
result is the array of leads. Field names are case-sensitive: company summaries use ProspectId and ContactEmail, while city, state, and zipCode are lowercase. Contact values can be null. page is the page number; total is the number of records in this response, not the company-wide count. Continue until result has fewer records than your requested limit.
This server-side example reads every page. Replace saveLead with a write to your destination, using ProspectId as the saved Demand IQ identifier so a repeat export updates the same record.
Export with Zapier
A scheduled Zap can read leads and write them to your destination:- Use Schedule by Zapier as the trigger.
- Add a Webhooks by Zapier → GET action. Set the URL to
https://api.demand-iq.com/api/v1.0/prospects/companyand query parameters tolimit=100,offset=0, andorderBy=prospect_id. - Add an
Authorizationheader with valueBearer YOUR_API_KEY, and anAcceptheader with valueapplication/json. Leave Basic Auth empty. - Test the request. Use the records in
resultas line items for a Looping by Zapier step. - Inside the loop, find or update the destination record by
ProspectId; create it only if it does not exist. MapContactName,ContactEmail, andContactPhoneNumberto your destination fields.
This Zap reads one page. If it returns 100 records, retrieve subsequent pages by increasing
offset, or use the paginated server example above. Do not publish a one-page Zap as a complete export for a company with more than 100 leads. Check that your Zapier plan supports the selected actions.result can mean the company has no matching leads or the wrong company’s key was used. A 403 can mean the read permission or company-level access is missing. If only the first 100 leads appear, add pagination. Repeated destination records mean the Zap needs to find or update by ProspectId before creating.
Bring leads into DIQ
Required permissions:prospects:write and contacts:write.
Create the address record with POST /prospects, then use its returned id to add a contact with POST /prospects/{id}/contact. Adding firstName or email to the first request does not create the contact.
The first call looks up the address. If it cannot resolve it, correct the address before retrying. Call from your server when another system receives a new lead:
201 Created with an address record. Response excerpt:
locationId, unit, userId, companyId, closer, averageUtilityBill, wasOnsite, and creation/update timestamps and user IDs. Save id as the connection between your source record and the Demand IQ lead.
The contact call returns 201 Created:
/prospects URL, JSON payload, the four address fields, and the authorization header above. Add a second POST action to /prospects/{id}/contact, mapping id from the first response and the contact fields from the trigger. Save the source-to-Demand IQ ID mapping before enabling retries.
Troubleshooting: 400 may indicate a missing address field, an unresolved address, or invalid contact data. If the lead succeeds and the contact fails, retry only the contact call using the saved lead ID. An existing contact produces a conflict; reconcile it before using PUT /prospects/{id}/contact. Replaying the entire create sequence can create duplicates; do not assume repeated POSTs are deduplicated.
Two-way sync
Required permissions:prospects:read, contacts:read, and contacts:write for the contact example below. Add prospects:write for the import flow above or address updates.
Use the export flow to read leads and the import flow to create missing records. Keep a mapping between the other system’s record ID and the Demand IQ ProspectId/id.
For an existing lead, read its contact with GET /prospects/{id}/contact (contacts:read). It returns 200 OK with the same contact fields shown above. To change it, send PUT /prospects/{id}/contact (contacts:write).
200 OK:
PUT /prospects/{id} requires locationId, latitude, longitude, address, city, state, and zipCode. It is a full update, not a partial PATCH. Read the current lead with GET /prospects/{id} first; its response includes these fields. Include the existing unit and averageUtilityBill if you want to preserve them: omitting unit clears it, and omitting averageUtilityBill resets it to 0.
Before enabling two-way sync:
- Choose who owns each field. For example, your CRM owns email and Demand IQ owns lead status. Decide what happens when both systems change the same field before copying it.
- Prevent loops. Compare stored values before writing; do not send an unchanged record back just because your own update triggered the other system.
- Use saved IDs. Do not match only by name or email, and do not assume a create request has an idempotency key (a value that makes repeated requests count as one operation).
- Reconcile regularly. The company list’s
start/endfilters concern lead or disposition creation, not every change to a lead.Updatedis not a guaranteed change feed for contact edits. A timestamp-only poll can miss changes; periodically re-read records and compare fields. - Handle retries deliberately. Retry temporary read failures with a delay. After an uncertain write result, read the saved record to confirm whether it succeeded before repeating it.
start, end, or Updated captures all contact edits. If PUT fails because no contact exists, check the lead ID and create the contact first.
Troubleshoot your connection
If you need help, send Demand IQ support the endpoint, HTTP status, and time of the request. Do not send the API key or a customer’s personal information.