Create batch tasks association error

Hello! I’m trying to create a batch of tasks with deal association. Here is a request from your crm tasks specification:

curl --request POST \
--url https://api.hubapi.com/crm/v3/objects/tasks/batch/create \
--header ‘authorization: Bearer CIGHuLT0MBIRAAECUAAAASIAAAD8BwEAYAUYx-eKAiCS3OgWKIfWDTIUmLl9JluriXBb22mAENDY3A88KXY6NgAAAEEAAAAAAPgDAAAAAAAAhgAAAAAAAAAAACAAAAAOAOAxAAAAAADA__8fABDwAwAAgD8cA0IURUDfw8ZlndtT6OIjAgI4niaSAuxKA25hMVIAWgA’ \
--header ‘content-type: application/json’ \
--data ‘{
“inputs”: [
{
“properties”: {
“hs_timestamp”: “2019-10-30T03:30:17.883Z”,
“hs_task_body”: “Send Proposal”,
“hubspot_owner_id”: “51065148”,
“hs_task_subject”: “Follow-up for Brian Buyer”,
“hs_task_status”: “WAITING”,
“hs_task_priority”: “HIGH”
},
“associations”: [
{
“to”: {
“id”: “12814782598”
},
“types”: [
{
“associationCategory”: “HUBSPOT_DEFINED”,
“associationTypeId”: 215
}
]
}
]
}
]
}’

And here is validation error:

{
“status”: “error”,
“message”: “invalid from object type 0-27 for associations to be created. expected: 0-3”,
“correlationId”: “53460c51-52fb-4216-bf7f-a3a0228515fa”,
“category”: “VALIDATION_ERROR”
}

What wrong with validation can you please take a look?

Hey, @PButkevich :waving_hand: What happens if you use “associationTypeId”: 216 in your request body?
I ask because if we look up the typeId for Tasks to Deals it returns as 216 not 215.
Example:

Request

GET {{API URL}}/crm/v4/associations/tasks/deals/labels

Response

{
 "results": [
 {
 "category": "HUBSPOT_DEFINED",
 "typeId": 216,
 "label": null
 }
 ]
}

This is because association labels are unidirectional.

Best,

Jaycee