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

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

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

Using "*leadsbyfield*" you will be able to search the Lead by Email, Whatsapp, Mobile, etc. Ideally it should be a UNIQUE field to avoid the risk of changing multiple Leads that have the same information.

Let's take 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 the name of your license 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 executed, the return 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 will see that the field was changed:

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sprinthub.com/en/topics/api/api-changing-lead-data-using-any-field-as-a-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
