curl --request GET \
--url https://api.attio.com/v2/emails \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.attio.com/v2/emails"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.attio.com/v2/emails', 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/emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.attio.com/v2/emails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.attio.com/v2/emails")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"mailbox_id": "7f3a1c88-2e4b-4d59-9a0c-6b8d5e7f1a23",
"email_id": "d2c4f0a1-5b6e-4a7c-8d9e-1f2a3b4c5d6e"
},
"sent_at": "2023-01-01T15:00:00.000000000Z",
"direction": "outbound",
"subject_line": "Re: Q3 renewal",
"participants": [
{
"role": "from",
"email_address": "person@company.com",
"email_domain": "fundstack.com",
"name": "Simon Mitchell"
}
],
"linked_records": [
{
"object_slug": "people",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"record_id": "891dcbfc-9141-415d-9b2a-2238a6cc012d"
}
]
}
],
"pagination": {
"next_cursor": "<string>"
}
}List emails
Lists email metadata from your workspace’s connected mailboxes. Email content is never returned.
At least one of linked_object with linked_record_ids, participants, or domain must be supplied; there is no way to list every email. When several are supplied they are combined with OR: emails matching any of the filters are returned.
Requesting access: this endpoint is enabled per workspace and per app while it is in alpha. Contact support@attio.com to request access.
Things to know
- Filters that identify your own workspace are ignored. This covers a member’s or invited member’s address, one of your mailboxes, and any of their domains. If every filter you supply is ignored, an empty page is returned.
- A filter that names a protected recipient in your workspace is rejected rather than ignored. This covers an address or a domain you supply directly. A record whose address or domain is a protected recipient is ignored instead, in the same way as the filters above.
- Emails from a mailbox shared with your workspace as metadata only are returned without a subject line. An email is left out entirely when it has no participant you may see — that is, when every participant outside your workspace is a protected recipient.
- An email that reached more than one of your mailboxes is returned once, and
id.mailbox_ididentifies whichever copy was readable. linked_recordsis derived when you make the request rather than stored, so it reflects your records as they are now.- Emails are returned newest first, ordered by when they were sent. Each request scans a bounded number of emails, so a page can hold fewer emails than
limit, or none at all, while more are still available. Keep paginating for as long as anext_cursoris returned, rather than stopping on a short page.
This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
Required scopes: email:read, record_permission:read, object_configuration:read.
Supported token levels: workspace.
curl --request GET \
--url https://api.attio.com/v2/emails \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.attio.com/v2/emails"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.attio.com/v2/emails', 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/emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.attio.com/v2/emails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.attio.com/v2/emails")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"mailbox_id": "7f3a1c88-2e4b-4d59-9a0c-6b8d5e7f1a23",
"email_id": "d2c4f0a1-5b6e-4a7c-8d9e-1f2a3b4c5d6e"
},
"sent_at": "2023-01-01T15:00:00.000000000Z",
"direction": "outbound",
"subject_line": "Re: Q3 renewal",
"participants": [
{
"role": "from",
"email_address": "person@company.com",
"email_domain": "fundstack.com",
"name": "Simon Mitchell"
}
],
"linked_records": [
{
"object_slug": "people",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"record_id": "891dcbfc-9141-415d-9b2a-2238a6cc012d"
}
]
}
],
"pagination": {
"next_cursor": "<string>"
}
}Authorizations
Scopes
Query Parameters
If true, an email is only returned when at least one participant outside your workspace looks like a person rather than an automated sender (notifications@, no-reply@, meeting notetakers, …). Defaults to false, which returns every email regardless of who sent it.
false
Was this page helpful?