Create a task
curl --request POST \
--url https://api.attio.com/v2/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"content": "Follow up on current software solutions",
"format": "plaintext",
"deadline_at": "2023-01-01T15:00:00.000000000Z",
"is_completed": false,
"linked_records": [
"person@company.com",
"fundstack.com"
],
"assignees": [
{
"referenced_actor_type": "workspace-member",
"referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
]
}
}
'import requests
url = "https://api.attio.com/v2/tasks"
payload = { "data": {
"content": "Follow up on current software solutions",
"format": "plaintext",
"deadline_at": "2023-01-01T15:00:00.000000000Z",
"is_completed": False,
"linked_records": ["person@company.com", "fundstack.com"],
"assignees": [
{
"referenced_actor_type": "workspace-member",
"referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
]
} }
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({
data: {
content: 'Follow up on current software solutions',
format: 'plaintext',
deadline_at: '2023-01-01T15:00:00.000000000Z',
is_completed: false,
linked_records: ['person@company.com', 'fundstack.com'],
assignees: [
{
referenced_actor_type: 'workspace-member',
referenced_actor_id: '50cf242c-7fa3-4cad-87d0-75b1af71c57b'
}
]
}
})
};
fetch('https://api.attio.com/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.attio.com/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([
'data' => [
'content' => 'Follow up on current software solutions',
'format' => 'plaintext',
'deadline_at' => '2023-01-01T15:00:00.000000000Z',
'is_completed' => false,
'linked_records' => [
'person@company.com',
'fundstack.com'
],
'assignees' => [
[
'referenced_actor_type' => 'workspace-member',
'referenced_actor_id' => '50cf242c-7fa3-4cad-87d0-75b1af71c57b'
]
]
]
]),
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://api.attio.com/v2/tasks"
payload := strings.NewReader("{\n \"data\": {\n \"content\": \"Follow up on current software solutions\",\n \"format\": \"plaintext\",\n \"deadline_at\": \"2023-01-01T15:00:00.000000000Z\",\n \"is_completed\": false,\n \"linked_records\": [\n \"person@company.com\",\n \"fundstack.com\"\n ],\n \"assignees\": [\n {\n \"referenced_actor_type\": \"workspace-member\",\n \"referenced_actor_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n }\n ]\n }\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://api.attio.com/v2/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"content\": \"Follow up on current software solutions\",\n \"format\": \"plaintext\",\n \"deadline_at\": \"2023-01-01T15:00:00.000000000Z\",\n \"is_completed\": false,\n \"linked_records\": [\n \"person@company.com\",\n \"fundstack.com\"\n ],\n \"assignees\": [\n {\n \"referenced_actor_type\": \"workspace-member\",\n \"referenced_actor_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/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 \"data\": {\n \"content\": \"Follow up on current software solutions\",\n \"format\": \"plaintext\",\n \"deadline_at\": \"2023-01-01T15:00:00.000000000Z\",\n \"is_completed\": false,\n \"linked_records\": [\n \"person@company.com\",\n \"fundstack.com\"\n ],\n \"assignees\": [\n {\n \"referenced_actor_type\": \"workspace-member\",\n \"referenced_actor_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"task_id": "649e34f4-c39a-4f4d-99ef-48a36bef8f04"
},
"content_plaintext": "Follow up on current software solutions",
"deadline_at": "2023-01-01",
"is_completed": false,
"completed_at": "2022-11-21T13:22:49.061281000Z",
"linked_records": [
{
"target_object_id": "people",
"target_record_id": "891dcbfc-9141-415d-9b2a-2238a6cc012d"
}
],
"assignees": [
{
"referenced_actor_type": "workspace-member",
"referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
],
"created_by_actor": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"created_at": "2022-11-21T13:22:49.061281000Z"
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "validation_type",
"message": "Only standard or custom object records can be linked to."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Object with slug/ID \"people\" not found."
}Tasks
Create a task
Creates a new task.
At present, tasks can only be created from plaintext without record reference formatting.
Required scopes: task:read-write, object_configuration:read, record_permission:read, user_management:read.
POST
/
v2
/
tasks
Create a task
curl --request POST \
--url https://api.attio.com/v2/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"content": "Follow up on current software solutions",
"format": "plaintext",
"deadline_at": "2023-01-01T15:00:00.000000000Z",
"is_completed": false,
"linked_records": [
"person@company.com",
"fundstack.com"
],
"assignees": [
{
"referenced_actor_type": "workspace-member",
"referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
]
}
}
'import requests
url = "https://api.attio.com/v2/tasks"
payload = { "data": {
"content": "Follow up on current software solutions",
"format": "plaintext",
"deadline_at": "2023-01-01T15:00:00.000000000Z",
"is_completed": False,
"linked_records": ["person@company.com", "fundstack.com"],
"assignees": [
{
"referenced_actor_type": "workspace-member",
"referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
]
} }
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({
data: {
content: 'Follow up on current software solutions',
format: 'plaintext',
deadline_at: '2023-01-01T15:00:00.000000000Z',
is_completed: false,
linked_records: ['person@company.com', 'fundstack.com'],
assignees: [
{
referenced_actor_type: 'workspace-member',
referenced_actor_id: '50cf242c-7fa3-4cad-87d0-75b1af71c57b'
}
]
}
})
};
fetch('https://api.attio.com/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.attio.com/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([
'data' => [
'content' => 'Follow up on current software solutions',
'format' => 'plaintext',
'deadline_at' => '2023-01-01T15:00:00.000000000Z',
'is_completed' => false,
'linked_records' => [
'person@company.com',
'fundstack.com'
],
'assignees' => [
[
'referenced_actor_type' => 'workspace-member',
'referenced_actor_id' => '50cf242c-7fa3-4cad-87d0-75b1af71c57b'
]
]
]
]),
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://api.attio.com/v2/tasks"
payload := strings.NewReader("{\n \"data\": {\n \"content\": \"Follow up on current software solutions\",\n \"format\": \"plaintext\",\n \"deadline_at\": \"2023-01-01T15:00:00.000000000Z\",\n \"is_completed\": false,\n \"linked_records\": [\n \"person@company.com\",\n \"fundstack.com\"\n ],\n \"assignees\": [\n {\n \"referenced_actor_type\": \"workspace-member\",\n \"referenced_actor_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n }\n ]\n }\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://api.attio.com/v2/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"content\": \"Follow up on current software solutions\",\n \"format\": \"plaintext\",\n \"deadline_at\": \"2023-01-01T15:00:00.000000000Z\",\n \"is_completed\": false,\n \"linked_records\": [\n \"person@company.com\",\n \"fundstack.com\"\n ],\n \"assignees\": [\n {\n \"referenced_actor_type\": \"workspace-member\",\n \"referenced_actor_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/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 \"data\": {\n \"content\": \"Follow up on current software solutions\",\n \"format\": \"plaintext\",\n \"deadline_at\": \"2023-01-01T15:00:00.000000000Z\",\n \"is_completed\": false,\n \"linked_records\": [\n \"person@company.com\",\n \"fundstack.com\"\n ],\n \"assignees\": [\n {\n \"referenced_actor_type\": \"workspace-member\",\n \"referenced_actor_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"task_id": "649e34f4-c39a-4f4d-99ef-48a36bef8f04"
},
"content_plaintext": "Follow up on current software solutions",
"deadline_at": "2023-01-01",
"is_completed": false,
"completed_at": "2022-11-21T13:22:49.061281000Z",
"linked_records": [
{
"target_object_id": "people",
"target_record_id": "891dcbfc-9141-415d-9b2a-2238a6cc012d"
}
],
"assignees": [
{
"referenced_actor_type": "workspace-member",
"referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
],
"created_by_actor": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"created_at": "2022-11-21T13:22:49.061281000Z"
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "validation_type",
"message": "Only standard or custom object records can be linked to."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Object with slug/ID \"people\" not found."
}Was this page helpful?
⌘I