Update the logo for a Company
curl --request POST \
--url https://api.tread-horizon.com/v1/companies/{company-id}/logo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'logo=<string>' \
--form logo.0='@example-file'import requests
url = "https://api.tread-horizon.com/v1/companies/{company-id}/logo"
files = { "logo.0": ("example-file", open("example-file", "rb")) }
payload = { "logo": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('logo', '<string>');
form.append('logo.0', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.tread-horizon.com/v1/companies/{company-id}/logo', 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/{company-id}/logo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.tread-horizon.com/v1/companies/{company-id}/logo"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.tread-horizon.com/v1/companies/{company-id}/logo")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies/{company-id}/logo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
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": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}Companies
Update the logo for a Company
Add or replace the logo for a Company.
This endpoint requires the edit_company IamPermission
- If you’re using a
DirectUploadthen you must use theapplication/jsonmime-type andlogomust be theDirectUpload’ssigned_id - If you’re using a file then you must use the
multipart/form-datamime-type andlogomust be a file.
In both cases the following restrictions apply:
logocannot be larger than 100kb.logomust be one of the following image types:png,jpeg,gif.
POST
/
v1
/
companies
/
{company-id}
/
logo
Update the logo for a Company
curl --request POST \
--url https://api.tread-horizon.com/v1/companies/{company-id}/logo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'logo=<string>' \
--form logo.0='@example-file'import requests
url = "https://api.tread-horizon.com/v1/companies/{company-id}/logo"
files = { "logo.0": ("example-file", open("example-file", "rb")) }
payload = { "logo": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('logo', '<string>');
form.append('logo.0', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.tread-horizon.com/v1/companies/{company-id}/logo', 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/{company-id}/logo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.tread-horizon.com/v1/companies/{company-id}/logo"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.tread-horizon.com/v1/companies/{company-id}/logo")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies/{company-id}/logo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"logo.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
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": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<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"
Path Parameters
Company ID
Body
multipart/form-dataapplication/json
Company model for logo creation
Response
Created
Company model for reads.
Show child attributes
Show child attributes
⌘I