Create Task
curl --request POST \
--url https://api.example.com/v1/tasks \
--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>",
"contact_name": "<string>",
"company_name": "<string>",
"deal_id": "<string>",
"event_id": "<string>",
"created_date": "<string>"
}
'import requests
url = "https://api.example.com/v1/tasks"
payload = {
"title": "<string>",
"description": "<string>",
"status": "<string>",
"priority": "<string>",
"task_type": "<string>",
"due_date": "<string>",
"assignee_id": "<string>",
"contact_id": "<string>",
"contact_name": "<string>",
"company_name": "<string>",
"deal_id": "<string>",
"event_id": "<string>",
"created_date": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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>',
contact_name: '<string>',
company_name: '<string>',
deal_id: '<string>',
event_id: '<string>',
created_date: '<string>'
})
};
fetch('https://api.example.com/v1/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.example.com/v1/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([
'title' => '<string>',
'description' => '<string>',
'status' => '<string>',
'priority' => '<string>',
'task_type' => '<string>',
'due_date' => '<string>',
'assignee_id' => '<string>',
'contact_id' => '<string>',
'contact_name' => '<string>',
'company_name' => '<string>',
'deal_id' => '<string>',
'event_id' => '<string>',
'created_date' => '<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"
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 \"contact_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"created_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/tasks")
.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 \"contact_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"created_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"contact_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"created_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}Tasks
Create Task
Create a new task linked to a contact, deal, or event
POST
/
v1
/
tasks
Create Task
curl --request POST \
--url https://api.example.com/v1/tasks \
--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>",
"contact_name": "<string>",
"company_name": "<string>",
"deal_id": "<string>",
"event_id": "<string>",
"created_date": "<string>"
}
'import requests
url = "https://api.example.com/v1/tasks"
payload = {
"title": "<string>",
"description": "<string>",
"status": "<string>",
"priority": "<string>",
"task_type": "<string>",
"due_date": "<string>",
"assignee_id": "<string>",
"contact_id": "<string>",
"contact_name": "<string>",
"company_name": "<string>",
"deal_id": "<string>",
"event_id": "<string>",
"created_date": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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>',
contact_name: '<string>',
company_name: '<string>',
deal_id: '<string>',
event_id: '<string>',
created_date: '<string>'
})
};
fetch('https://api.example.com/v1/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.example.com/v1/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([
'title' => '<string>',
'description' => '<string>',
'status' => '<string>',
'priority' => '<string>',
'task_type' => '<string>',
'due_date' => '<string>',
'assignee_id' => '<string>',
'contact_id' => '<string>',
'contact_name' => '<string>',
'company_name' => '<string>',
'deal_id' => '<string>',
'event_id' => '<string>',
'created_date' => '<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"
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 \"contact_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"created_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/tasks")
.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 \"contact_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"created_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"contact_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"event_id\": \"<string>\",\n \"created_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}Request
At least one parent link is required. A task must reference
contact_id, deal_id, or event_id. Orphan tasks are rejected with 400.Body Parameters
string
required
Task title
string
Task description
string
default:"open"
Status (
open, in_progress, completed)string
Priority level (
low, medium, high)string
Task type
string
Due date (ISO 8601 or
YYYY-MM-DD)string
Assignee user ID
string
UUID of linked contact. Must belong to your workspace.
string
Human name — fuzzy-matched within your workspace and resolved to
contact_id.
On ambiguous matches, returns 400 ambiguous_reference with candidate UUIDs.string
Human name — fuzzy Company match.
string
UUID of linked deal.
string
UUID of linked event.
string
Optional ISO 8601 timestamp. Honored verbatim if within the last 5 years and not more than 24 h in the future; otherwise the server
now() is used. Never null.Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Response
object
Created task with
id, title, status, priority, due_date, assigned_to_user_id, contact_id, deal_id, event_id, created_date.curl -X POST https://data.leadlex.com/functions/v1/api-gateway/v1/tasks \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"title": "Follow up with Hans Müller",
"due_date": "2026-03-10",
"priority": "high",
"contact_id": "789e0123-e45b-67c8-a901-234567890abc"
}'
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.post(f"{BASE_URL}/v1/tasks", headers=headers, json={
"title": "Follow up with Hans Müller",
"due_date": "2026-03-10",
"priority": "high",
"contact_id": "789e0123-e45b-67c8-a901-234567890abc",
})
print(response.json())
const response = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/tasks',
{
method: 'POST',
headers: { 'Authorization': 'Bearer wbk_your_api_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({
title: 'Follow up with Hans Müller',
due_date: '2026-03-10',
priority: 'high',
contact_id: '789e0123-e45b-67c8-a901-234567890abc'
})
}
);
const { data } = await response.json();
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Missing title — or no parent link (contact_id / deal_id / event_id) |
| 403 | insufficient_permissions | Missing activities:write permission |
Orphan-task rejection example
{
"error": {
"code": "validation_error",
"message": "At least one parent link (contact_id, company_id, deal_id, or event_id) is required"
}
}