Update Leads via REST API

Follow

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!

If you want to perform updates to a quarantined lead then check this article out instead -

Update and processing quarantine leads via REST API

 

REST API key settings

For lead data, ensure the "Leads > Update" permission is checked

cabe784c-0b84-4de9-80d6-3e30f63d420e.png

 

For lead financials, ensure the "Leads financials update" permission is checked

96705995-c149-4f1b-9f4e-e2ca27b7acfc.png

 

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.com/restapi/v1.2/leads
{
"key": "cb266b24ef4a5d123s42ca5801431120",
"leads": [
{
"id": "2932682",
"update": {
"postcode": "TN25 6QD"
}
}
]
}

 

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"
}
]
}

 

Lead data update and trigger delivery

We allow you to combo the lead data update with triggering a delivery in a single request. Great for when you want to send your newly updated lead straight to a buyer!

This only works on valid leads and deliveries which are triggered manually via the REST API.

 

Request - 

[PUT] https://{account}.leadbyte.com/restapi/v1.2/leads

{
"key": "cb266b24ef4a5b59b722ca5801431120",
"leads": [
{
"id": "2932682",
"triggerDeliveryIds": [
1053
],
"update": {
"postcode": "TN25 6QD"
}
}
]
}

 

This is the same as the lead data update request with the added "triggerdeliveryIds" section.

The ID to be populated here would be found in the settings of your delivery:

70c0a4fd-6a1a-4f0e-9ce3-b4cd847cba5e.png

 

Lead Financials Update
This is an administrator update, providing you the ability to update the Payout awarded to the Supplier and/OR the Revenue associated to the lead.  This is commonly used by clients that work an "offline" sales model.  An example of this would be a call centre that awards a payout to a supplier when they switch a customer for a new mobile phone contract.  They may also wish to update the Revenue to keep the P&L of a campaign in reporting accurate.


To update the payout and/OR revenue associated to a lead the lead needs to be marked as "Approved" in the first instance.  It is not possible to update the financials against a lead that has been marked as rejected/unsold.  Below is an example of an update request, if successful you will see "status": "Success".  NOTE: The lead does not need to have a Buyer associated to it, however it is good practise for your reporting to have this.

[PUT] https://{account}.leadbyte.co.uk/restapi/v1.2/leadfinancials
		{
			"key": "822acf66313a480c9fde66d8fce8fb7f",
			"leads": [
				{leadID}
			],
			"newPayout": 80.00,
			"newRevenue": 120.00,
			"BID": "33"
		}

 

As always, please feel free to raise a support ticket with any questions or concerns you might have.

Was this article helpful?
0 out of 0 found this helpful

Comments