Create a task
curl --request POST \
--url https://app.leonar.app/api/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"type": "todo",
"priority": "medium",
"due_date": "2023-12-25",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.leonar.app/api/v1/tasks"
payload = {
"title": "<string>",
"description": "<string>",
"type": "todo",
"priority": "medium",
"due_date": "2023-12-25",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
type: 'todo',
priority: 'medium',
due_date: '2023-12-25',
assigned_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
deal_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.leonar.app/api/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://app.leonar.app/api/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>',
'type' => 'todo',
'priority' => 'medium',
'due_date' => '2023-12-25',
'assigned_to' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'deal_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.leonar.app/api/v1/tasks"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"todo\",\n \"priority\": \"medium\",\n \"due_date\": \"2023-12-25\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.leonar.app/api/v1/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"todo\",\n \"priority\": \"medium\",\n \"due_date\": \"2023-12-25\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"todo\",\n \"priority\": \"medium\",\n \"due_date\": \"2023-12-25\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "e5f6a7b8-9012-34cd-efab-567890123def",
"title": "Follow up with Sophie Martin",
"description": "Discuss salary expectations and start date",
"type": "call",
"status": "todo",
"priority": "high",
"due_date": "2025-02-15",
"assigned_to": "f6a7b8c9-0123-45de-fabc-678901234ef0",
"contact_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"company_id": null,
"deal_id": null,
"project_id": "d4e5f6a7-8901-23bc-defa-456789012cde",
"completed_at": null,
"created_at": "2025-02-10T10:00:00Z",
"updated_at": "2025-02-10T10:00:00Z"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}Tasks
Create a task
POST
/
tasks
Create a task
curl --request POST \
--url https://app.leonar.app/api/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"type": "todo",
"priority": "medium",
"due_date": "2023-12-25",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.leonar.app/api/v1/tasks"
payload = {
"title": "<string>",
"description": "<string>",
"type": "todo",
"priority": "medium",
"due_date": "2023-12-25",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
type: 'todo',
priority: 'medium',
due_date: '2023-12-25',
assigned_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
deal_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.leonar.app/api/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://app.leonar.app/api/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>',
'type' => 'todo',
'priority' => 'medium',
'due_date' => '2023-12-25',
'assigned_to' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'deal_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.leonar.app/api/v1/tasks"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"todo\",\n \"priority\": \"medium\",\n \"due_date\": \"2023-12-25\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.leonar.app/api/v1/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"todo\",\n \"priority\": \"medium\",\n \"due_date\": \"2023-12-25\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"todo\",\n \"priority\": \"medium\",\n \"due_date\": \"2023-12-25\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"company_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"deal_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "e5f6a7b8-9012-34cd-efab-567890123def",
"title": "Follow up with Sophie Martin",
"description": "Discuss salary expectations and start date",
"type": "call",
"status": "todo",
"priority": "high",
"due_date": "2025-02-15",
"assigned_to": "f6a7b8c9-0123-45de-fabc-678901234ef0",
"contact_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"company_id": null,
"deal_id": null,
"project_id": "d4e5f6a7-8901-23bc-defa-456789012cde",
"completed_at": null,
"created_at": "2025-02-10T10:00:00Z",
"updated_at": "2025-02-10T10:00:00Z"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}Authorizations
API key starting with leo_
Body
application/json
Maximum string length:
255Maximum string length:
5000Available options:
call, email, linkedin_connect, linkedin_message, whatsapp, todo, reminder, meeting, interview Available options:
low, medium, high Response
Task created
Show child attributes
Show child attributes
Example:
{
"id": "e5f6a7b8-9012-34cd-efab-567890123def",
"title": "Follow up with Sophie Martin",
"description": "Discuss salary expectations and start date",
"type": "call",
"status": "todo",
"priority": "high",
"due_date": "2025-02-15",
"assigned_to": "f6a7b8c9-0123-45de-fabc-678901234ef0",
"contact_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"company_id": null,
"deal_id": null,
"project_id": "d4e5f6a7-8901-23bc-defa-456789012cde",
"completed_at": null,
"created_at": "2025-02-10T10:00:00Z",
"updated_at": "2025-02-10T10:00:00Z"
}
⌘I