API Endpoints
We have 2 API endpoints.
- You can insert leads from your CRM into the Leads Dashboard using our Save Lead endpoint.
- You can fetch your leads using our Fetch Leads endpoint.
Save Lead
Insert leads that come from sources that aren't Speedy PV.
Endpoint
POST /api/v1/sqt/saveLead
Authentication
This endpoint requires your CRM API key passed in the request headers. You can find this key in your Pro Account Settings
Header | Type | Required | Description |
x-api-key | string | Yes | Your CRM connections API key, which can be found in your Pro Account Settings. |
Request body
The request must include a JSON object with the following fields:
Key | Type | Required | Description |
address | string | Yes | The lead’s address. This should include a postcode. |
customerContactDetails | object | Yes | The lead’s contact details (see breakdown below). |
customerContactDetails.name | string | Yes | Full name of the lead |
customerContactDetails.email | string | Yes | Email address of the lead |
customerContactDetails.phone | string | Yes | Phone number of the lead |
crmRequest | boolean | Yes | Must be set to "true" |
Example request
curl --location 'https://easy-pv.co.uk/api/v1/sqt/saveLead' \
--header 'x-api-key: YOUR_API_KEY_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{
"address": "123 Main St",
"customerContactDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "1234567890"
},
"crmRequest": true
}'
Responses
Success (200)
If the lead is saved successfully, you will receive.
{
"status": "success",
"leadID": [the ID of your new lead]
}
x Error
If something goes wrong, an error response will be returned with details in the body.
Notes
-
All three fields (address, customerContactDetails, and crmRequest) are required.
-
Make sure crmRequest is set 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
Get all the leads from your leads dashboard so that you can see them in your CRM!
Endpoint
GET /api/v1/sqt/fetchLead
Authentication
This endpoint requires your CRM API key passed in the request headers. You can find this key in your Pro Account Settings
Header | Type | Required | Description |
x-api-key | string | Yes | Your CRM connections API key, which can be found in your Pro Account Settings. |
Parameters
Parameter | Type | Required | Description |
startDate | Date in the format 'Year-month-day' | No | The date from which to fetch leads |
endDate | Date in the format 'Year-month-day' | No | The date till which to fetch leads |
Example RequestRequests
curl --location 'https://easy-pv.co.uk/api/v1/sqt/fetchLeads?startDate=2025-03-21&endDate=2025-08-10' \
--header '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)
If the request is successful, you will receive a JSON Array of lead objects, that look like this
[
{
"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."
}