# V3 API sending email

**URL:** <https://community.hubspot.com/t/v3-api-sending-email/32715>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [March 4, 2021, 10:37pm UTC](https://community.hubspot.com/t/v3-api-sending-email/32715 "2021-03-04T22:37:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JNguyen3](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnguyen3/32/60590_2.png) [@JNguyen3](https://community.hubspot.com/u/JNguyen3)\
**Post date:** [March 4, 2021, 10:37pm UTC](https://community.hubspot.com/t/v3-api-sending-email/32715/1 "2021-03-04T22:37:04Z")

</div>

I’m using the API to send email but it throw error “This app hasn’t been granted all required scopes to make this call. Read more about required scopes here”

hubspotClient.marketing.transactional.defaultApi.sendEmail({

```auto
  emailId: '123',

  message: {

    from: 'abc@gmail.com',

    to: 'aaa@gmail.com',

  },

```

});

Then, I followed this [GitHub - HubSpot/hubspot-api-nodejs: HubSpot API NodeJS Client Libraries for V3 version of the API · GitHub](https://github.com/HubSpot/hubspot-api-nodejs#oauth) and added

this API but it alerts ‘missing or unknown auth code’,

const clientId = ‘exampleID’;

const redirectUri = `'www.abc.com`’;

const scope = ‘contacts’;

const uri = await hubspotClient.oauth.getAuthorizationUrl(

```auto
clientId,

redirectUri,

scope

```

);

hubspotClient.oauth.defaultApi

```auto
  .createToken(

    'authorization\_code',

    uri, // the code you received from the oauth flow

    redirectUri,

    clientId,

    'aaa-aaa-aaa'

  )

  .then((val) => console.log(val));

```

hubspotClient.marketing.transactional.defaultApi.sendEmail({

```auto
  emailId: '123',

  message: {

    from: 'abc@gmail.com',

    to: 'aaa@gmail.com',

  },

```

});

The OAuth is so confusing to implement

---

<div class="post-metadata">

**Author:** ![JNguyen3](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnguyen3/32/60590_2.png) [@JNguyen3](https://community.hubspot.com/u/JNguyen3)\
**Post date:** [March 5, 2021, 7:55pm UTC](https://community.hubspot.com/t/v3-api-sending-email/32715/2 "2021-03-05T19:55:35Z")

</div>

can anyone from Hubspot help me? Is there any example that I can use sendEmail API without using OAuth? It’s confusing to implement

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 8, 2021, 2:27pm UTC](https://community.hubspot.com/t/v3-api-sending-email/32715/3 "2021-03-08T14:27:56Z")

</div>

@JNguyen3 , You will need to purchase the transactional email add on to send emails. [Here](https://www.hubspot.com/company/contact) is a link to get in touch with a HubSpot representative
