Search records
curl --request POST \
--url https://api.attio.com/v2/objects/records/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "alan mathis",
"objects": [
"people",
"deals",
"1b31b79a-ddf9-4d57-a320-884061b2bcff"
],
"request_as": {
"type": "workspace"
},
"limit": 25
}
'import requests
url = "https://api.attio.com/v2/objects/records/search"
payload = {
"query": "alan mathis",
"objects": ["people", "deals", "1b31b79a-ddf9-4d57-a320-884061b2bcff"],
"request_as": { "type": "workspace" },
"limit": 25
}
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({
query: 'alan mathis',
objects: ['people', 'deals', '1b31b79a-ddf9-4d57-a320-884061b2bcff'],
request_as: {type: 'workspace'},
limit: 25
})
};
fetch('https://api.attio.com/v2/objects/records/search', 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/objects/records/search",
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([
'query' => 'alan mathis',
'objects' => [
'people',
'deals',
'1b31b79a-ddf9-4d57-a320-884061b2bcff'
],
'request_as' => [
'type' => 'workspace'
],
'limit' => 25
]),
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/objects/records/search"
payload := strings.NewReader("{\n \"query\": \"alan mathis\",\n \"objects\": [\n \"people\",\n \"deals\",\n \"1b31b79a-ddf9-4d57-a320-884061b2bcff\"\n ],\n \"request_as\": {\n \"type\": \"workspace\"\n },\n \"limit\": 25\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/objects/records/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"alan mathis\",\n \"objects\": [\n \"people\",\n \"deals\",\n \"1b31b79a-ddf9-4d57-a320-884061b2bcff\"\n ],\n \"request_as\": {\n \"type\": \"workspace\"\n },\n \"limit\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/objects/records/search")
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 \"query\": \"alan mathis\",\n \"objects\": [\n \"people\",\n \"deals\",\n \"1b31b79a-ddf9-4d57-a320-884061b2bcff\"\n ],\n \"request_as\": {\n \"type\": \"workspace\"\n },\n \"limit\": 25\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"record_id": "bf071e1f-6035-429d-b874-d83ea64ea13b"
},
"record_text": "Alan Mathison Turing",
"record_image": "https://cdn.image-service.com/images/profiles/e67b8980-7dbb-46bf-95e3-266d7bceb096",
"object_slug": "applications"
}
]
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "Object with slug/ID \"foobar\" not found."
}Records
Search records
The search records endpoint provides a convenient way to fuzzy search for records across one or more objects. The matching strategy employed in this endpoint follows the in-product strategy and will match names, domains, emails, phone numbers and social handles on people and companies, and labels on all other objects. Please note, results returned from this endpoint are eventually consistent. For results which are guaranteed to be up to date, please use the record query endpoint instead.
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: record_permission:read, object_configuration:read.
Supported token levels: workspace, user.
POST
/
v2
/
objects
/
records
/
search
Search records
curl --request POST \
--url https://api.attio.com/v2/objects/records/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "alan mathis",
"objects": [
"people",
"deals",
"1b31b79a-ddf9-4d57-a320-884061b2bcff"
],
"request_as": {
"type": "workspace"
},
"limit": 25
}
'import requests
url = "https://api.attio.com/v2/objects/records/search"
payload = {
"query": "alan mathis",
"objects": ["people", "deals", "1b31b79a-ddf9-4d57-a320-884061b2bcff"],
"request_as": { "type": "workspace" },
"limit": 25
}
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({
query: 'alan mathis',
objects: ['people', 'deals', '1b31b79a-ddf9-4d57-a320-884061b2bcff'],
request_as: {type: 'workspace'},
limit: 25
})
};
fetch('https://api.attio.com/v2/objects/records/search', 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/objects/records/search",
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([
'query' => 'alan mathis',
'objects' => [
'people',
'deals',
'1b31b79a-ddf9-4d57-a320-884061b2bcff'
],
'request_as' => [
'type' => 'workspace'
],
'limit' => 25
]),
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/objects/records/search"
payload := strings.NewReader("{\n \"query\": \"alan mathis\",\n \"objects\": [\n \"people\",\n \"deals\",\n \"1b31b79a-ddf9-4d57-a320-884061b2bcff\"\n ],\n \"request_as\": {\n \"type\": \"workspace\"\n },\n \"limit\": 25\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/objects/records/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"alan mathis\",\n \"objects\": [\n \"people\",\n \"deals\",\n \"1b31b79a-ddf9-4d57-a320-884061b2bcff\"\n ],\n \"request_as\": {\n \"type\": \"workspace\"\n },\n \"limit\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/objects/records/search")
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 \"query\": \"alan mathis\",\n \"objects\": [\n \"people\",\n \"deals\",\n \"1b31b79a-ddf9-4d57-a320-884061b2bcff\"\n ],\n \"request_as\": {\n \"type\": \"workspace\"\n },\n \"limit\": 25\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"record_id": "bf071e1f-6035-429d-b874-d83ea64ea13b"
},
"record_text": "Alan Mathison Turing",
"record_image": "https://cdn.image-service.com/images/profiles/e67b8980-7dbb-46bf-95e3-266d7bceb096",
"object_slug": "applications"
}
]
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "Object with slug/ID \"foobar\" not found."
}Authorizations
Scopes
Body
application/json
Was this page helpful?