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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
