# Get tracking-ID of email send through API

**URL:** <https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132>\
**Category:** Product Support\
**Tags:** mautic-3\
**Created:** [December 22, 2021, 9:56pm UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132 "2021-12-22T21:56:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![imog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imog/32/3813_2.png) [@imog](https://forum.mautic.org/u/imog)\
**Post date:** [December 22, 2021, 9:56pm UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/1 "2021-12-22T21:56:17Z")

</div>

I’m using the REST-API of Mautic quite a lot, especially for sending emails from templates to individuals. In the GUI i can go to a contact and see that the mail was sent to him and also find the tracking-ID in the URL. The API call to send the mail does not contain that ID, and i wonder how i could get it from there?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [December 23, 2021, 12:14am UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/2 "2021-12-23T00:14:21Z")

</div>

What endpoint are you calling specifically?

---

<div class="post-metadata">

**Author:** ![imog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imog/32/3813_2.png) [@imog](https://forum.mautic.org/u/imog)\
**Post date:** [December 23, 2021, 7:52am UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/3 "2021-12-23T07:52:30Z")

</div>

```auto
POST /emails/ID/contact/CONTACT_ID/send

```

[https://developer.mautic.org/#send-email-to-contact](https://developer.mautic.org/#send-email-to-contact)

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [December 27, 2021, 1:18am UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/4 "2021-12-27T01:18:20Z")

</div>

Hi,

sorry for late reply, I must have missed this topic a bit. I am not exactly sure which ID you are after can you attach some screenshots, please?

Thanks.

---

<div class="post-metadata">

**Author:** ![imog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imog/32/3813_2.png) [@imog](https://forum.mautic.org/u/imog)\
**Post date:** [December 27, 2021, 6:57am UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/5 "2021-12-27T06:57:27Z")

</div>

In a contact, list “History” and click on the text of one with a mail-symbol in:

 ![27-12-_2021_07-52-32](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cb899ddc6453068a628d8e6e8a4436f32036fd19.png)  
you get to a web-preview with the mail sent, and i’m interested in getting this URL using the API:  
 ![27-12-_2021_07-53-59](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9dd0dade423590ffb6466d718d5a717d1587fcc3.png)

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [December 28, 2021, 10:11am UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/6 "2021-12-28T10:11:08Z")

</div>

I will check what can be done and let you know, I hope I will be able to do it today.

Thanks.

---

<div class="post-metadata">

**Author:** ![imog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imog/32/3813_2.png) [@imog](https://forum.mautic.org/u/imog)\
**Post date:** [December 28, 2021, 12:17pm UTC](https://forum.mautic.org/t/get-tracking-id-of-email-send-through-api/22132/7 "2021-12-28T12:17:51Z")

</div>

Great! My intention is to give internal support-staff access to that preview of the mail sent to the contact.  
Meanwhile i found out that the ID i was looking for is called “tracking hash” inside of Mautic and can be looked up in the database table “email\_stats” using this SQL-Query:  
`SELECT * FROM mautic.email_stats where tracking_hash='61caf85f1fedb634381549';`  
But doing SQL directly to the database was not my idea, i’d really like to rely on the REST API.  
If i had time i tried to look into the code myself, but i’m too limited currently.

A problem could arise if the tracking-hash was not created during the API-call to send the mail… but let’s see what you find out!
