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, a domain, and a record that resolves to either.
- 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.
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
This API uses OAuth 2.0 with the authorization code grant flow.
Query Parameters
The maximum number of emails to return. Must be between 1 and 50. Defaults to 25.
1 <= x <= 5025
A pagination cursor used to fetch the next page of emails. Responses with more emails will include a cursor for you to use here. If not provided, the first page will be returned.
The object to filter emails by. Must be the slug or ID of either the people or companies object. If provided, linked_record_ids must also be provided.
1A comma-separated list of up to 10 record IDs to filter emails by. All IDs must belong to the object given in linked_object, so filtering by both people and companies requires two requests. If provided, linked_object must also be provided.
A comma-separated list of up to 10 email addresses. Emails that include at least one of them as a participant are returned.
A domain to filter emails by. Emails with at least one participant at this domain are returned.
1"fundstack.com"
Only return emails sent after this timestamp. sent_after is exclusive, so an email sent at exactly this timestamp is not returned.
Only return emails sent before this timestamp. sent_before is exclusive, so an email sent at exactly this timestamp is not returned.
Was this page helpful?