Tasks
Create Task
Creates a new follow-up task or appointment on the target lead. Whether an appointment or a regular task is created depends on the payload’s type field.
Notes:
- content, assignedRole, leadId and endAt are required.
- Caller must have manage permission on the lead.
- The response contains only the new entry’s ID under the ‘taskId’ key.
POST
/
v2.0
/
tasks
Create Task
curl --request POST \
--url https://api.lofty.com/v2.0/tasks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "Call",
"content": "Send an email to my lead",
"leadId": 563172647619608,
"assignedRole": "Agent",
"startAt": "2026-03-01T15:00:00-08:00",
"endAt": "2026-03-01T16:00:00-08:00",
"timeZoneCode": "America/Los_Angeles",
"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/tasks"
payload = {
"type": "Call",
"content": "Send an email to my lead",
"leadId": 563172647619608,
"assignedRole": "Agent",
"startAt": "2026-03-01T15:00:00-08:00",
"endAt": "2026-03-01T16:00:00-08:00",
"timeZoneCode": "America/Los_Angeles",
"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: 'Call',
content: 'Send an email to my lead',
leadId: 563172647619608,
assignedRole: 'Agent',
startAt: '2026-03-01T15:00:00-08:00',
endAt: '2026-03-01T16:00:00-08:00',
timeZoneCode: 'America/Los_Angeles',
address: '123 Main St, Los Angeles, CA',
assignedRoleId: 10,
ownerUserId: 844775556213479,
participants: {agents: [844775556213479], leads: [1149834734607512]}
})
};
fetch('https://api.lofty.com/v2.0/tasks', 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/tasks",
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' => 'Call',
'content' => 'Send an email to my lead',
'leadId' => 563172647619608,
'assignedRole' => 'Agent',
'startAt' => '2026-03-01T15:00:00-08:00',
'endAt' => '2026-03-01T16:00:00-08:00',
'timeZoneCode' => 'America/Los_Angeles',
'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/tasks"
payload := strings.NewReader("{\n \"type\": \"Call\",\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"assignedRole\": \"Agent\",\n \"startAt\": \"2026-03-01T15:00:00-08:00\",\n \"endAt\": \"2026-03-01T16:00:00-08:00\",\n \"timeZoneCode\": \"America/Los_Angeles\",\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/tasks")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"Call\",\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"assignedRole\": \"Agent\",\n \"startAt\": \"2026-03-01T15:00:00-08:00\",\n \"endAt\": \"2026-03-01T16:00:00-08:00\",\n \"timeZoneCode\": \"America/Los_Angeles\",\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/tasks")
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\": \"Call\",\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"assignedRole\": \"Agent\",\n \"startAt\": \"2026-03-01T15:00:00-08:00\",\n \"endAt\": \"2026-03-01T16:00:00-08:00\",\n \"timeZoneCode\": \"America/Los_Angeles\",\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{
"taskId": 563172647619608
}"<string>""<string>""<string>"Body
application/json
Task or appointment payload.
⌘I
Create Task
curl --request POST \
--url https://api.lofty.com/v2.0/tasks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "Call",
"content": "Send an email to my lead",
"leadId": 563172647619608,
"assignedRole": "Agent",
"startAt": "2026-03-01T15:00:00-08:00",
"endAt": "2026-03-01T16:00:00-08:00",
"timeZoneCode": "America/Los_Angeles",
"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/tasks"
payload = {
"type": "Call",
"content": "Send an email to my lead",
"leadId": 563172647619608,
"assignedRole": "Agent",
"startAt": "2026-03-01T15:00:00-08:00",
"endAt": "2026-03-01T16:00:00-08:00",
"timeZoneCode": "America/Los_Angeles",
"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: 'Call',
content: 'Send an email to my lead',
leadId: 563172647619608,
assignedRole: 'Agent',
startAt: '2026-03-01T15:00:00-08:00',
endAt: '2026-03-01T16:00:00-08:00',
timeZoneCode: 'America/Los_Angeles',
address: '123 Main St, Los Angeles, CA',
assignedRoleId: 10,
ownerUserId: 844775556213479,
participants: {agents: [844775556213479], leads: [1149834734607512]}
})
};
fetch('https://api.lofty.com/v2.0/tasks', 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/tasks",
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' => 'Call',
'content' => 'Send an email to my lead',
'leadId' => 563172647619608,
'assignedRole' => 'Agent',
'startAt' => '2026-03-01T15:00:00-08:00',
'endAt' => '2026-03-01T16:00:00-08:00',
'timeZoneCode' => 'America/Los_Angeles',
'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/tasks"
payload := strings.NewReader("{\n \"type\": \"Call\",\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"assignedRole\": \"Agent\",\n \"startAt\": \"2026-03-01T15:00:00-08:00\",\n \"endAt\": \"2026-03-01T16:00:00-08:00\",\n \"timeZoneCode\": \"America/Los_Angeles\",\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/tasks")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"Call\",\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"assignedRole\": \"Agent\",\n \"startAt\": \"2026-03-01T15:00:00-08:00\",\n \"endAt\": \"2026-03-01T16:00:00-08:00\",\n \"timeZoneCode\": \"America/Los_Angeles\",\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/tasks")
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\": \"Call\",\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"assignedRole\": \"Agent\",\n \"startAt\": \"2026-03-01T15:00:00-08:00\",\n \"endAt\": \"2026-03-01T16:00:00-08:00\",\n \"timeZoneCode\": \"America/Los_Angeles\",\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{
"taskId": 563172647619608
}"<string>""<string>""<string>"