tread.io Companies API
The Companies API from tread.io — 14 operation(s) for companies.
The Companies API from tread.io — 14 operation(s) for companies.
openapi: 3.0.3
info:
title: Horizon API V1 AccountExternalTruckIdentifier Companies API
version: '1.0'
contact:
name: Tread
url: https://tread.io
email: developers@tread.io
description: 'This is the Version 1 implementation.
When in doubt we default to the practices outlined [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)'
license:
name: Private
url: https://tread.io
servers:
- description: production
url: https://api.tread-horizon.com
security:
- bearerAuth: []
tags:
- name: Companies
paths:
/v1/companies:
parameters:
- $ref: '#/components/parameters/Accept-Language'
post:
summary: Create a Company
operationId: post-v1-companies
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Company-Read'
x-stoplight:
id: 7pg328jm7m9et
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
description: 'Create a new `Company`
This endpoint requires the `create_company` permission'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Company-Create'
tags:
- Companies
get:
summary: Retrieve a list of Companies
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
x-stoplight:
id: 1ukjgv4iiql1q
type: array
items:
$ref: '#/components/schemas/Company-Read'
x-stoplight:
id: znts3ikkdf7sj
required:
- data
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
'401':
$ref: '#/components/responses/UnauthenticatedError'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies
description: "Retrieve `Companies` visible to the currently authenticated `Company`.\n\nDatagrid search (`search[datagrid]`) queries against the following properties:\n * `legal_name`\n * `dba_name`\n * `parent_company:legal_name`\n * `type`\n * `saas_billing_plan`\n * `usage_status`"
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/search-datagrid'
/v1/companies/tread_id/{tread-id}:
parameters:
- schema:
type: string
pattern: ^[0-9A-F]{6}$
minLength: 6
maxLength: 6
example: ABC123
name: tread-id
in: path
required: true
description: Tread ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieve a Company by Tread ID
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Company-Read-Typeahead'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-tread_id-tread-id
x-stoplight:
id: u2m9q5u0bdimj
x-internal: true
description: "Retrieve a `Company` by a `Tread ID`. \n\nThis endpoint requires the `connect_companies` `IamPermission`."
/v1/companies/typeahead:
parameters:
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Typeahead search on Companies
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Company-Read-Typeahead'
required:
- data
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
'401':
$ref: '#/components/responses/UnauthenticatedError'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-typeahead
description: 'Typeahead search against the `legal_name` property for `Companies` visible to the currently authenticated `Company`.
'
x-internal: true
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/search-query'
x-stoplight:
id: qkqja5m9f9ixa
/v1/companies/{company-id}/children:
parameters:
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Return child Companies that belong to a Company
tags:
- Companies
responses:
'200':
description: OK
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
content:
application/json:
schema:
type: object
properties:
data:
x-stoplight:
id: qh7o3ai9runxr
type: array
items:
$ref: '#/components/schemas/Company-Read-Nested'
required:
- data
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-id-children
x-stoplight:
id: l2m3v9uf24jvn
description: "Return child `Companies` for a `Company`\n\nDatagrid search (`search[datagrid]`) queries against the following properties:\n * `legal_name`\n * `dba_name`\n * `parent_company:legal_name`\n * `type`\n * `saas_billing_plan`\n * `usage_status`"
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/search-datagrid'
/v1/companies/{company-id}/children/typeahead:
parameters:
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Typeahead search on Children for a Company
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Company-Read-Typeahead'
required:
- data
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-accounts-typeahead
description: Typeahead search against the `legal_name` property on `Children` for a `Company`.
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/search-query'
x-stoplight:
id: 0cc8k3gzl6bwu
x-internal: true
/v1/companies/{company-id}/connected_companies:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieve connected Companies For a Company
tags:
- Companies
responses:
'200':
description: OK
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
x-stoplight:
id: l9ja95bu9woa9
items:
$ref: '#/components/schemas/Company-Read'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-connected_companies
x-stoplight:
id: azyll9l637399
description: Retrieve connected `Companies` For a `Company`
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
/v1/companies/{company-id}/connected_companies/typeahead:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Typeahead search on connected Companies for a Company
tags:
- Companies
responses:
'200':
description: OK
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
x-stoplight:
id: q7owtmifrbwjm
items:
$ref: '#/components/schemas/Company-Read-Typeahead'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-connected_companies-typeahead
x-stoplight:
id: lbdv3e80844da
description: 'Typeahead search against the `legal_name` property on connected `Companies` for a given `Company`.
'
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/search-query'
/v1/companies/{company-id}/logo:
parameters:
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
post:
summary: Update the logo for a Company
operationId: post-v1-companies-:company_id-logo
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Company-Read'
required:
- data
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
description: "Add or replace the `logo` for a `Company`. \n\nThis endpoint requires the `edit_company` `IamPermission`\n\n* If you're using a `DirectUpload` then you must use the `application/json` mime-type and `logo` must be the `DirectUpload`'s `signed_id`\n* If you're using a file then you must use the `multipart/form-data` mime-type and `logo` must be a file.\n\nIn both cases the following restrictions apply:\n * `logo` cannot be larger than 100kb.\n * `logo` must be one of the following image types: `png`, `jpeg`, `gif`."
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/Company-Logo-Create'
application/json:
schema:
$ref: '#/components/schemas/Company-Logo-Create'
description: ''
tags:
- Companies
x-internal: true
get:
summary: Retrieve the logo for a Company
operationId: get-v1-companies-company_id-logo
x-stoplight:
id: 0btd243xc72zx
x-internal: true
description: Retrieve the logo for a `Company`.
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Company-Logo-Read'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
tags:
- Companies
/v1/companies/{company-id}/managed_companies:
parameters:
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieve managed Companies for a Company
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
x-stoplight:
id: cha06aro11s33
items:
$ref: '#/components/schemas/Company-Read'
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company_id-managed_companies
x-stoplight:
id: k4p7tg98a8tsp
x-internal: true
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/page-after'
description: 'Retrieve managed `Companies` for another `Company`.
This endpoint requires the `platform_admin` `IamRole`.'
/v1/companies/{company-id}/managed_companies/{id}:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- schema:
type: string
format: uuid
name: id
in: path
required: true
description: Managed Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieve a single managed Company
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Company-Read'
x-stoplight:
id: mc5n3d10ntvthm
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-managed_companies-id
x-stoplight:
id: mc6yvgca2h7jk
x-internal: true
description: Retrieve a managed `Company` by ID.
put:
summary: Create a managed Company
tags:
- Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Company-Read'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
operationId: put-v1-companies-company_id-managed_companies-id
x-stoplight:
id: uk5tyvgca2h7j
x-internal: true
description: 'Create a managed `Company` for another `Company`.
This endpoint requires the `platform_admin` `IamRole`.'
requestBody:
content:
application/json: {}
delete:
summary: Delete a managed Company
tags:
- Companies
responses:
'204':
description: No Content
content: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: delete-v1-companies-company-id-managed_companies-id
x-stoplight:
id: w30g0xogp0ptg
description: 'Delete a managed `Company` from another `Company`.
This endpoint requires the `platform_admin` `IamRole`.'
x-internal: true
/v1/companies/{company-id}/managed_companies/{managed-company-id}/connected_companies:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Managing Company ID
- schema:
type: string
format: uuid
name: managed-company-id
in: path
required: true
description: Managed Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieve connected Companies for a Managed Company
tags:
- Companies
responses:
'200':
description: OK
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
x-stoplight:
id: mc1ja95bu9woa
items:
$ref: '#/components/schemas/Company-Read'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-managed_companies-managed-company-id-connected_companies
x-stoplight:
id: mc2yll9l637399
description: Retrieve connected `Companies` for a Managed `Company`
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
/v1/companies/{company-id}/managed_companies/{managed-company-id}/connected_companies/typeahead:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Managing Company ID
- schema:
type: string
format: uuid
name: managed-company-id
in: path
required: true
description: Managed Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Typeahead search connected Companies for a Managed Company
tags:
- Companies
responses:
'200':
description: OK
headers:
Link:
schema:
type: string
description: Contains prev and next links for pagination
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
x-stoplight:
id: mc3wtmifrbwjm
items:
$ref: '#/components/schemas/Company-Read-Typeahead'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-managed_companies-managed-company-id-connected_companies-typeahead
x-stoplight:
id: mc4dv3e80844da
description: Typeahead search against the `legal_name` property on connected `Companies` for a Managed `Company`.
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/search-query'
/v1/companies/{id}:
parameters:
- schema:
type: string
name: id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieve a single Company
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Company-Read'
x-stoplight:
id: ojn3d10ntvthm
required:
- data
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-id
description: Retrieve a `Company` by ID
tags:
- Companies
x-internal: true
patch:
summary: Update a Company
operationId: patch-v1-companies-id
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Company-Read'
required:
- data
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
description: 'Update a `Company` by ID
This endpoint requires the `edit_company` permission'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Company-Update'
description: Note that all parameters are optional - a caller need only provide the `Company` fields that they wish to change.
tags:
- Companies
delete:
summary: Delete a Company
operationId: delete-v1-companies-id
responses:
'204':
description: No Content
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
x-internal: true
description: 'Delete a `Company` by ID
This endpoint requires the `delete_company` permission'
tags:
- Companies
/v1/direct_uploads:
parameters:
- $ref: '#/components/parameters/Accept-Language'
post:
summary: Create a DirectUpload
tags:
- Companies
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/DirectUpload-Read'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
operationId: post-v1-direct_uploads
x-stoplight:
id: tgme583womicv
description: 'Create a `DirectUpload`.
The `checksum` _must_ be calculated exactly the way `rails` expects it ([javascript example](https://github.com/rails/rails/blob/main/activestorage/app/javascript/activestorage/file_checksum.js)).
You should upload the file to `direct_upload.url` using any provided headers from `direct_upload.headers`.
Once this is done you can use `signed_id` in place of a file in any endpoint that accepts file uploads.'
x-internal: true
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DirectUpload-Create'
components:
responses:
ModelError:
description: ''
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/ModelError-Response'
Error:
description: Error response
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/Error-Response'
UnauthenticatedError:
description: Example response
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/UnauthenticatedError-Response'
schemas:
SystemOfMeasure:
title: SystemOfMeasure
x-stoplight:
id: hu40i1qp6a4ed
enum:
- imperial
- metric
example: imperial
default: imperial
description: Unit system to use when displaying non-distance measurements
DirectUpload-Read:
title: DirectUpload-Read
x-stoplight:
id: ge5fs3tk8yb8k
type: object
required:
- id
- byte_size
- checksum
- content_type
- created_at
- filename
- key
- service_name
- signed_id
- direct_upload
properties:
id:
type: string
x-stoplight:
id: lzwkhbbuc30lt
format: uuid
byte_size:
type: integer
x-stoplight:
id: zdq5i2km7dbdd
checksum:
type: string
x-stoplight:
id: pfgyb7ctywy3o
content_type:
type: string
x-stoplight:
id: id6fbesbolbxu
created_at:
type: string
x-stoplight:
id: qkkile7jxkghk
format: date-time
filename:
type: string
x-stoplight:
id: nh2lxjat0biia
key:
type: string
x-stoplight:
id: saakohyy5kvvz
metadata:
type: object
x-stoplight:
id: zlk0ufjqtjaxq
service_name:
type: string
x-stoplight:
id: br0ew9wo8145q
signed_id:
type: string
x-stoplight:
id: zvuflukjwdj16
direct_upload:
type: object
x-stoplight:
id: e4cw0bh9x1t4n
required:
- url
properties:
url:
type: string
x-stoplight:
id: l0qwu7ya2mng0
format: uri
headers:
type: object
x-stoplight:
id: jgxk00g0qfrub
additionalProperties: false
Error-Response:
title: Error-Response
x-stoplight:
id: 52cydhphee3qe
type: object
required:
- error
properties:
error:
$ref: '#/components/schemas/Error'
additionalProperties: false
SaasBillingPlan:
title: SaasBillingPlan
x-stoplight:
id: e7hyhw2zszf6l
enum:
- basic
- standard
- pro
example: basic
default: basic
x-internal: true
DateFormat:
title: DateFormat
x-stoplight:
id: i3g08ad8vmf6g
enum:
- MM/DD/YYYY
- DD/MM/YYYY
- YYYY/MM/DD
example: MM/DD/YYYY
default: MM/DD/YYYY
Company-Logo-Create:
title: Company-Logo-Create
x-stoplight:
id: 0ftrms8gtiarc
type: object
description: Company model for logo creation
required:
- logo
properties:
logo:
x-stoplight:
id: 4fqw52unkx3b1
anyOf:
- x-stoplight:
id: 34t5ri5242fzy
format: binary
- x-stoplight:
id: mmnbbtiuaqj1u
type: string
additionalProperties: false
TimeFormat:
title: TimeFormat
x-stoplight:
id: 2fy67ypn6nohz
enum:
- 12-hour
- 24-hour
example: 12-hour
default: 12-hour
Address-Create:
title: Address-Create
x-stoplight:
id: 9wmd46rzgjxh7
type: object
required:
- thoroughfare
- locality
- administrative_area
- postal_code
- country
properties:
thoroughfare:
type: string
x-stoplight:
id: zkh46rwwvpuca
description: Street address
example: 123 Fake St.
premise:
type: string
x-stoplight:
id: bkcia8yh59wzf
description: Apartment, Suite, Box number, etc.
example: 3rd Floor
# --- truncated at 32 KB (71 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/treadio/refs/heads/main/openapi/treadio-companies-api-openapi.yml