Tarefas
Criar tarefa
Crie uma tarefa para o contato informando título, data de vencimento e status de conclusão.
URL completa: https://services.leadconnectorhq.com/contacts/{contactId}/tasks
POST
/
contacts
/
{contactId}
/
tasks
cURL
curl --request POST \
--url 'https://services.leadconnectorhq.com/contacts/{contactId}/tasks' \
--header 'Authorization: Bearer <token>' \
--header 'Version: v3' \
--header 'Content-Type: application/json' \
--data '{
"title": "Retornar contato com Sara",
"body": "Confirmar os detalhes da demonstração da Salez.",
"dueDate": "2026-11-23T14:00:00-03:00",
"completed": false,
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}'import requests
url = "https://services.leadconnectorhq.com/contacts/{contactId}/tasks"
payload = {
"title": "Retornar contato com Sara",
"dueDate": "2026-11-23T14:00:00-03:00",
"completed": False,
"body": "Confirmar os detalhes da demonstração da Salez.",
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Retornar contato com Sara',
dueDate: '2026-11-23T14:00:00-03:00',
completed: false,
body: JSON.stringify('Confirmar os detalhes da demonstração da Salez.'),
assignedTo: 'hxHGVRb1YJUscrCB8eXK'
})
};
fetch('https://services.leadconnectorhq.com/contacts/{contactId}/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://services.leadconnectorhq.com/contacts/{contactId}/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' => 'Retornar contato com Sara',
'dueDate' => '2026-11-23T14:00:00-03:00',
'completed' => false,
'body' => 'Confirmar os detalhes da demonstração da Salez.',
'assignedTo' => 'hxHGVRb1YJUscrCB8eXK'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Version: <version>"
],
]);
$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://services.leadconnectorhq.com/contacts/{contactId}/tasks"
payload := strings.NewReader("{\n \"title\": \"Retornar contato com Sara\",\n \"dueDate\": \"2026-11-23T14:00:00-03:00\",\n \"completed\": false,\n \"body\": \"Confirmar os detalhes da demonstração da Salez.\",\n \"assignedTo\": \"hxHGVRb1YJUscrCB8eXK\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Version", "<version>")
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://services.leadconnectorhq.com/contacts/{contactId}/tasks")
.header("Version", "<version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Retornar contato com Sara\",\n \"dueDate\": \"2026-11-23T14:00:00-03:00\",\n \"completed\": false,\n \"body\": \"Confirmar os detalhes da demonstração da Salez.\",\n \"assignedTo\": \"hxHGVRb1YJUscrCB8eXK\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.leadconnectorhq.com/contacts/{contactId}/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Version"] = '<version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Retornar contato com Sara\",\n \"dueDate\": \"2026-11-23T14:00:00-03:00\",\n \"completed\": false,\n \"body\": \"Confirmar os detalhes da demonstração da Salez.\",\n \"assignedTo\": \"hxHGVRb1YJUscrCB8eXK\"\n}"
response = http.request(request)
puts response.read_body{
"task": {
"id": "lJpzYrWdpkC2hX6t2yue",
"title": "Retornar contato com Sara",
"body": "Confirmar os detalhes da demonstração da Salez.",
"assignedTo": "hxHGVRb1YJUscrCB8eXK",
"dueDate": "2026-11-23T14:00:00-03:00",
"completed": false,
"contactId": "seD4PfOuKoVMLkEZqohJ"
}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Token e permissões: na Salez, acesse Configurações > Integrações Privadas para gerar ou gerenciar o token, conforme seu nível de acesso. Esta operação exige o escopo
contacts.write. Envie Authorization: Bearer <token> e Version: v3. Veja a visão geral de Contatos.Autorizações
Parâmetros de caminho
Corpo
application/json
Última modificação em 20 de novembro de 2026
⌘I
cURL
curl --request POST \
--url 'https://services.leadconnectorhq.com/contacts/{contactId}/tasks' \
--header 'Authorization: Bearer <token>' \
--header 'Version: v3' \
--header 'Content-Type: application/json' \
--data '{
"title": "Retornar contato com Sara",
"body": "Confirmar os detalhes da demonstração da Salez.",
"dueDate": "2026-11-23T14:00:00-03:00",
"completed": false,
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}'import requests
url = "https://services.leadconnectorhq.com/contacts/{contactId}/tasks"
payload = {
"title": "Retornar contato com Sara",
"dueDate": "2026-11-23T14:00:00-03:00",
"completed": False,
"body": "Confirmar os detalhes da demonstração da Salez.",
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Retornar contato com Sara',
dueDate: '2026-11-23T14:00:00-03:00',
completed: false,
body: JSON.stringify('Confirmar os detalhes da demonstração da Salez.'),
assignedTo: 'hxHGVRb1YJUscrCB8eXK'
})
};
fetch('https://services.leadconnectorhq.com/contacts/{contactId}/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://services.leadconnectorhq.com/contacts/{contactId}/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' => 'Retornar contato com Sara',
'dueDate' => '2026-11-23T14:00:00-03:00',
'completed' => false,
'body' => 'Confirmar os detalhes da demonstração da Salez.',
'assignedTo' => 'hxHGVRb1YJUscrCB8eXK'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Version: <version>"
],
]);
$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://services.leadconnectorhq.com/contacts/{contactId}/tasks"
payload := strings.NewReader("{\n \"title\": \"Retornar contato com Sara\",\n \"dueDate\": \"2026-11-23T14:00:00-03:00\",\n \"completed\": false,\n \"body\": \"Confirmar os detalhes da demonstração da Salez.\",\n \"assignedTo\": \"hxHGVRb1YJUscrCB8eXK\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Version", "<version>")
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://services.leadconnectorhq.com/contacts/{contactId}/tasks")
.header("Version", "<version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Retornar contato com Sara\",\n \"dueDate\": \"2026-11-23T14:00:00-03:00\",\n \"completed\": false,\n \"body\": \"Confirmar os detalhes da demonstração da Salez.\",\n \"assignedTo\": \"hxHGVRb1YJUscrCB8eXK\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.leadconnectorhq.com/contacts/{contactId}/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Version"] = '<version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Retornar contato com Sara\",\n \"dueDate\": \"2026-11-23T14:00:00-03:00\",\n \"completed\": false,\n \"body\": \"Confirmar os detalhes da demonstração da Salez.\",\n \"assignedTo\": \"hxHGVRb1YJUscrCB8eXK\"\n}"
response = http.request(request)
puts response.read_body{
"task": {
"id": "lJpzYrWdpkC2hX6t2yue",
"title": "Retornar contato com Sara",
"body": "Confirmar os detalhes da demonstração da Salez.",
"assignedTo": "hxHGVRb1YJUscrCB8eXK",
"dueDate": "2026-11-23T14:00:00-03:00",
"completed": false,
"contactId": "seD4PfOuKoVMLkEZqohJ"
}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}
