Update Leads via REST API
If you're looking to automate the updating of leads then we allow you to perform various amendments through the REST API.
This includes updating lead data and updating lead financials. The below article should give you more information on performing these updates!
To update leads via the REST API, first, you'll need to set up your API key. You can learn more about creating a key HERE.
For this request, you will need to allow lead Updates & lead financials under the permission block of your key.
Allow updates, select "Update"
Allow financial updates select "Update Payout/Revenue"
Lead Data Update
If you capture partial lead data on a form and then want to update that lead with the FULL info further down the line, then this request is for you!
To update the lead data, you'd need to run the below request on a VALID lead in your campaign:
[PUT] https://{account}.leadbyte.co.uk/restapi/v1.3/leads
{
"leads": [
{
"id": "2932682",
"update": {
"postcode": "TN25 6QD"
}
}
]
}
Headers:
X_KEY: cb266b24ef4a5d123s42ca5801431120
Populate the "id" field with the Lead ID you intend on updating and then include any fields you want to update in the "update" array.
Response:
{
"status": "Success",
"message": "OK",
"leads": [
{
"id": "2932682",
"success": true,
"message": "Lead updated",
"warnings": [],
"errors": []
}
]
}Lead data update and trigger delivery
You can combine a lead data update with triggering a delivery in a single request. This is ideal when you want to push an updated lead straight to a buyer without making multiple calls.
Note: This only works for valid leads and for deliveries configured to trigger manually via the REST API.
Request -
[PUT] https://{account}.leadbyte.co.uk/restapi/v1.3/leads
{
"leads": [
{
"id": "2932682",
"triggerDeliveryId": "1053",
"update": {
"postcode": "TN25 6QD"
}
}
]
}
Headers:
X_KEY: cb266b24ef4a5d123s42ca5801431120
FOR TRIGGERING MULTIPLE DELIVERIES:
triggerDeliveryIds can be used, listing the IDs in an array
The ID to be populated here would be found in the settings of your delivery:
Update data for multiple leads and reprocess the leads:
All of these update calls can be performed for either a single lead or multiple leads. The example below shows how to update several leads at once and reprocess them within the same request. You can use the same structure for a single‑lead update by following the payload format shown in the examples above.
Request -
[PUT] https://{account}.leadbyte.co.uk/restapi/v1.3/leads
{
"leads": [
{
"id": "2932682",
"action" : "reprocess",
"update": {
"postcode": "TN25 6QD"
}
},
{
"id": "2932683",
"action" : "reprocess",
"update": {
"firstname": "Joe",
"lastname": "Blogs"
}
},
{
"id": "2932684",
"action" : "reprocess",
"update": {
"postcode": "7010",
"source": "www.LeadByte.com",
"c1": "GoogleAdWords"
}
}
]
}
Headers:
X_KEY: cb266b24ef4a5d123s42ca5801431120Lead Financial update
This administrator‑level update allows you to modify the Payout awarded to the Supplier and/or the Revenue attributed to a lead. This feature is commonly used by clients operating an offline sales model. For example, a call centre may award a payout to a supplier after successfully switching a customer to a new mobile phone contract. In these cases, they may also update the Revenue to ensure campaign P&L reporting remains accurate.
To update the payout and/or revenue for a lead, the lead must first be marked as Approved. It is not possible to update financials for leads marked as rejected or unsold. Below is an example of an update request—if successful, the response will include "status": "Success".
Note: A Buyer does not need to be associated with the lead for this update to work, though it is considered good practice for reporting accuracy.
[PUT] https://{account}.leadbyte.co.uk/restapi/v1.3/leadfinancials
{
"key": "822acf66313a480c9fde66d8fce8fb7f",
"leads": [
{leadID}
],
"newPayout": 80.00,
"newRevenue": 120.00,
"BID": "33"
}
If you want to perform updates to a quarantined lead then check this article out
Update and processing quarantine leads via REST API
As always, please feel free to raise a support ticket with any questions or concerns you might have.
Comments