Create HubSpot Timeline Event
curl --request POST \
--url https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_object_id": "{{company_id}}",
"event_type": "deployment_completed",
"event_title": "Production Deployment Completed",
"output_variable_name": "timeline_event",
"event_description": "Detailed description of what happened...",
"event_properties": "<string>",
"event_timestamp": "<string>"
}
'import requests
url = "https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event"
payload = {
"target_object_id": "{{company_id}}",
"event_type": "deployment_completed",
"event_title": "Production Deployment Completed",
"output_variable_name": "timeline_event",
"event_description": "Detailed description of what happened...",
"event_properties": "<string>",
"event_timestamp": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target_object_id: '{{company_id}}',
event_type: 'deployment_completed',
event_title: 'Production Deployment Completed',
output_variable_name: 'timeline_event',
event_description: 'Detailed description of what happened...',
event_properties: '<string>',
event_timestamp: '<string>'
})
};
fetch('https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event', 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-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event",
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([
'target_object_id' => '{{company_id}}',
'event_type' => 'deployment_completed',
'event_title' => 'Production Deployment Completed',
'output_variable_name' => 'timeline_event',
'event_description' => 'Detailed description of what happened...',
'event_properties' => '<string>',
'event_timestamp' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event"
payload := strings.NewReader("{\n \"target_object_id\": \"{{company_id}}\",\n \"event_type\": \"deployment_completed\",\n \"event_title\": \"Production Deployment Completed\",\n \"output_variable_name\": \"timeline_event\",\n \"event_description\": \"Detailed description of what happened...\",\n \"event_properties\": \"<string>\",\n \"event_timestamp\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_object_id\": \"{{company_id}}\",\n \"event_type\": \"deployment_completed\",\n \"event_title\": \"Production Deployment Completed\",\n \"output_variable_name\": \"timeline_event\",\n \"event_description\": \"Detailed description of what happened...\",\n \"event_properties\": \"<string>\",\n \"event_timestamp\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_object_id\": \"{{company_id}}\",\n \"event_type\": \"deployment_completed\",\n \"event_title\": \"Production Deployment Completed\",\n \"output_variable_name\": \"timeline_event\",\n \"event_description\": \"Detailed description of what happened...\",\n \"event_properties\": \"<string>\",\n \"event_timestamp\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"response": {}
}{
"status": 123,
"response": {}
}{
"status": 123,
"response": {}
}{
"status": 123,
"response": {}
}HubSpot CRM & Automation
Create HubSpot Timeline Event
Create HubSpot Timeline Event
POST
/
action
/
hubspot.v2.create_timeline_event
Create HubSpot Timeline Event
curl --request POST \
--url https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_object_id": "{{company_id}}",
"event_type": "deployment_completed",
"event_title": "Production Deployment Completed",
"output_variable_name": "timeline_event",
"event_description": "Detailed description of what happened...",
"event_properties": "<string>",
"event_timestamp": "<string>"
}
'import requests
url = "https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event"
payload = {
"target_object_id": "{{company_id}}",
"event_type": "deployment_completed",
"event_title": "Production Deployment Completed",
"output_variable_name": "timeline_event",
"event_description": "Detailed description of what happened...",
"event_properties": "<string>",
"event_timestamp": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target_object_id: '{{company_id}}',
event_type: 'deployment_completed',
event_title: 'Production Deployment Completed',
output_variable_name: 'timeline_event',
event_description: 'Detailed description of what happened...',
event_properties: '<string>',
event_timestamp: '<string>'
})
};
fetch('https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event', 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-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event",
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([
'target_object_id' => '{{company_id}}',
'event_type' => 'deployment_completed',
'event_title' => 'Production Deployment Completed',
'output_variable_name' => 'timeline_event',
'event_description' => 'Detailed description of what happened...',
'event_properties' => '<string>',
'event_timestamp' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event"
payload := strings.NewReader("{\n \"target_object_id\": \"{{company_id}}\",\n \"event_type\": \"deployment_completed\",\n \"event_title\": \"Production Deployment Completed\",\n \"output_variable_name\": \"timeline_event\",\n \"event_description\": \"Detailed description of what happened...\",\n \"event_properties\": \"<string>\",\n \"event_timestamp\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_object_id\": \"{{company_id}}\",\n \"event_type\": \"deployment_completed\",\n \"event_title\": \"Production Deployment Completed\",\n \"output_variable_name\": \"timeline_event\",\n \"event_description\": \"Detailed description of what happened...\",\n \"event_properties\": \"<string>\",\n \"event_timestamp\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-lr.agent.ai/v1/action/hubspot.v2.create_timeline_event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_object_id\": \"{{company_id}}\",\n \"event_type\": \"deployment_completed\",\n \"event_title\": \"Production Deployment Completed\",\n \"output_variable_name\": \"timeline_event\",\n \"event_description\": \"Detailed description of what happened...\",\n \"event_properties\": \"<string>\",\n \"event_timestamp\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"response": {}
}{
"status": 123,
"response": {}
}{
"status": 123,
"response": {}
}{
"status": 123,
"response": {}
}Authorizations
Bearer token from your account (https://agent.ai/user/integrations#api)
Body
application/json
Available options:
company, contact, deal, ticket ID of the object to add the timeline event to.
Unique identifier for this type of event (e.g., 'subscription_upgraded').
Title displayed in the HubSpot timeline.
Variable name to store the created timeline event.
Detailed description of the event.
Additional properties as JSON or key=value pairs, one per line. Example: {"property":"value"} or property=value
When this event occurred (defaults to now). Format: mm/dd/yyyy, --:-- --
⌘I

