Legacy
Update Task (V1)
Partially updates an existing task. Fields not supplied are left unchanged.
Notes:
- When finishFlag is true, the task is marked completed and all other fields are ignored. Completion is rejected for smart-plan tasks (TASK_IS_SMARTPLAN).
- When leadId is supplied, it must match the task’s existing lead; otherwise 400 INVALID_UPDATE_OPERATION_LEADID.
- At least one field must be supplied; an entirely empty payload returns 400 MISSING_PARAMETER.
- Caller must have manage permission on the task’s lead.
- The response body is empty.
PUT
/
v1.0
/
tasks
/
{taskId}
Update Task (V1)
curl --request PUT \
--url https://api.lofty.com/v1.0/tasks/{taskId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": true
}
'import requests
url = "https://api.lofty.com/v1.0/tasks/{taskId}"
payload = {
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
content: 'Send an email to my lead',
leadId: 563172647619608,
deadline: 1508580010000,
type: 'Call',
assignedRole: 'Agent',
finishFlag: true
})
};
fetch('https://api.lofty.com/v1.0/tasks/{taskId}', 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/v1.0/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'content' => 'Send an email to my lead',
'leadId' => 563172647619608,
'deadline' => 1508580010000,
'type' => 'Call',
'assignedRole' => 'Agent',
'finishFlag' => true
]),
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/v1.0/tasks/{taskId}"
payload := strings.NewReader("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.lofty.com/v1.0/tasks/{taskId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
ID of the task to update.
Required range:
x >= 1Body
application/json
Task payload.
Description of the task.
Example:
"Send an email to my lead"
ID of the lead this task belongs to.
Example:
563172647619608
Deadline of the task, in milliseconds since Unix epoch (UTC).
Example:
1508580010000
Type of the task.
Available options:
Other, Call, Email, Text Example:
"Call"
Role the task is assigned to.
Available options:
Agent, Assistant Example:
"Agent"
When true on update, the task is marked completed and other fields are ignored.
Example:
true
Response
Task updated successfully. No response body.
⌘I
Update Task (V1)
curl --request PUT \
--url https://api.lofty.com/v1.0/tasks/{taskId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": true
}
'import requests
url = "https://api.lofty.com/v1.0/tasks/{taskId}"
payload = {
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
content: 'Send an email to my lead',
leadId: 563172647619608,
deadline: 1508580010000,
type: 'Call',
assignedRole: 'Agent',
finishFlag: true
})
};
fetch('https://api.lofty.com/v1.0/tasks/{taskId}', 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/v1.0/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'content' => 'Send an email to my lead',
'leadId' => 563172647619608,
'deadline' => 1508580010000,
'type' => 'Call',
'assignedRole' => 'Agent',
'finishFlag' => true
]),
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/v1.0/tasks/{taskId}"
payload := strings.NewReader("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.lofty.com/v1.0/tasks/{taskId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}"
response = http.request(request)
puts response.read_body