Leads: Save & Fetch
WeThis haveguide covers the 2 API endpoints.endpoints that handle leads.
YouPOSTcan/sqt/saveLeadUse this endpoint to insert
leadsafrom your CRM into the Leads Dashboard using our Save Lead endpoint.You can fetch your leads using our Fetch Leads endpoint.
Save Lead
Insert leadslead that comecomes from sources that aren't Speedy PV.
Endpoint
Authentication
Endpoint:
POST https://[DOMAIN]/api/v1/sqt/saveLead
Headers:
Authentication
X-API-KEY:endpoint[YOUR_API_KEY]requires(Replace[YOUR_API_KEY]with yourCRMactual APIkeykey.)
This
Request structure
Every request to update a project must contain the following. The customerContactDetails must be an object with name , email and phone as fields.
Address: The lead's address should include the postcode
Customer Contact Details: Use the customerContactDetails object to pass in the request headers. You can find this key in your Pro Account Settings
Request body
The request must include a JSON object with the following fields:
| - |||
| Full name of the | lead.
|||
| Email address of the | lead.
|||
| Phone number of the lead.
Please ensure valid contact details are provided, otherwise the lead |
Example API request and response
Example requestAPI Request
Below is an example using curl that demonstrates how to save a lead with the require fields:
curl --locationX 'https://easy-pv.co.uk/api/v1/sqt/saveLead' \
--headerH 'x-api-key: YOUR_API_KEY_HERE' \
--headerH 'Content-Type: application/json' \
--data-rawd '{
"address": "123 Main St",
"customerContactDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "1234567890"
}
}'
Responses
Success (200)Response
IfA thesuccessful lead is saved successfully, youcall will receive.return a JSON object containing a leadId.
{
"status": "success",
"leadID": [the ID of your new lead]
}
x Error
If
GET an error response will be returned with details in the body.
Notes
- /sqt/fetchLeads
AllUse threethis fields (address, customerContactDetails, and crmRequest) are required.
Make sure crmRequest is setendpoint to true if you are inserting the lead from a CRM integration.
Ensure valid contact details are provided, otherwise the lead may not be stored properly.
Fetch Leads
Getget all the leads from your leads dashboard so that you can see them in your CRM!CRM.
Endpoint
Authentication
Endpoint:
GETPOST https://[DOMAIN]/api/v1/sqt/fetchLeadsfetchLead
Headers:
Authentication
X-API-KEY:endpoint[YOUR_API_KEY]requires(Replace[YOUR_API_KEY]with yourCRMactual APIkeykey.)
This
Request structure
You can findalso thisinclude keya instartDate yourand ProendDate Accountto Settingsfetch leads within a specified date range.
startDate | |||
Parameters
endDate | |||
Example
|
Example Requests
leads:
curl -X 'https://easy-pv.co.uk/api/v1/sqt/fetchLeads' \
-locationH 'x-api-key: YOUR_API_KEY_HERE'
Here is an example that uses startDate and endDate:
curl -X 'https://easy-pv.co.uk/api/v1/sqt/fetchLeads?startDate=2025-03-21&endDate=2025-08-10' \
--headerH 'x-api-key: YOUR_API_KEY_HERE'
curl --location 'https://easy-pv.co.uk/api/v1/sqt/fetchLeads' \
--header 'x-api-key: YOUR_API_KEY_HERE'Responses
Success (200)Response
IfA thesuccessful request is successful, youcall will receivereturn a JSON Arrayarray of lead objects, that looklooks like thisthis:
[
{
"ID": 1,
"dateCreated": "2025-03-11T11:03:29.000Z",
"status": "new",
"customerName": "John Doe",
"address": "8 The Rowans, Milton, Cambridge, Cambridgeshire, CB24 6YU",
"customerEmail": "test@test.com",
"customerPhone": "07111111111",
"origin": "https://easy-pv.co.uk/speedy-pv",
},
...
]
x Error
If something goes wrong, an error response will be returned.
{
"status": "error",
"message": "Failed to fetch leads."
}