curl --request POST \
--url https://api.attio.com/v2/activities/{activity}/records/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"direction": "Outbound"
},
"sorts": [
{
"direction": "desc",
"attribute": "timestamp"
}
],
"limit": 500,
"offset": 0
}
'import requests
url = "https://api.attio.com/v2/activities/{activity}/records/query"
payload = {
"filter": { "direction": "Outbound" },
"sorts": [
{
"direction": "desc",
"attribute": "timestamp"
}
],
"limit": 500,
"offset": 0
}
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({
filter: {direction: 'Outbound'},
sorts: [{direction: 'desc', attribute: 'timestamp'}],
limit: 500,
offset: 0
})
};
fetch('https://api.attio.com/v2/activities/{activity}/records/query', 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/activities/{activity}/records/query",
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([
'filter' => [
'direction' => 'Outbound'
],
'sorts' => [
[
'direction' => 'desc',
'attribute' => 'timestamp'
]
],
'limit' => 500,
'offset' => 0
]),
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/activities/{activity}/records/query"
payload := strings.NewReader("{\n \"filter\": {\n \"direction\": \"Outbound\"\n },\n \"sorts\": [\n {\n \"direction\": \"desc\",\n \"attribute\": \"timestamp\"\n }\n ],\n \"limit\": 500,\n \"offset\": 0\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/activities/{activity}/records/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"direction\": \"Outbound\"\n },\n \"sorts\": [\n {\n \"direction\": \"desc\",\n \"attribute\": \"timestamp\"\n }\n ],\n \"limit\": 500,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/activities/{activity}/records/query")
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 \"filter\": {\n \"direction\": \"Outbound\"\n },\n \"sorts\": [\n {\n \"direction\": \"desc\",\n \"attribute\": \"timestamp\"\n }\n ],\n \"limit\": 500,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"activity_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"record_id": "5f4f2d9c-2b3e-4a83-9c76-1de3a3f14f26"
},
"created_at": "2022-11-21T13:22:49.061281000Z",
"values": {}
}
]
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "filter_error",
"message": "Error in filter."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Activity with slug/ID \"phone_calls\" not found."
}List activity records
Lists activity records, with the option to filter and sort results.
This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
Required scopes: activity_record:read, activity_configuration:read, object_configuration:read, record_permission:read.
Supported token levels: workspace, user.
curl --request POST \
--url https://api.attio.com/v2/activities/{activity}/records/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"direction": "Outbound"
},
"sorts": [
{
"direction": "desc",
"attribute": "timestamp"
}
],
"limit": 500,
"offset": 0
}
'import requests
url = "https://api.attio.com/v2/activities/{activity}/records/query"
payload = {
"filter": { "direction": "Outbound" },
"sorts": [
{
"direction": "desc",
"attribute": "timestamp"
}
],
"limit": 500,
"offset": 0
}
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({
filter: {direction: 'Outbound'},
sorts: [{direction: 'desc', attribute: 'timestamp'}],
limit: 500,
offset: 0
})
};
fetch('https://api.attio.com/v2/activities/{activity}/records/query', 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/activities/{activity}/records/query",
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([
'filter' => [
'direction' => 'Outbound'
],
'sorts' => [
[
'direction' => 'desc',
'attribute' => 'timestamp'
]
],
'limit' => 500,
'offset' => 0
]),
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/activities/{activity}/records/query"
payload := strings.NewReader("{\n \"filter\": {\n \"direction\": \"Outbound\"\n },\n \"sorts\": [\n {\n \"direction\": \"desc\",\n \"attribute\": \"timestamp\"\n }\n ],\n \"limit\": 500,\n \"offset\": 0\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/activities/{activity}/records/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"direction\": \"Outbound\"\n },\n \"sorts\": [\n {\n \"direction\": \"desc\",\n \"attribute\": \"timestamp\"\n }\n ],\n \"limit\": 500,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/activities/{activity}/records/query")
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 \"filter\": {\n \"direction\": \"Outbound\"\n },\n \"sorts\": [\n {\n \"direction\": \"desc\",\n \"attribute\": \"timestamp\"\n }\n ],\n \"limit\": 500,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"activity_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"record_id": "5f4f2d9c-2b3e-4a83-9c76-1de3a3f14f26"
},
"created_at": "2022-11-21T13:22:49.061281000Z",
"values": {}
}
]
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "filter_error",
"message": "Error in filter."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Activity with slug/ID \"phone_calls\" not found."
}Authorizations
This API uses OAuth 2.0 with the authorization code grant flow.
Path Parameters
A UUID or slug to identify the activity.
"phone_calls"
Body
An object used to filter results to a subset of results. Cannot be used together with filter_view_id. See the full guide to filtering and sorting here.
{ "name": "Ada Lovelace" }
An object used to sort results. See the full guide to filtering and sorting here.
Sort by attribute
- Option 1
- Option 2
Show child attributes
Show child attributes
[
{
"direction": "asc",
"attribute": "name",
"field": "last_name"
}
]
The maximum number of results to return. Defaults to 500. See the full guide to pagination here.
500
The number of results to skip over before returning. Defaults to 0. See the full guide to pagination here.
0
Response
Success
Success
Show child attributes
Show child attributes
Was this page helpful?