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

SOLVE
Highlighted
New Contributor

 

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

 

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Community Manager

Hi @abrkhan,

 

When looking to create a task with email type engagement using the Create an Engagement | Engagements API, you can do so by adding the taskType key under metadata. Example below:

 

For EMAIL task type:

{
    "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:

{
    "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:

{
    "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"
    }
}
Reply
0 Upvotes
2 Replies 2
Community Manager

Hi @abrkhan,

 

When looking to create a task with email type engagement using the Create an Engagement | Engagements API, you can do so by adding the taskType key under metadata. Example below:

 

For EMAIL task type:

{
    "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:

{
    "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:

{
    "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"
    }
}
Reply
0 Upvotes
New Contributor

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

Reply
0 Upvotes