# Marketing Email API and authentication

**URL:** <https://community.hubspot.com/t/marketing-email-api-and-authentication/65807>\
**Category:** APIs & Integrations\
**Created:** [September 23, 2022, 11:03pm UTC](https://community.hubspot.com/t/marketing-email-api-and-authentication/65807 "2022-09-23T23:03:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PKamble2](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@PKamble2](https://community.hubspot.com/u/PKamble2)\
**Post date:** [September 23, 2022, 11:03pm UTC](https://community.hubspot.com/t/marketing-email-api-and-authentication/65807/1 "2022-09-23T23:03:39Z")

</div>

Hi,  
We have been using apikey to authenticate single send api to send email in our integration.  
As per [Authentication overview - HubSpot docs](https://developers.hubspot.com/docs/api/intro-to-auth) , should we migrate to Oauth authentication since apikey is going to be sunset?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 26, 2022, 3:25pm UTC](https://community.hubspot.com/t/marketing-email-api-and-authentication/65807/2 "2022-09-26T15:25:03Z")

</div>

Hey, @PKamble2 👋 That is correct. If you are using an endpoint that uses OAuth or an API key for Authorization, such as the [Send a single transactional email API:](https://legacydocs.hubspot.com/docs/methods/email/transactional_email/single-send-overview)

`POST /email/public/v1/singleEmail/send`

will need to be updated to use OAuth before the [sunset](https://developers.hubspot.com/changelog/upcoming-api-key-sunset) in November — [Working with OAuth](https://developers.hubspot.com/docs/api/working-with-oauth)

— Jaycee

---

<div class="post-metadata">

**Author:** ![PKamble2](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@PKamble2](https://community.hubspot.com/u/PKamble2)\
**Post date:** [September 28, 2022, 2:37am UTC](https://community.hubspot.com/t/marketing-email-api-and-authentication/65807/3 "2022-09-28T02:37:49Z")

</div>

Hi Jaycee.  
Thanks for clarification.  
I created a Private App for my account and am using the default static bearer token for authentiating my api calls.  
When I invoke /crm/v3/objects/contacts APIs, I am seeing those calls under my private app logs.  
However with single send api, [Send a single transactional email API:](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flegacydocs.hubspot.com%2Fdocs%2Fmethods%2Femail%2Ftransactional_email%2Fsingle-send-overview&data=05%7C01%7Cprashant.kamble%40carringtonmh.com%7Cf63ef2dbf9414f976d6d08da9fd34acc%7C3e8082766b7e41eabccbd9ef5ccf7df4%7C0%7C0%7C637998027110730543%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hUOXsRS2BCY4R%2B0li%2B4cI3DovFRNUJBQLZ1YdHDujXU%3D&reserved=0) I was able to send email, but I do not see the log of this call under my ‘Private app’ logs.

Am I missing something? Is this behaviorof the logs for the Public api normal?

Also how can I change the static bearer token to create dynamic token by using secret and client id for my ‘Private app’?

Apprerciate your reposne soon.
