Skip to main content

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 /saveLead

Authentication

This endpoint requires your CRM API key passed in the request headers. You can find this key in your Pro Account Settings

HeaderTypeRequiredDescription
x-api-keystringYesYour 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:

KeyTypeRequiredDescription
addressstringYesThe lead’s address. This should include a postcode.
customerContactDetailsobjectYesThe lead’s contact details (see breakdown below).
customerContactDetails.namestringYesFull name of the lead
customerContactDetails.emailstringYesEmail address of the lead
customerContactDetails.phonestringYesPhone number of the lead
crmRequestbooleanYesMust be set to "true"
Example request 
curl -X POST https://api.easypv.com/saveLead \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY_HERE" \
  -d '{
    "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 /fetchLead

Authentication

This endpoint requires your CRM API key passed in the request headers. You can find this key in your Pro Account Settings

HeaderTypeRequiredDescription
x-api-keystringYesYour CRM connections API key, which can be found in your Pro Account Settings.
Example Request
curl -X GET https://api.easypv.com/fetchLeads \
  -H "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",
        "billable": 1
    },
  ...
]
x Error

If something goes wrong, an error response will be returned.

{
  "status": "error",
  "message": "Failed to fetch leads."
}