Create a comment
curl --request POST \
--url https://api.attio.com/v2/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"format": "plaintext",
"content": "If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.",
"author": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"thread_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2",
"created_at": "2023-01-01T15:00:00.000000000Z"
}
}
'import requests
url = "https://api.attio.com/v2/comments"
payload = { "data": {
"format": "plaintext",
"content": "If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.",
"author": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"thread_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2",
"created_at": "2023-01-01T15:00:00.000000000Z"
} }
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: {
format: 'plaintext',
content: 'If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.',
author: {type: 'workspace-member', id: '50cf242c-7fa3-4cad-87d0-75b1af71c57b'},
thread_id: 'aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2',
created_at: '2023-01-01T15:00:00.000000000Z'
}
})
};
fetch('https://api.attio.com/v2/comments', 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/comments",
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' => [
'format' => 'plaintext',
'content' => 'If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.',
'author' => [
'type' => 'workspace-member',
'id' => '50cf242c-7fa3-4cad-87d0-75b1af71c57b'
],
'thread_id' => 'aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2',
'created_at' => '2023-01-01T15:00:00.000000000Z'
]
]),
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/comments"
payload := strings.NewReader("{\n \"data\": {\n \"format\": \"plaintext\",\n \"content\": \"If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.\",\n \"author\": {\n \"type\": \"workspace-member\",\n \"id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n },\n \"thread_id\": \"aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2\",\n \"created_at\": \"2023-01-01T15:00:00.000000000Z\"\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/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"format\": \"plaintext\",\n \"content\": \"If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.\",\n \"author\": {\n \"type\": \"workspace-member\",\n \"id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n },\n \"thread_id\": \"aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2\",\n \"created_at\": \"2023-01-01T15:00:00.000000000Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/comments")
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 \"format\": \"plaintext\",\n \"content\": \"If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.\",\n \"author\": {\n \"type\": \"workspace-member\",\n \"id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n },\n \"thread_id\": \"aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2\",\n \"created_at\": \"2023-01-01T15:00:00.000000000Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"comment_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2"
},
"thread_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2",
"content_plaintext": "Let's go ahead and close this deal, alice@attio.com.",
"entry": {
"entry_id": "2e6e29ea-c4e0-4f44-842d-78a891f8c156",
"list_id": "33ebdbe9-e529-47c9-b894-0ba25e9c15c0"
},
"record": {
"record_id": "bf071e1f-6035-429d-b874-d83ea64ea13b",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
},
"resolved_at": "2023-01-01T15:00:00.000000000Z",
"resolved_by": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"created_at": "2023-01-01T15:00:00.000000000Z",
"author": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
}
}{
"statusCode": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "The referenced Thread could not be found, it might have been deleted."
}Comments
Create a comment
Creates a new comment related to an existing thread, record or entry.
To create comments on records, you will need the object_configuration:read and record_permission:read scopes.
To create comments on list entries, you will need the list_configuration:read and list_entry:read scopes.
Required scopes: comment:read-write.
POST
/
v2
/
comments
Create a comment
curl --request POST \
--url https://api.attio.com/v2/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"format": "plaintext",
"content": "If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.",
"author": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"thread_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2",
"created_at": "2023-01-01T15:00:00.000000000Z"
}
}
'import requests
url = "https://api.attio.com/v2/comments"
payload = { "data": {
"format": "plaintext",
"content": "If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.",
"author": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"thread_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2",
"created_at": "2023-01-01T15:00:00.000000000Z"
} }
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: {
format: 'plaintext',
content: 'If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.',
author: {type: 'workspace-member', id: '50cf242c-7fa3-4cad-87d0-75b1af71c57b'},
thread_id: 'aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2',
created_at: '2023-01-01T15:00:00.000000000Z'
}
})
};
fetch('https://api.attio.com/v2/comments', 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/comments",
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' => [
'format' => 'plaintext',
'content' => 'If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.',
'author' => [
'type' => 'workspace-member',
'id' => '50cf242c-7fa3-4cad-87d0-75b1af71c57b'
],
'thread_id' => 'aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2',
'created_at' => '2023-01-01T15:00:00.000000000Z'
]
]),
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/comments"
payload := strings.NewReader("{\n \"data\": {\n \"format\": \"plaintext\",\n \"content\": \"If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.\",\n \"author\": {\n \"type\": \"workspace-member\",\n \"id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n },\n \"thread_id\": \"aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2\",\n \"created_at\": \"2023-01-01T15:00:00.000000000Z\"\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/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"format\": \"plaintext\",\n \"content\": \"If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.\",\n \"author\": {\n \"type\": \"workspace-member\",\n \"id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n },\n \"thread_id\": \"aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2\",\n \"created_at\": \"2023-01-01T15:00:00.000000000Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/comments")
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 \"format\": \"plaintext\",\n \"content\": \"If I put the email address of my colleague on Attio in here, e.g. alice@attio.com, they will be notified. Other emails (e.g. person@example.com) will be turned into clickable links.\",\n \"author\": {\n \"type\": \"workspace-member\",\n \"id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\"\n },\n \"thread_id\": \"aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2\",\n \"created_at\": \"2023-01-01T15:00:00.000000000Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"comment_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2"
},
"thread_id": "aa1dc1d9-93ac-4c6c-987e-16b6eea9aab2",
"content_plaintext": "Let's go ahead and close this deal, alice@attio.com.",
"entry": {
"entry_id": "2e6e29ea-c4e0-4f44-842d-78a891f8c156",
"list_id": "33ebdbe9-e529-47c9-b894-0ba25e9c15c0"
},
"record": {
"record_id": "bf071e1f-6035-429d-b874-d83ea64ea13b",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
},
"resolved_at": "2023-01-01T15:00:00.000000000Z",
"resolved_by": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"created_at": "2023-01-01T15:00:00.000000000Z",
"author": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
}
}
}{
"statusCode": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "The referenced Thread could not be found, it might have been deleted."
}Was this page helpful?
⌘I