Search companies
curl --request POST \
--url http://localhost:8080/companies/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {
"owner_ids": [
0
],
"unowned": true,
"custom_data": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"search": "<string>",
"ordering": {},
"page": 4503599627370496,
"limit": 100
}
'import requests
url = "http://localhost:8080/companies/search"
payload = {
"filters": {
"owner_ids": [0],
"unowned": True,
"custom_data": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"search": "<string>",
"ordering": {},
"page": 4503599627370496,
"limit": 100
}
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({
filters: {
owner_ids: [0],
unowned: true,
custom_data: [{key: '<string>', value: '<string>'}]
},
search: '<string>',
ordering: {},
page: 4503599627370496,
limit: 100
})
};
fetch('http://localhost:8080/companies/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/companies/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([
'filters' => [
'owner_ids' => [
0
],
'unowned' => true,
'custom_data' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
],
'search' => '<string>',
'ordering' => [
],
'page' => 4503599627370496,
'limit' => 100
]),
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 := "http://localhost:8080/companies/search"
payload := strings.NewReader("{\n \"filters\": {\n \"owner_ids\": [\n 0\n ],\n \"unowned\": true,\n \"custom_data\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"search\": \"<string>\",\n \"ordering\": {},\n \"page\": 4503599627370496,\n \"limit\": 100\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("http://localhost:8080/companies/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"owner_ids\": [\n 0\n ],\n \"unowned\": true,\n \"custom_data\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"search\": \"<string>\",\n \"ordering\": {},\n \"page\": 4503599627370496,\n \"limit\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/companies/search")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"owner_ids\": [\n 0\n ],\n \"unowned\": true,\n \"custom_data\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"search\": \"<string>\",\n \"ordering\": {},\n \"page\": 4503599627370496,\n \"limit\": 100\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"name": "<string>",
"custom_data": {},
"agent_owner": {
"id": 0,
"name": "<string>",
"email": "jsmith@example.com"
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"total": 123,
"page": 123,
"limit": 123
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Companies
Search companies
Find companies by the teammate who owns them, by attribute conditions such as a plan or a subscription date, or by name, sorted and paged.
POST
/
companies
/
search
Search companies
curl --request POST \
--url http://localhost:8080/companies/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {
"owner_ids": [
0
],
"unowned": true,
"custom_data": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"search": "<string>",
"ordering": {},
"page": 4503599627370496,
"limit": 100
}
'import requests
url = "http://localhost:8080/companies/search"
payload = {
"filters": {
"owner_ids": [0],
"unowned": True,
"custom_data": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"search": "<string>",
"ordering": {},
"page": 4503599627370496,
"limit": 100
}
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({
filters: {
owner_ids: [0],
unowned: true,
custom_data: [{key: '<string>', value: '<string>'}]
},
search: '<string>',
ordering: {},
page: 4503599627370496,
limit: 100
})
};
fetch('http://localhost:8080/companies/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/companies/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([
'filters' => [
'owner_ids' => [
0
],
'unowned' => true,
'custom_data' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
],
'search' => '<string>',
'ordering' => [
],
'page' => 4503599627370496,
'limit' => 100
]),
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 := "http://localhost:8080/companies/search"
payload := strings.NewReader("{\n \"filters\": {\n \"owner_ids\": [\n 0\n ],\n \"unowned\": true,\n \"custom_data\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"search\": \"<string>\",\n \"ordering\": {},\n \"page\": 4503599627370496,\n \"limit\": 100\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("http://localhost:8080/companies/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"owner_ids\": [\n 0\n ],\n \"unowned\": true,\n \"custom_data\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"search\": \"<string>\",\n \"ordering\": {},\n \"page\": 4503599627370496,\n \"limit\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/companies/search")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"owner_ids\": [\n 0\n ],\n \"unowned\": true,\n \"custom_data\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"search\": \"<string>\",\n \"ordering\": {},\n \"page\": 4503599627370496,\n \"limit\": 100\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"name": "<string>",
"custom_data": {},
"agent_owner": {
"id": 0,
"name": "<string>",
"email": "jsmith@example.com"
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"total": 123,
"page": 123,
"limit": 123
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Every filter you send must hold, so each one narrows the result. Leave
filters out to page through every company.
{
"filters": {
"owner_ids": [12],
"custom_data": [
{ "key": "plan", "op": "eq", "value": "enterprise" },
{ "key": "subscriptionStart", "op": "after", "value": "2025-03-01" }
]
},
"search": "acme",
"ordering": { "field": "contacts_count", "direction": "desc" },
"page": 1,
"limit": 50
}
Owner
owner_ids matches companies owned by any of the listed teammates. unowned: true matches companies nobody owns. Send both to get “these teammates’ companies, plus the unowned ones”.
Attribute conditions
op | Matches when the attribute… | value |
|---|---|---|
exists / not_exists | is set / is not set | — |
eq / neq | equals / does not equal the value | text |
contains | contains the value, ignoring case | text |
before / after | is a date earlier / later than the day | YYYY-MM-DD |
eq also matches numbers and booleans, so "value": "40" finds a seats attribute stored as 40.
before and after read the attribute as a date when it holds a whole ISO 8601 date or timestamp ("2025-03-14", "2025-03-14T09:30:00Z", "2025-03-14T09:30:00+03:00") or a Unix timestamp. Dates are compared by UTC day: a timestamp with an offset counts on its UTC day, and one without an offset is read as UTC. The day you send matches neither side, so after 2025-03-01 starts on March 2.
A number above 100,000,000,000 is read as milliseconds, anything smaller as seconds. An attribute in any other format, such as "14/03/2025" or "2025-03-14 approx", never matches a date condition.
Scopes
Needscompanies:read.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Show child attributes
Show child attributes
Case-insensitive substring of the company name or external id.
Required string length:
1 - 200Show child attributes
Show child attributes
Page number, starting at 1. Default: 1.
Required range:
1 <= x <= 9007199254740991Max 200. Default: 50.
Required range:
1 <= x <= 200Was this page helpful?