# Adding Type (Email) to an Engagement Task via HUBSPPOT API

**URL:** <https://community.hubspot.com/t/adding-type-email-to-an-engagement-task-via-hubsppot-api/17580>\
**Category:** APIs & Integrations\
**Tags:** cms-content, developer-tools, contacts\
**Created:** [December 5, 2019, 4:55pm UTC](https://community.hubspot.com/t/adding-type-email-to-an-engagement-task-via-hubsppot-api/17580 "2019-12-05T16:55:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abrkhan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/abrkhan/32/76793_2.png) [@abrkhan](https://community.hubspot.com/u/abrkhan)\
**Post date:** [December 5, 2019, 4:55pm UTC](https://community.hubspot.com/t/adding-type-email-to-an-engagement-task-via-hubsppot-api/17580/1 "2019-12-05T16:55:08Z")

</div>

I would like to add a type (like Email) to a hubspot engagement task via hubspot API, however there is no clear way of doing this via API

On the other hand the UI has an option.

Any suggestions on how I can do this through the API would be really appreciated !

Many thanks

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [December 6, 2019, 3:27am UTC](https://community.hubspot.com/t/adding-type-email-to-an-engagement-task-via-hubsppot-api/17580/2 "2019-12-06T03:27:06Z")

</div>

Hi @abrkhan,

When looking to create a task with email type engagement using the [Create an Engagement | Engagements API](https://developers.hubspot.com/docs/methods/engagements/create_engagement), you can do so by adding the _taskType_ key under metadata. Example below:

For **EMAIL** task type:

```auto
{
 "engagement": {
 "active": true,
 "ownerId": {{owner id}},
 "type": "TASK",
 "timestamp": 1409172644778
 },
 "associations": {
 "contactIds": [{{contact id}}],
 "companyIds": [],
 "dealIds": [],
 "ownerIds": []
 },
 "metadata": {
 "body": "via api",
"taskType": "EMAIL",
"subject":"this is an email task type"
 }
}

```

For **CALL** task type:

```auto
{
 "engagement": {
 "active": true,
 "ownerId": {{owner id}},
 "type": "TASK",
 "timestamp": 1409172644778
 },
 "associations": {
 "contactIds": [{{contact id}}],
 "companyIds": [],
 "dealIds": [],
 "ownerIds": []
 },
 "metadata": {
 "body": "via api",
"taskType": "CALL",
"subject":"this is an CALL task type"
 }
}

```

For **TODO** task type:

```auto
{
 "engagement": {
 "active": true,
 "ownerId": {{owner id}},
 "type": "TASK",
 "timestamp": 1409172644778
 },
 "associations": {
 "contactIds": [{{contact id}}],
 "companyIds": [],
 "dealIds": [],
 "ownerIds": []
 },
 "metadata": {
 "body": "via api",
"taskType": "TODO",
"subject":"this is an TODO task type"
 }
}

```

---

<div class="post-metadata">

**Author:** ![abrkhan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/abrkhan/32/76793_2.png) [@abrkhan](https://community.hubspot.com/u/abrkhan)\
**Post date:** [December 6, 2019, 10:59am UTC](https://community.hubspot.com/t/adding-type-email-to-an-engagement-task-via-hubsppot-api/17580/3 "2019-12-06T10:59:42Z")

</div>

Many thanks , this is really helpful - spend a lot of time tring to figure !
