Calendar
Create Calendar Event
Schedules either a Task or an Appointment for the target lead, selected by the ‘type’ field (case-insensitive TASK / APPOINTMENT).
Notes:
- Caller must have manage permission on the lead; otherwise 400 PERMISSION_DENIED (20017).
- type, leadId, content, startAt and endAt are required. taskWay is additionally required when type = TASK.
- startAt and endAt must be later than the current server time.
- The returned data.id is a composite string (‘
<numericId>-task’ or ‘<numericId>-appointment’) and must be used as-is when updating, finishing or deleting the entry. - When startAt and endAt are both exactly midnight (00:00:00) in their declared offsets, an appointment is automatically marked as all-day.
POST
/
v2.0
/
calendar
Create/Schedule Calendar Event
curl --request POST \
--url https://api.lofty.com/v2.0/calendar \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "TASK",
"content": "Follow up with client about property",
"leadId": 563172647619608,
"timeZoneCode": "America/Los_Angeles",
"startAt": "2026-03-01T14:00:00-08:00",
"endAt": "2026-03-01T15:00:00-08:00",
"startAtMs": 1740866400000,
"endAtMs": 1740870000000,
"taskWay": "Call",
"assignedRole": "Agent",
"address": "123 Main St, Los Angeles, CA",
"assignedRoleId": 10,
"ownerUserId": 844775556213479,
"participants": {
"agents": [
844775556213479
],
"leads": [
1149834734607512
]
}
}
'import requests
url = "https://api.lofty.com/v2.0/calendar"
payload = {
"type": "TASK",
"content": "Follow up with client about property",
"leadId": 563172647619608,
"timeZoneCode": "America/Los_Angeles",
"startAt": "2026-03-01T14:00:00-08:00",
"endAt": "2026-03-01T15:00:00-08:00",
"startAtMs": 1740866400000,
"endAtMs": 1740870000000,
"taskWay": "Call",
"assignedRole": "Agent",
"address": "123 Main St, Los Angeles, CA",
"assignedRoleId": 10,
"ownerUserId": 844775556213479,
"participants": {
"agents": [844775556213479],
"leads": [1149834734607512]
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
type: 'TASK',
content: 'Follow up with client about property',
leadId: 563172647619608,
timeZoneCode: 'America/Los_Angeles',
startAt: '2026-03-01T14:00:00-08:00',
endAt: '2026-03-01T15:00:00-08:00',
startAtMs: 1740866400000,
endAtMs: 1740870000000,
taskWay: 'Call',
assignedRole: 'Agent',
address: '123 Main St, Los Angeles, CA',
assignedRoleId: 10,
ownerUserId: 844775556213479,
participants: {agents: [844775556213479], leads: [1149834734607512]}
})
};
fetch('https://api.lofty.com/v2.0/calendar', 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.lofty.com/v2.0/calendar",
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([
'type' => 'TASK',
'content' => 'Follow up with client about property',
'leadId' => 563172647619608,
'timeZoneCode' => 'America/Los_Angeles',
'startAt' => '2026-03-01T14:00:00-08:00',
'endAt' => '2026-03-01T15:00:00-08:00',
'startAtMs' => 1740866400000,
'endAtMs' => 1740870000000,
'taskWay' => 'Call',
'assignedRole' => 'Agent',
'address' => '123 Main St, Los Angeles, CA',
'assignedRoleId' => 10,
'ownerUserId' => 844775556213479,
'participants' => [
'agents' => [
844775556213479
],
'leads' => [
1149834734607512
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v2.0/calendar"
payload := strings.NewReader("{\n \"type\": \"TASK\",\n \"content\": \"Follow up with client about property\",\n \"leadId\": 563172647619608,\n \"timeZoneCode\": \"America/Los_Angeles\",\n \"startAt\": \"2026-03-01T14:00:00-08:00\",\n \"endAt\": \"2026-03-01T15:00:00-08:00\",\n \"startAtMs\": 1740866400000,\n \"endAtMs\": 1740870000000,\n \"taskWay\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"address\": \"123 Main St, Los Angeles, CA\",\n \"assignedRoleId\": 10,\n \"ownerUserId\": 844775556213479,\n \"participants\": {\n \"agents\": [\n 844775556213479\n ],\n \"leads\": [\n 1149834734607512\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lofty.com/v2.0/calendar")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"TASK\",\n \"content\": \"Follow up with client about property\",\n \"leadId\": 563172647619608,\n \"timeZoneCode\": \"America/Los_Angeles\",\n \"startAt\": \"2026-03-01T14:00:00-08:00\",\n \"endAt\": \"2026-03-01T15:00:00-08:00\",\n \"startAtMs\": 1740866400000,\n \"endAtMs\": 1740870000000,\n \"taskWay\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"address\": \"123 Main St, Los Angeles, CA\",\n \"assignedRoleId\": 10,\n \"ownerUserId\": 844775556213479,\n \"participants\": {\n \"agents\": [\n 844775556213479\n ],\n \"leads\": [\n 1149834734607512\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v2.0/calendar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"type\": \"TASK\",\n \"content\": \"Follow up with client about property\",\n \"leadId\": 563172647619608,\n \"timeZoneCode\": \"America/Los_Angeles\",\n \"startAt\": \"2026-03-01T14:00:00-08:00\",\n \"endAt\": \"2026-03-01T15:00:00-08:00\",\n \"startAtMs\": 1740866400000,\n \"endAtMs\": 1740870000000,\n \"taskWay\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"address\": \"123 Main St, Los Angeles, CA\",\n \"assignedRoleId\": 10,\n \"ownerUserId\": 844775556213479,\n \"participants\": {\n \"agents\": [\n 844775556213479\n ],\n \"leads\": [\n 1149834734607512\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "12345-task",
"type": "TASK",
"message": "<string>"
}
}"<string>""<string>""<string>"Body
application/json
Calendar payload. type decides whether a Task or Appointment is created.
⌘I
Create/Schedule Calendar Event
curl --request POST \
--url https://api.lofty.com/v2.0/calendar \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "TASK",
"content": "Follow up with client about property",
"leadId": 563172647619608,
"timeZoneCode": "America/Los_Angeles",
"startAt": "2026-03-01T14:00:00-08:00",
"endAt": "2026-03-01T15:00:00-08:00",
"startAtMs": 1740866400000,
"endAtMs": 1740870000000,
"taskWay": "Call",
"assignedRole": "Agent",
"address": "123 Main St, Los Angeles, CA",
"assignedRoleId": 10,
"ownerUserId": 844775556213479,
"participants": {
"agents": [
844775556213479
],
"leads": [
1149834734607512
]
}
}
'import requests
url = "https://api.lofty.com/v2.0/calendar"
payload = {
"type": "TASK",
"content": "Follow up with client about property",
"leadId": 563172647619608,
"timeZoneCode": "America/Los_Angeles",
"startAt": "2026-03-01T14:00:00-08:00",
"endAt": "2026-03-01T15:00:00-08:00",
"startAtMs": 1740866400000,
"endAtMs": 1740870000000,
"taskWay": "Call",
"assignedRole": "Agent",
"address": "123 Main St, Los Angeles, CA",
"assignedRoleId": 10,
"ownerUserId": 844775556213479,
"participants": {
"agents": [844775556213479],
"leads": [1149834734607512]
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
type: 'TASK',
content: 'Follow up with client about property',
leadId: 563172647619608,
timeZoneCode: 'America/Los_Angeles',
startAt: '2026-03-01T14:00:00-08:00',
endAt: '2026-03-01T15:00:00-08:00',
startAtMs: 1740866400000,
endAtMs: 1740870000000,
taskWay: 'Call',
assignedRole: 'Agent',
address: '123 Main St, Los Angeles, CA',
assignedRoleId: 10,
ownerUserId: 844775556213479,
participants: {agents: [844775556213479], leads: [1149834734607512]}
})
};
fetch('https://api.lofty.com/v2.0/calendar', 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.lofty.com/v2.0/calendar",
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([
'type' => 'TASK',
'content' => 'Follow up with client about property',
'leadId' => 563172647619608,
'timeZoneCode' => 'America/Los_Angeles',
'startAt' => '2026-03-01T14:00:00-08:00',
'endAt' => '2026-03-01T15:00:00-08:00',
'startAtMs' => 1740866400000,
'endAtMs' => 1740870000000,
'taskWay' => 'Call',
'assignedRole' => 'Agent',
'address' => '123 Main St, Los Angeles, CA',
'assignedRoleId' => 10,
'ownerUserId' => 844775556213479,
'participants' => [
'agents' => [
844775556213479
],
'leads' => [
1149834734607512
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v2.0/calendar"
payload := strings.NewReader("{\n \"type\": \"TASK\",\n \"content\": \"Follow up with client about property\",\n \"leadId\": 563172647619608,\n \"timeZoneCode\": \"America/Los_Angeles\",\n \"startAt\": \"2026-03-01T14:00:00-08:00\",\n \"endAt\": \"2026-03-01T15:00:00-08:00\",\n \"startAtMs\": 1740866400000,\n \"endAtMs\": 1740870000000,\n \"taskWay\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"address\": \"123 Main St, Los Angeles, CA\",\n \"assignedRoleId\": 10,\n \"ownerUserId\": 844775556213479,\n \"participants\": {\n \"agents\": [\n 844775556213479\n ],\n \"leads\": [\n 1149834734607512\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lofty.com/v2.0/calendar")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"TASK\",\n \"content\": \"Follow up with client about property\",\n \"leadId\": 563172647619608,\n \"timeZoneCode\": \"America/Los_Angeles\",\n \"startAt\": \"2026-03-01T14:00:00-08:00\",\n \"endAt\": \"2026-03-01T15:00:00-08:00\",\n \"startAtMs\": 1740866400000,\n \"endAtMs\": 1740870000000,\n \"taskWay\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"address\": \"123 Main St, Los Angeles, CA\",\n \"assignedRoleId\": 10,\n \"ownerUserId\": 844775556213479,\n \"participants\": {\n \"agents\": [\n 844775556213479\n ],\n \"leads\": [\n 1149834734607512\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v2.0/calendar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"type\": \"TASK\",\n \"content\": \"Follow up with client about property\",\n \"leadId\": 563172647619608,\n \"timeZoneCode\": \"America/Los_Angeles\",\n \"startAt\": \"2026-03-01T14:00:00-08:00\",\n \"endAt\": \"2026-03-01T15:00:00-08:00\",\n \"startAtMs\": 1740866400000,\n \"endAtMs\": 1740870000000,\n \"taskWay\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"address\": \"123 Main St, Los Angeles, CA\",\n \"assignedRoleId\": 10,\n \"ownerUserId\": 844775556213479,\n \"participants\": {\n \"agents\": [\n 844775556213479\n ],\n \"leads\": [\n 1149834734607512\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "12345-task",
"type": "TASK",
"message": "<string>"
}
}"<string>""<string>""<string>"