# API Call to get only lead id

**URL:** <https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132>\
**Category:** Product Support\
**Created:** [August 23, 2022, 6:07am UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132 "2022-08-23T06:07:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [August 23, 2022, 6:07am UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/1 "2022-08-23T06:07:18Z")

</div>

Hi,

I am trying to see if I can just get the lead ID returned through an API call. I know that /api/contacs with search on email will give me the entire payload for a certain lead, however all I want is the lead ID.

Is this possible ?

---

<div class="post-metadata">

**Author:** ![sfahrenkrog1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sfahrenkrog1/32/4583_2.png) [@sfahrenkrog1](https://forum.mautic.org/u/sfahrenkrog1)\
**Post date:** [August 23, 2022, 7:52am UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/2 "2022-08-23T07:52:15Z")

</div>

Hey mikew

I’m not aware of such an endpoint. I’m curious: Why you need such an endpoint? What is the technical reason?

Greetings  
Sebastian

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [August 23, 2022, 8:56am UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/3 "2022-08-23T08:56:03Z")

</div>

Hi @sfahrenkrog1

Thanks for the quick reply. I am not that technical, however for example if I want to update a lead information via the API, I need to have their lead\_id.  
Specifically if I am trying to trigger a specific email I would use the API call  
`/api/emails/{{ **email_id** }}/contact/{{ **contact_id** }}/send`

So here I would need to first query the api to get the lead id

---

<div class="post-metadata">

**Author:** ![sfahrenkrog1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sfahrenkrog1/32/4583_2.png) [@sfahrenkrog1](https://forum.mautic.org/u/sfahrenkrog1)\
**Post date:** [August 23, 2022, 12:14pm UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/4 "2022-08-23T12:14:53Z")

</div>

Okay, thank you! I see.

I was hoping to maybe help you with other solutions we write for that problem but for this specific problem I don’t know any shortcut.

We wrote a little plugin with its own api endpoint to do free database queries. We provide that to all our customers to give them the chance to freely query the mautic database via api calls.

(That reminds me that I have to open source it on github)

Wish you a nice day!

- Sebastian

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [August 23, 2022, 1:23pm UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/5 "2022-08-23T13:23:23Z")

</div>

Nice. Interested in checking it out once you have put it on Github.

---

<div class="post-metadata">

**Author:** ![sfahrenkrog1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sfahrenkrog1/32/4583_2.png) [@sfahrenkrog1](https://forum.mautic.org/u/sfahrenkrog1)\
**Post date:** [August 23, 2022, 2:30pm UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/6 "2022-08-23T14:30:38Z")

</div>

I will notify you if it is ready! Think next week.

---

<div class="post-metadata">

**Author:** ![sdoering](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sdoering/32/8909_2.png) [@sdoering](https://forum.mautic.org/u/sdoering)\
**Post date:** [August 23, 2022, 8:40pm UTC](https://forum.mautic.org/t/api-call-to-get-only-lead-id/25132/7 "2022-08-23T20:40:45Z")

</div>

Sounds very interesting.

I would be interested to take a look at it.
