# API to Create Sales Task

**URL:** <https://community.hubspot.com/t/api-to-create-sales-task/39759>\
**Category:** APIs & Integrations\
**Tags:** php\
**Created:** [June 29, 2021, 11:23am UTC](https://community.hubspot.com/t/api-to-create-sales-task/39759 "2021-06-29T11:23:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JFRubio](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jfrubio/32/2401_2.png) [@JFRubio](https://community.hubspot.com/u/JFRubio)\
**Post date:** [June 29, 2021, 11:23am UTC](https://community.hubspot.com/t/api-to-create-sales-task/39759/1 "2021-06-29T11:23:08Z")

</div>

Hi.

Is there any API to create a Sales Task ?

Thanks

---

<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:** [June 29, 2021, 6:12pm UTC](https://community.hubspot.com/t/api-to-create-sales-task/39759/2 "2021-06-29T18:12:04Z")

</div>

@JFRubio

I would check out the [engagements api](https://legacydocs.hubspot.com/docs/methods/engagements/engagements-overview)

```lia-code-sample
For tasks, the type needs to be "TASK"
The 'Assigned to' field will be the owner set by the ownerId in the engagement data.
The metadata format is:
"metadata": {
 "body": "This is the body of the task.",
 // String; The body or details of the task
 "subject": "Task title"
 // String; The subject or title of the task
 "status": "NOT_STARTED",
 // String; One of NOT_STARTED, COMPLETED, IN_PROGRESS, WAITING, or DEFERRED.
 // The status of the task
 "forObjectType": "CONTACT"
 // String; One of CONTACT or COMPANY, what object type the task is for.
}

```

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [June 30, 2021, 10:50am UTC](https://community.hubspot.com/t/api-to-create-sales-task/39759/3 "2021-06-30T10:50:57Z")

</div>

Hi @JFRubio ,  
Please check below api documentation for create task in HubSpot :  
[https://legacydocs.hubspot.com/docs/methods/engagements/create\_engagement](https://legacydocs.hubspot.com/docs/methods/engagements/create_engagement)  
For “TASK”  
The metadata format is:  
“metadata”: {  
“body”: “This is the body of the task.”,  
“subject”: “Task title”,  
“status”: “NOT\_STARTED”,  
“forObjectType”: “CONTACT”  
}

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![BMatthews](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bmatthews/32/68963_2.png) [@BMatthews](https://community.hubspot.com/u/BMatthews)\
**Post date:** [June 30, 2021, 5:14pm UTC](https://community.hubspot.com/t/api-to-create-sales-task/39759/4 "2021-06-30T17:14:59Z")

</div>

If you don’t have a specific Owner / Owner ID, will it still work? Would it potentially default to a certain user?

I ask, b/c we have an app (Campaign Wizard) that clones and transfers workflows for HubSpot users. We won’t be able to define who the Owner of a Task / Email will be… If it does require to specify an Owner, any ideas on a workaround for that?

Thanks!
