curl --request POST \
--url https://api.vectorshift.ai/v1/object-model/record-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"limit": 10,
"sources": [
{
"fields": [
"name"
],
"filter": {
"conditions": [
{
"field": "stage",
"op": "eq",
"value": "diligence"
},
{
"field": "size",
"op": "gt",
"value": 5000000
}
],
"op": "all"
},
"identity": [
"name"
],
"type_id": "deal"
}
],
"text": "Acme",
"typos": false
}
'import requests
url = "https://api.vectorshift.ai/v1/object-model/record-search"
payload = {
"limit": 10,
"sources": [
{
"fields": ["name"],
"filter": {
"conditions": [
{
"field": "stage",
"op": "eq",
"value": "diligence"
},
{
"field": "size",
"op": "gt",
"value": 5000000
}
],
"op": "all"
},
"identity": ["name"],
"type_id": "deal"
}
],
"text": "Acme",
"typos": False
}
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({
limit: 10,
sources: [
{
fields: ['name'],
filter: {
conditions: [
{field: 'stage', op: 'eq', value: 'diligence'},
{field: 'size', op: 'gt', value: 5000000}
],
op: 'all'
},
identity: ['name'],
type_id: 'deal'
}
],
text: 'Acme',
typos: false
})
};
fetch('https://api.vectorshift.ai/v1/object-model/record-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.vectorshift.ai/v1/object-model/record-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([
'limit' => 10,
'sources' => [
[
'fields' => [
'name'
],
'filter' => [
'conditions' => [
[
'field' => 'stage',
'op' => 'eq',
'value' => 'diligence'
],
[
'field' => 'size',
'op' => 'gt',
'value' => 5000000
]
],
'op' => 'all'
],
'identity' => [
'name'
],
'type_id' => 'deal'
]
],
'text' => 'Acme',
'typos' => false
]),
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.vectorshift.ai/v1/object-model/record-search"
payload := strings.NewReader("{\n \"limit\": 10,\n \"sources\": [\n {\n \"fields\": [\n \"name\"\n ],\n \"filter\": {\n \"conditions\": [\n {\n \"field\": \"stage\",\n \"op\": \"eq\",\n \"value\": \"diligence\"\n },\n {\n \"field\": \"size\",\n \"op\": \"gt\",\n \"value\": 5000000\n }\n ],\n \"op\": \"all\"\n },\n \"identity\": [\n \"name\"\n ],\n \"type_id\": \"deal\"\n }\n ],\n \"text\": \"Acme\",\n \"typos\": false\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.vectorshift.ai/v1/object-model/record-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 10,\n \"sources\": [\n {\n \"fields\": [\n \"name\"\n ],\n \"filter\": {\n \"conditions\": [\n {\n \"field\": \"stage\",\n \"op\": \"eq\",\n \"value\": \"diligence\"\n },\n {\n \"field\": \"size\",\n \"op\": \"gt\",\n \"value\": 5000000\n }\n ],\n \"op\": \"all\"\n },\n \"identity\": [\n \"name\"\n ],\n \"type_id\": \"deal\"\n }\n ],\n \"text\": \"Acme\",\n \"typos\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vectorshift.ai/v1/object-model/record-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 \"limit\": 10,\n \"sources\": [\n {\n \"fields\": [\n \"name\"\n ],\n \"filter\": {\n \"conditions\": [\n {\n \"field\": \"stage\",\n \"op\": \"eq\",\n \"value\": \"diligence\"\n },\n {\n \"field\": \"size\",\n \"op\": \"gt\",\n \"value\": 5000000\n }\n ],\n \"op\": \"all\"\n },\n \"identity\": [\n \"name\"\n ],\n \"type_id\": \"deal\"\n }\n ],\n \"text\": \"Acme\",\n \"typos\": false\n}"
response = http.request(request)
puts response.read_body{
"deleted_id": "<string>",
"disposition": "<string>",
"next_cursor": "<string>",
"records": [
{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"id": "<string>",
"label": "<string>",
"links": {},
"locked": true,
"revision": "<string>",
"type_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"values": {}
}
],
"summary": {},
"total_count": "<string>",
"written_id": "<string>"
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}Search records
Ranked search across record types: the text, and the sources — each a type, an optional filter that narrows it before ranking, and the fields searched.
curl --request POST \
--url https://api.vectorshift.ai/v1/object-model/record-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"limit": 10,
"sources": [
{
"fields": [
"name"
],
"filter": {
"conditions": [
{
"field": "stage",
"op": "eq",
"value": "diligence"
},
{
"field": "size",
"op": "gt",
"value": 5000000
}
],
"op": "all"
},
"identity": [
"name"
],
"type_id": "deal"
}
],
"text": "Acme",
"typos": false
}
'import requests
url = "https://api.vectorshift.ai/v1/object-model/record-search"
payload = {
"limit": 10,
"sources": [
{
"fields": ["name"],
"filter": {
"conditions": [
{
"field": "stage",
"op": "eq",
"value": "diligence"
},
{
"field": "size",
"op": "gt",
"value": 5000000
}
],
"op": "all"
},
"identity": ["name"],
"type_id": "deal"
}
],
"text": "Acme",
"typos": False
}
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({
limit: 10,
sources: [
{
fields: ['name'],
filter: {
conditions: [
{field: 'stage', op: 'eq', value: 'diligence'},
{field: 'size', op: 'gt', value: 5000000}
],
op: 'all'
},
identity: ['name'],
type_id: 'deal'
}
],
text: 'Acme',
typos: false
})
};
fetch('https://api.vectorshift.ai/v1/object-model/record-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.vectorshift.ai/v1/object-model/record-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([
'limit' => 10,
'sources' => [
[
'fields' => [
'name'
],
'filter' => [
'conditions' => [
[
'field' => 'stage',
'op' => 'eq',
'value' => 'diligence'
],
[
'field' => 'size',
'op' => 'gt',
'value' => 5000000
]
],
'op' => 'all'
],
'identity' => [
'name'
],
'type_id' => 'deal'
]
],
'text' => 'Acme',
'typos' => false
]),
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.vectorshift.ai/v1/object-model/record-search"
payload := strings.NewReader("{\n \"limit\": 10,\n \"sources\": [\n {\n \"fields\": [\n \"name\"\n ],\n \"filter\": {\n \"conditions\": [\n {\n \"field\": \"stage\",\n \"op\": \"eq\",\n \"value\": \"diligence\"\n },\n {\n \"field\": \"size\",\n \"op\": \"gt\",\n \"value\": 5000000\n }\n ],\n \"op\": \"all\"\n },\n \"identity\": [\n \"name\"\n ],\n \"type_id\": \"deal\"\n }\n ],\n \"text\": \"Acme\",\n \"typos\": false\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.vectorshift.ai/v1/object-model/record-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 10,\n \"sources\": [\n {\n \"fields\": [\n \"name\"\n ],\n \"filter\": {\n \"conditions\": [\n {\n \"field\": \"stage\",\n \"op\": \"eq\",\n \"value\": \"diligence\"\n },\n {\n \"field\": \"size\",\n \"op\": \"gt\",\n \"value\": 5000000\n }\n ],\n \"op\": \"all\"\n },\n \"identity\": [\n \"name\"\n ],\n \"type_id\": \"deal\"\n }\n ],\n \"text\": \"Acme\",\n \"typos\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vectorshift.ai/v1/object-model/record-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 \"limit\": 10,\n \"sources\": [\n {\n \"fields\": [\n \"name\"\n ],\n \"filter\": {\n \"conditions\": [\n {\n \"field\": \"stage\",\n \"op\": \"eq\",\n \"value\": \"diligence\"\n },\n {\n \"field\": \"size\",\n \"op\": \"gt\",\n \"value\": 5000000\n }\n ],\n \"op\": \"all\"\n },\n \"identity\": [\n \"name\"\n ],\n \"type_id\": \"deal\"\n }\n ],\n \"text\": \"Acme\",\n \"typos\": false\n}"
response = http.request(request)
puts response.read_body{
"deleted_id": "<string>",
"disposition": "<string>",
"next_cursor": "<string>",
"records": [
{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"id": "<string>",
"label": "<string>",
"links": {},
"locked": true,
"revision": "<string>",
"type_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"values": {}
}
],
"summary": {},
"total_count": "<string>",
"written_id": "<string>"
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}{
"code": "<string>",
"error": "<string>",
"status": "failed",
"details": {},
"path": "<string>",
"request_id": "<string>",
"result": {}
}Authorizations
An API key issued with object_model scopes: Authorization: Bearer sk_…. The scopes: object_model:records:read, object_model:records:write, object_model:facts:read, object_model:facts:write, object_model:model:read, object_model:model:configure, object_model:actions:run, object_model:changes:read. An operation's security lists the scopes it needs; several entries mean any one of them will do. A person field (ref(user), ref_list(user)) holds a user id: look people up by email or id with GET /v1/users, outside this API, with a key that also has users:read.
Response
Answered.
With aggregates or group: {"aggregates": [{"field", "op", "value", "error"}], "groups": [{"value", "count", "aggregates": […]}], "groups_truncated"}. aggregates are in the order asked, over every match, not only this page. A count is 0 when nothing matches; a sum, average, min or max is null when no match has a value. groups has one entry per value of the group field, in ascending order (records with no value form a group whose value is null), at most 200, with groups_truncated set past that. Sent again on every page.
