Create task
curl --request POST \
--url https://api.heffl.com/api/v2/tasks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"showTime": true,
"durationMinutes": 1,
"assigneeIds": [
"<string>"
],
"tagIds": [
"<string>"
],
"entityId": "<string>"
}
'import requests
url = "https://api.heffl.com/api/v2/tasks"
payload = {
"title": "<string>",
"description": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"showTime": True,
"durationMinutes": 1,
"assigneeIds": ["<string>"],
"tagIds": ["<string>"],
"entityId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
startDate: '2023-11-07T05:31:56Z',
dueDate: '2023-11-07T05:31:56Z',
showTime: true,
durationMinutes: 1,
assigneeIds: ['<string>'],
tagIds: ['<string>'],
entityId: '<string>'
})
};
fetch('https://api.heffl.com/api/v2/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.heffl.com/api/v2/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>',
'startDate' => '2023-11-07T05:31:56Z',
'dueDate' => '2023-11-07T05:31:56Z',
'showTime' => true,
'durationMinutes' => 1,
'assigneeIds' => [
'<string>'
],
'tagIds' => [
'<string>'
],
'entityId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.heffl.com/api/v2/tasks"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"showTime\": true,\n \"durationMinutes\": 1,\n \"assigneeIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ],\n \"entityId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.heffl.com/api/v2/tasks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"showTime\": true,\n \"durationMinutes\": 1,\n \"assigneeIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ],\n \"entityId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"showTime\": true,\n \"durationMinutes\": 1,\n \"assigneeIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ],\n \"entityId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"title": "<string>",
"status": "OPEN",
"type": "call",
"showTime": true,
"assigneeIds": [
"<string>"
],
"tagIds": [
"<string>"
],
"description": "<string>",
"priority": "LOW",
"dueDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"durationMinutes": 123,
"completedOn": "2023-11-07T05:31:56Z",
"entity": "projects",
"entityId": "<string>",
"projectId": "<string>",
"leadId": "<string>",
"dealId": "<string>",
"clientId": "<string>",
"contactId": "<string>",
"createdById": "<string>",
"createdByName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Tasks
Create task
Creates a new task. Link it to a deal, lead, or project using entity and entityId. Custom field values use cf_* keys — see the Custom fields guide.
POST
/
tasks
Create task
curl --request POST \
--url https://api.heffl.com/api/v2/tasks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"showTime": true,
"durationMinutes": 1,
"assigneeIds": [
"<string>"
],
"tagIds": [
"<string>"
],
"entityId": "<string>"
}
'import requests
url = "https://api.heffl.com/api/v2/tasks"
payload = {
"title": "<string>",
"description": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"showTime": True,
"durationMinutes": 1,
"assigneeIds": ["<string>"],
"tagIds": ["<string>"],
"entityId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
startDate: '2023-11-07T05:31:56Z',
dueDate: '2023-11-07T05:31:56Z',
showTime: true,
durationMinutes: 1,
assigneeIds: ['<string>'],
tagIds: ['<string>'],
entityId: '<string>'
})
};
fetch('https://api.heffl.com/api/v2/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.heffl.com/api/v2/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>',
'startDate' => '2023-11-07T05:31:56Z',
'dueDate' => '2023-11-07T05:31:56Z',
'showTime' => true,
'durationMinutes' => 1,
'assigneeIds' => [
'<string>'
],
'tagIds' => [
'<string>'
],
'entityId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.heffl.com/api/v2/tasks"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"showTime\": true,\n \"durationMinutes\": 1,\n \"assigneeIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ],\n \"entityId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.heffl.com/api/v2/tasks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"showTime\": true,\n \"durationMinutes\": 1,\n \"assigneeIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ],\n \"entityId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"showTime\": true,\n \"durationMinutes\": 1,\n \"assigneeIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ],\n \"entityId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"title": "<string>",
"status": "OPEN",
"type": "call",
"showTime": true,
"assigneeIds": [
"<string>"
],
"tagIds": [
"<string>"
],
"description": "<string>",
"priority": "LOW",
"dueDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"durationMinutes": 123,
"completedOn": "2023-11-07T05:31:56Z",
"entity": "projects",
"entityId": "<string>",
"projectId": "<string>",
"leadId": "<string>",
"dealId": "<string>",
"clientId": "<string>",
"contactId": "<string>",
"createdById": "<string>",
"createdByName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Body
application/json
Response
OK