> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/api/api-changing-lead-data-using-any-field-as-a-reference.md).

# API - Changing Lead data using any field as a reference

Usually, to change data on a Lead via API, you need to know this Lead's ID, pass the ID parameter and the parameter for the field you want to change.

A simpler way to do this without needing to know the lead's ID is to use the call "*leadsbyfield*".

Using "*leadsbyfield*" you can look up the Lead by Email, Whatsapp, Mobile, etc. Ideally, it should be a UNIQUE field so you don't run the risk of changing several Leads that have the same information.

Let's take the Lead Bill Gates as an example.

<figure><img src="https://lh3.googleusercontent.com/FRYaaXvmAuieWk4p5zB7fxeLXOWEuy5M3Z5dfDFcesdWdMimPw0mjjP8CLmtFpscJ5EAKUZaysZGFdQy599wQ0NIsWSkXy0MHkjoAsa3niXHZQaEK3Q6pVNtqilMqNsUVWtQVy4yaB7XraOfmiPEohs" alt=""><figcaption></figcaption></figure>

Via API, we want to change Bill's first name to William. So, we will use the alias "firstname"

In the Postman example below:

Method = PUT

URL =  <https://sprinthub-api-master.sprinthub.app/leadsbyfield/email/billgates@teste.com?i=licenca\\&apitoken=XX>

Don't forget to add your license name in "i" and your token in "apitoken".

<figure><img src="https://lh3.googleusercontent.com/RTQj8ptpHW6Orm7AbMgjdId-0ohhE-G7P1xY74Kzg6eQw9v2Nl5tHSdIxNXXjMepKkAGJjPR-dv2nsZlsVth3Iq9JHYVVx3sp10MYZ04L5WhrpQiH9Qr-HUZ58AkwoQFSJThMhHgSYsfx_Rc3dzeZME" alt=""><figcaption></figcaption></figure>

When running it, the response should be **success: true**.

<figure><img src="https://lh6.googleusercontent.com/r9PhWbvezy9qNGwSlhl-hmzUm1M6wOdIP9qfIlfd7cEB2WkMS08CYBuA9QGsLejOnD6gVvpCeV_zSsrO2ZRCj-8ahBtStK7XNygBdBtYpd8eS-q8grSLy4QXl1-ajPc2GYmPxPxQNAOIKvXpeZXJfHA" alt=""><figcaption></figcaption></figure>

Now, just look at the Lead and you'll see that the field has been changed:

<figure><img src="https://lh5.googleusercontent.com/BVGI_dzq1teUt5fLv8yziamPJKv3-ut-z6b7LYbP5lzUgGeu6c2eQBbLIE332OKXJYe1e_opP6HEfSOglt2NvqmLMT1M42K2831AEzqED89SUQk3ati2w88rOOQXiK1qH7V5wW4oK_6PONYLHznLZXY" alt=""><figcaption></figcaption></figure>
