Retrieve a list of Companies
curl --request GET \
--url https://api.tread-horizon.com/v1/companies \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tread-horizon.com/v1/companies"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tread-horizon.com/v1/companies', 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.tread-horizon.com/v1/companies",
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.tread-horizon.com/v1/companies"
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.tread-horizon.com/v1/companies")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"dba_name": "<string>",
"tread_customer": true,
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"stytch_organization_id": "<string>",
"language": "en",
"time_format": "12-hour",
"date_format": "MM/DD/YYYY",
"unit_of_distance": "mile",
"system_of_measure": "imperial",
"currency": "USD",
"time_zone": "America/New_York",
"primary_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"billing_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"logo_url": "<string>",
"billing_status": "unpaid",
"saas_billing_plan": "basic",
"usage_status": "demo",
"fuel_surcharge_percentage": "<string>",
"auth_methods": [],
"auto_complete_order": true,
"ai_review_loads": true,
"site_radius": "<string>",
"default_geofence_delay_seconds": 123,
"parent_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"default_lat": "43.648947",
"default_lon": "-79.389193"
}
]
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}Companies
Retrieve a list of Companies
Retrieve Companies visible to the currently authenticated Company.
Datagrid search (search[datagrid]) queries against the following properties:
legal_namedba_nameparent_company:legal_nametypesaas_billing_planusage_status
GET
/
v1
/
companies
Retrieve a list of Companies
curl --request GET \
--url https://api.tread-horizon.com/v1/companies \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tread-horizon.com/v1/companies"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tread-horizon.com/v1/companies', 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.tread-horizon.com/v1/companies",
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.tread-horizon.com/v1/companies"
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.tread-horizon.com/v1/companies")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"dba_name": "<string>",
"tread_customer": true,
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"stytch_organization_id": "<string>",
"language": "en",
"time_format": "12-hour",
"date_format": "MM/DD/YYYY",
"unit_of_distance": "mile",
"system_of_measure": "imperial",
"currency": "USD",
"time_zone": "America/New_York",
"primary_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"billing_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"logo_url": "<string>",
"billing_status": "unpaid",
"saas_billing_plan": "basic",
"usage_status": "demo",
"fuel_surcharge_percentage": "<string>",
"auth_methods": [],
"auto_complete_order": true,
"ai_review_loads": true,
"site_radius": "<string>",
"default_geofence_delay_seconds": 123,
"parent_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"default_lat": "43.648947",
"default_lon": "-79.389193"
}
]
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The Accept-Language request HTTP header indicates the natural language and locale that the client prefers.
Example:
"en"
Query Parameters
The maximum number of paginated results to return
Required range:
x <= 100The cursor to start paginating after
The cursor to stop paginating at
Search string for datagrid queries
Response
OK
Show child attributes
Show child attributes
⌘I