Create an engagement
curl --request POST \
--url https://api.hubapi.com/engagements/v1/engagements \
--header 'Content-Type: application/json' \
--data '
{
"engagement": {
"active": true,
"ownerId": 123,
"timestamp": 123
},
"associations": {
"contactIds": [
123
],
"companyIds": [
123
],
"dealIds": [
123
],
"ownerIds": [
123
],
"ticketIds": [
123
]
},
"attachments": [
{
"id": 123
}
],
"metadata": {}
}
'import requests
url = "https://api.hubapi.com/engagements/v1/engagements"
payload = {
"engagement": {
"active": True,
"ownerId": 123,
"timestamp": 123
},
"associations": {
"contactIds": [123],
"companyIds": [123],
"dealIds": [123],
"ownerIds": [123],
"ticketIds": [123]
},
"attachments": [{ "id": 123 }],
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
engagement: {active: true, ownerId: 123, timestamp: 123},
associations: {
contactIds: [123],
companyIds: [123],
dealIds: [123],
ownerIds: [123],
ticketIds: [123]
},
attachments: [{id: 123}],
metadata: {}
})
};
fetch('https://api.hubapi.com/engagements/v1/engagements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/engagements/v1/engagements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'engagement' => [
'active' => true,
'ownerId' => 123,
'timestamp' => 123
],
'associations' => [
'contactIds' => [
123
],
'companyIds' => [
123
],
'dealIds' => [
123
],
'ownerIds' => [
123
],
'ticketIds' => [
123
]
],
'attachments' => [
[
'id' => 123
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/engagements/v1/engagements"
payload := strings.NewReader("{\n \"engagement\": {\n \"active\": true,\n \"ownerId\": 123,\n \"timestamp\": 123\n },\n \"associations\": {\n \"contactIds\": [\n 123\n ],\n \"companyIds\": [\n 123\n ],\n \"dealIds\": [\n 123\n ],\n \"ownerIds\": [\n 123\n ],\n \"ticketIds\": [\n 123\n ]\n },\n \"attachments\": [\n {\n \"id\": 123\n }\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hubapi.com/engagements/v1/engagements")
.header("Content-Type", "application/json")
.body("{\n \"engagement\": {\n \"active\": true,\n \"ownerId\": 123,\n \"timestamp\": 123\n },\n \"associations\": {\n \"contactIds\": [\n 123\n ],\n \"companyIds\": [\n 123\n ],\n \"dealIds\": [\n 123\n ],\n \"ownerIds\": [\n 123\n ],\n \"ticketIds\": [\n 123\n ]\n },\n \"attachments\": [\n {\n \"id\": 123\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/engagements/v1/engagements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"engagement\": {\n \"active\": true,\n \"ownerId\": 123,\n \"timestamp\": 123\n },\n \"associations\": {\n \"contactIds\": [\n 123\n ],\n \"companyIds\": [\n 123\n ],\n \"dealIds\": [\n 123\n ],\n \"ownerIds\": [\n 123\n ],\n \"ticketIds\": [\n 123\n ]\n },\n \"attachments\": [\n {\n \"id\": 123\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"engagement": {},
"associations": {},
"attachments": [
{}
],
"metadata": {}
}Engagements
Create an engagement
Use this endpoint to create an engagement (an email, call, meeting, task or note) on an object in HubSpot. Use case for this endpoint: This endpoint is useful for keeping your CRM records up-to-date on any interactions that take place outside of HubSpot. Activity reporting in the CRM also feeds off of this data.
Associations
You can associate engagements with objects to ensure they’re displayed correctly in the UI. Tasks created through HubSpot’s API will not trigger user notifications. For note-type engagements, the body of the note will be limited to 65536 characters.
POST
/
engagements
/
v1
/
engagements
Create an engagement
curl --request POST \
--url https://api.hubapi.com/engagements/v1/engagements \
--header 'Content-Type: application/json' \
--data '
{
"engagement": {
"active": true,
"ownerId": 123,
"timestamp": 123
},
"associations": {
"contactIds": [
123
],
"companyIds": [
123
],
"dealIds": [
123
],
"ownerIds": [
123
],
"ticketIds": [
123
]
},
"attachments": [
{
"id": 123
}
],
"metadata": {}
}
'import requests
url = "https://api.hubapi.com/engagements/v1/engagements"
payload = {
"engagement": {
"active": True,
"ownerId": 123,
"timestamp": 123
},
"associations": {
"contactIds": [123],
"companyIds": [123],
"dealIds": [123],
"ownerIds": [123],
"ticketIds": [123]
},
"attachments": [{ "id": 123 }],
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
engagement: {active: true, ownerId: 123, timestamp: 123},
associations: {
contactIds: [123],
companyIds: [123],
dealIds: [123],
ownerIds: [123],
ticketIds: [123]
},
attachments: [{id: 123}],
metadata: {}
})
};
fetch('https://api.hubapi.com/engagements/v1/engagements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/engagements/v1/engagements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'engagement' => [
'active' => true,
'ownerId' => 123,
'timestamp' => 123
],
'associations' => [
'contactIds' => [
123
],
'companyIds' => [
123
],
'dealIds' => [
123
],
'ownerIds' => [
123
],
'ticketIds' => [
123
]
],
'attachments' => [
[
'id' => 123
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/engagements/v1/engagements"
payload := strings.NewReader("{\n \"engagement\": {\n \"active\": true,\n \"ownerId\": 123,\n \"timestamp\": 123\n },\n \"associations\": {\n \"contactIds\": [\n 123\n ],\n \"companyIds\": [\n 123\n ],\n \"dealIds\": [\n 123\n ],\n \"ownerIds\": [\n 123\n ],\n \"ticketIds\": [\n 123\n ]\n },\n \"attachments\": [\n {\n \"id\": 123\n }\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hubapi.com/engagements/v1/engagements")
.header("Content-Type", "application/json")
.body("{\n \"engagement\": {\n \"active\": true,\n \"ownerId\": 123,\n \"timestamp\": 123\n },\n \"associations\": {\n \"contactIds\": [\n 123\n ],\n \"companyIds\": [\n 123\n ],\n \"dealIds\": [\n 123\n ],\n \"ownerIds\": [\n 123\n ],\n \"ticketIds\": [\n 123\n ]\n },\n \"attachments\": [\n {\n \"id\": 123\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/engagements/v1/engagements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"engagement\": {\n \"active\": true,\n \"ownerId\": 123,\n \"timestamp\": 123\n },\n \"associations\": {\n \"contactIds\": [\n 123\n ],\n \"companyIds\": [\n 123\n ],\n \"dealIds\": [\n 123\n ],\n \"ownerIds\": [\n 123\n ],\n \"ticketIds\": [\n 123\n ]\n },\n \"attachments\": [\n {\n \"id\": 123\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"engagement": {},
"associations": {},
"attachments": [
{}
],
"metadata": {}
}Body
application/json
Last modified on March 30, 2026
Was this page helpful?