Update Task
curl --request PATCH \
--url https://api.example.com/v1/tasks/:id \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"status": "<string>",
"priority": "<string>",
"task_type": "<string>",
"due_date": "<string>",
"assignee_id": "<string>",
"contact_id": "<string>",
"deal_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/tasks/:id"
payload = {
"title": "<string>",
"description": "<string>",
"status": "<string>",
"priority": "<string>",
"task_type": "<string>",
"due_date": "<string>",
"assignee_id": "<string>",
"contact_id": "<string>",
"deal_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
status: '<string>',
priority: '<string>',
task_type: '<string>',
due_date: '<string>',
assignee_id: '<string>',
contact_id: '<string>',
deal_id: '<string>'
})
};
fetch('https://api.example.com/v1/tasks/:id', 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.example.com/v1/tasks/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'status' => '<string>',
'priority' => '<string>',
'task_type' => '<string>',
'due_date' => '<string>',
'assignee_id' => '<string>',
'contact_id' => '<string>',
'deal_id' => '<string>'
]),
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.example.com/v1/tasks/:id"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"priority\": \"<string>\",\n \"task_type\": \"<string>\",\n \"due_date\": \"<string>\",\n \"assignee_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/v1/tasks/:id")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"priority\": \"<string>\",\n \"task_type\": \"<string>\",\n \"due_date\": \"<string>\",\n \"assignee_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"priority\": \"<string>\",\n \"task_type\": \"<string>\",\n \"due_date\": \"<string>\",\n \"assignee_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}Tasks
Update Task
Update an existing task
PATCH
/
v1
/
tasks
/
:id
Update Task
curl --request PATCH \
--url https://api.example.com/v1/tasks/:id \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"status": "<string>",
"priority": "<string>",
"task_type": "<string>",
"due_date": "<string>",
"assignee_id": "<string>",
"contact_id": "<string>",
"deal_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/tasks/:id"
payload = {
"title": "<string>",
"description": "<string>",
"status": "<string>",
"priority": "<string>",
"task_type": "<string>",
"due_date": "<string>",
"assignee_id": "<string>",
"contact_id": "<string>",
"deal_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
status: '<string>',
priority: '<string>',
task_type: '<string>',
due_date: '<string>',
assignee_id: '<string>',
contact_id: '<string>',
deal_id: '<string>'
})
};
fetch('https://api.example.com/v1/tasks/:id', 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.example.com/v1/tasks/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'status' => '<string>',
'priority' => '<string>',
'task_type' => '<string>',
'due_date' => '<string>',
'assignee_id' => '<string>',
'contact_id' => '<string>',
'deal_id' => '<string>'
]),
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.example.com/v1/tasks/:id"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"priority\": \"<string>\",\n \"task_type\": \"<string>\",\n \"due_date\": \"<string>\",\n \"assignee_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/v1/tasks/:id")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"priority\": \"<string>\",\n \"task_type\": \"<string>\",\n \"due_date\": \"<string>\",\n \"assignee_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"status\": \"<string>\",\n \"priority\": \"<string>\",\n \"task_type\": \"<string>\",\n \"due_date\": \"<string>\",\n \"assignee_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}Request
Path Parameters
string
required
Task ID (UUID)
Body Parameters
All fields optional.string
Task title
string
Description
string
Status
string
Priority
string
Task type
string
Due date
string
Assignee user ID
string
Contact ID
string
Deal ID
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Response
object
Updated task with
id, title, status, priority, due_date, assigned_to_user_id, updated_datecurl -X PATCH https://data.leadlex.com/functions/v1/api-gateway/v1/tasks/task-001 \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{ "status": "completed" }'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
response = requests.patch(f"{BASE_URL}/v1/tasks/task-001", headers=headers, json={"status": "completed"})
print(response.json())
const response = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/tasks/task-001',
{
method: 'PATCH',
headers: { 'Authorization': 'Bearer wbk_your_api_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ status: 'completed' })
}
);
const { data } = await response.json();
Errors
| Status | Code | Description |
|---|---|---|
| 404 | not_found | Task not found |
| 403 | insufficient_permissions | Missing activities:write permission |