tread.io Jobs API
The Jobs API from tread.io — 95 operation(s) for jobs.
The Jobs API from tread.io — 95 operation(s) for jobs.
openapi: 3.0.3
info:
title: Horizon API V1 AccountExternalTruckIdentifier Jobs 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: Jobs
paths:
/v1/companies/{company-id}/drivers/{driver-id}/device_status:
parameters:
- schema:
type: string
name: driver-id
in: path
required: true
description: Driver ID
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Get Device Status for a Driver
operationId: get-v1-companies-company-id-drivers-driver-id-device_status
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/DeviceStatus'
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'
description: Get GPS data and other data like device permissions for a Driver. Requires driver authorization.
x-stoplight:
id: driver-device-status
tags:
- Jobs
/v1/companies/{company-id}/jobs:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
get:
summary: Retrieves Jobs that belong to a Company
tags:
- Jobs
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
x-stoplight:
id: 99rr8qfza5hg1
items:
$ref: '#/components/schemas/Job-Read'
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'
'422':
$ref: '#/components/responses/ModelError'
operationId: get-v1-companies-company-id-jobs
x-stoplight:
id: uytvwbcs76g7p
description: "Retrieve `Jobs` for a `Company`.\n\nDatagrid search (`search[datagrid]`) queries against the following properties:\n * `order_id`\n * `job_id`\n * `company.legal_name`\n * `account.name`\n * `project.name`\n * `order.dispatch_number`\n * user as driver: `driver.first_name` || `driver.last_name`\n * contact as foreman_contact: `foreman_contact.name` || `foreman_contact.email` || `foreman_contact.phone`\n * contact as collaborator_contact: `collaborator_contact.name` || `collaborator_contact.email` || `collaborator_contact.phone`\n * contact as sales_contact: `sales_contact.name` || `sales_contact.email` || `sales_contact.phone`\n * contact as supervisor_contact: `supervisor_contact.name` || `supervisor_contact.email` || `supervisor_contact.phone`\n\nFilter usage:\n* to filter a single state: `filter[states][]=created`\n* to filter multiple states: `filter[states][]=created&filter[states][]=arrived_dropoff`"
parameters:
- $ref: '#/components/parameters/page-limit'
- $ref: '#/components/parameters/page-after'
- $ref: '#/components/parameters/page-before'
- $ref: '#/components/parameters/filter-start_date'
- $ref: '#/components/parameters/filter-end_date'
- $ref: '#/components/parameters/filter-states'
- $ref: '#/components/parameters/filter-project_ids'
- $ref: '#/components/parameters/filter-vendor_account_ids'
- $ref: '#/components/parameters/filter-customer_account_ids'
- $ref: '#/components/parameters/filter-driver_ids'
- $ref: '#/components/parameters/filter-material_ids'
- $ref: '#/components/parameters/filter-dropoff_site_ids'
- $ref: '#/components/parameters/filter-pickup_site_ids'
- $ref: '#/components/parameters/filter-service_ids'
- $ref: '#/components/parameters/filter-equipment_ids'
- $ref: '#/components/parameters/filter-external_ids'
- $ref: '#/components/parameters/filter-order-dispatch_number_ids'
- $ref: '#/components/parameters/ids'
- $ref: '#/components/parameters/search-datagrid'
- $ref: '#/components/parameters/filter-foreman_ids'
- $ref: '#/components/parameters/filter-collaborator_ids'
- $ref: '#/components/parameters/filter-salesperson_ids'
/v1/companies/{company-id}/jobs/bulk_accept:
parameters:
- $ref: '#/components/parameters/Accept-Language'
- name: company-id
in: path
required: true
description: Company ID
schema:
type: string
format: uuid
put:
summary: Bulk Accept Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_accept
x-stoplight:
id: khpgcfzmdocy1
x-internal: true
description: 'Accept multiple `Jobs` based on the given `job_ids` asynchronously as a Company.
To accept a `Job` successfully, the principal should either be the `Driver` of the `Job` or has an `edit_job` permission.'
requestBody:
content:
application/json:
schema:
type: object
required:
- job_ids
properties:
job_ids:
type: array
x-stoplight:
id: 7zhg7oskbkmmu
items:
x-stoplight:
id: ayy934gj43fle
type: string
format: uuid
/v1/companies/{company-id}/jobs/bulk_assign:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Bulk Assign Vendor to Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_assign
x-stoplight:
id: vpmfdbxgqlayh
description: 'Assigns multiple `Jobs` to the given `Vendor` asynchronously as a Company.
This endpoint requires the `edit_job` permission
Deprecated in favor of `PUT /v1/jobs/bulk_assign_vendors`'
x-internal: true
requestBody:
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/BulkAssignVendor-Create'
/v1/companies/{company-id}/jobs/bulk_assign_drivers:
parameters:
- name: company-id
in: path
required: true
description: Company ID
schema:
type: string
format: uuid
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Bulk Assign Drivers to Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_assign_drivers
x-stoplight:
id: mbc1m2mtbew2a
description: 'Assigns a list of multiple `Jobs` to the given `Driver` asynchronously as a Company.
This endpoint requires the `assign_job` permission'
requestBody:
content:
application/json:
schema:
type: object
required:
- driver_assignments
properties:
driver_assignments:
type: array
x-stoplight:
id: utlw8ngfqrlo4
items:
$ref: '#/components/schemas/DriverAssignment-Create'
/v1/companies/{company-id}/jobs/bulk_assign_vendors:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Bulk Assign Vendors to Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_assign_vendors
x-stoplight:
id: 8w6c9bsylf7w9
description: 'Assigns a list of multiple `Jobs` to the given `Vendor` asynchronously as a Company.
This endpoint requires the `assign_job` permission'
requestBody:
content:
application/json:
schema:
type: object
required:
- vendor_assignments
properties:
vendor_assignments:
type: array
x-stoplight:
id: sret4eh44421v
items:
$ref: '#/components/schemas/BulkAssignVendor-Create'
/v1/companies/{company-id}/jobs/bulk_cancel:
parameters:
- $ref: '#/components/parameters/Accept-Language'
- name: company-id
in: path
required: true
description: Company ID
schema:
type: string
format: uuid
put:
summary: Bulk cancel Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_cancel
x-stoplight:
id: k3j9p2x7m4qw5
description: 'Bulk cancel multiple `Jobs` by `id` asynchronously as a Company.
This endpoint requires the `cancel_job` permission.
'
parameters: []
requestBody:
content:
application/json:
schema:
type: object
required:
- job_ids
properties:
job_ids:
type: array
x-stoplight:
id: m5n8q4r9t2vx7
items:
x-stoplight:
id: w6y1z3a8c5d2f
type: string
format: uuid
/v1/companies/{company-id}/jobs/bulk_copy_assignments:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Bulk Copy Assignments as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_copy_assignments
x-stoplight:
id: zyd3q79ub4z61
description: 'Bulk Copy `JobAssignments` asynchronously as a Company.
This endpoint requires the `edit_job` permission'
x-internal: true
requestBody:
content:
application/json:
schema:
type: object
required:
- order_id
- job_ids
properties:
order_id:
type: string
x-stoplight:
id: u9heb7msnojw9
format: uuid
description: The `Order` ID where the `JobAssignments` will be copied to
job_ids:
type: array
x-stoplight:
id: fm5o3vou9n9nq
description: The `Job` IDs of the `JobAssignments` that are going to be copied
items:
x-stoplight:
id: 1boz6e20nc87j
type: string
format: uuid
deep_copy:
type: boolean
x-stoplight:
id: mogdpgsujy6gr
description: 'If `true`, it will copy all the `JobAssignment` chain.
If `false`, it will copy only the immediate `JobAssignment`'
/v1/companies/{company-id}/jobs/bulk_delete:
parameters:
- $ref: '#/components/parameters/Accept-Language'
- name: company-id
in: path
required: true
description: Company ID
schema:
type: string
format: uuid
put:
summary: Bulk delete Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_delete
x-stoplight:
id: 31m1khj5akvn4
description: 'Bulk delete multiple `Jobs` by `id` asynchronously as a Company.
This endpoint requires the `delete_job` permission.
'
parameters: []
requestBody:
content:
application/json:
schema:
type: object
required:
- job_ids
properties:
job_ids:
type: array
x-stoplight:
id: phd7tua5e5tyn
items:
x-stoplight:
id: cvqr0w0jdaud4
type: string
format: uuid
/v1/companies/{company-id}/jobs/bulk_send:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Bulk Send Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties:
data:
type: string
x-stoplight:
id: 3k60j8ijyqde1
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_send
x-stoplight:
id: ynzrs4lzx7iex
description: 'Send multiple `Driver`-assigned or `Vendor`-assigned `Jobs` based on the given `job_ids` and `order_ids` asynchronously as a Company.
This endpoint requires the `edit_job` permission'
x-internal: true
requestBody:
content:
application/json:
schema:
type: object
properties:
job_ids:
type: array
x-stoplight:
id: o8ct2voykrtf8
items:
x-stoplight:
id: 2tzsrlx3d7hky
type: string
format: uuid
description: This allows either `job_ids` or `order_ids` or both
/v1/companies/{company-id}/jobs/bulk_send_day:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Bulk Send Jobs for a Day
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: object
x-stoplight:
id: 3k60j8ijyqde1
required:
- count
properties:
count:
type: integer
x-stoplight:
id: 1g4pe7kpyeysk
description: Number of Jobs that will be enqeueud to send. This is _not_ guaranteed to be the number of Jobs that will be actually sent.
'400':
$ref: '#/components/responses/Error'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_send_day
x-stoplight:
id: ynzss4mzx8iex
description: 'Send multiple `Driver`-assigned or `Vendor`-assigned `Jobs` for the given `date` asynchronously as a Company.
This endpoint requires the `edit_job` permission.'
x-internal: true
requestBody:
content:
application/json:
schema:
type: object
properties:
date:
type: string
format: date
x-stoplight:
id: o8cu2uozkruf8
description: Date to send Jobs for.
required:
- date
/v1/companies/{company-id}/jobs/bulk_unassign:
parameters:
- $ref: '#/components/parameters/Accept-Language'
- name: company-id
in: path
required: true
description: Company ID
schema:
type: string
format: uuid
put:
summary: Bulk unassign Jobs as a Company
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: put-v1-companies-company-id-jobs-bulk_unassign
x-stoplight:
id: n7p4r2t9v5x8z
description: 'Bulk unassign multiple `Jobs` by `id` asynchronously as a Company.
This endpoint requires the `assign_job` permission.
'
parameters: []
requestBody:
content:
application/json:
schema:
type: object
required:
- job_ids
properties:
job_ids:
type: array
x-stoplight:
id: b3d6f8h1j4k7m
items:
x-stoplight:
id: q2s5u8w1y4a7c
type: string
format: uuid
/v1/companies/{company-id}/jobs/bulk_update:
parameters:
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
patch:
summary: Bulk Update Jobs
tags:
- Jobs
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties: {}
'401':
$ref: '#/components/responses/UnauthenticatedError'
'403':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
'415':
$ref: '#/components/responses/Error'
operationId: patch-v1-companies-company-id-jobs-bulk_update
x-stoplight:
id: fluexocqc75s7
description: 'Bulk update multiple `Jobs` with attributes defined in `data` asynchronously.
This endpoint requires the `edit_job` permission.
Bulk Updatable attributes: `notes`'
requestBody:
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/Job-Bulk-Update'
/v1/companies/{company-id}/jobs/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 Jobs by Company
tags:
- Jobs
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
items:
$ref: '#/components/schemas/Job-Read-Typeahead'
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
operationId: get-v1-companies-company-id-jobs-typeahead
x-stoplight:
id: jobbypahead01
description: Typeahead search against the `job_id` property for `Jobs` 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'
/v1/companies/{company-id}/jobs/{id}:
parameters:
- schema:
type: string
name: id
in: path
required: true
description: Job ID
- schema:
type: string
format: uuid
name: company-id
in: path
required: true
description: Company ID
- name: Accept-Language
in: header
schema:
type: string
default: en
example: en
description: 'The Accept-Language request HTTP header indicates the natural language and locale that the client prefers. '
get:
summary: Retrieve a single Job for a Company
operationId: get-v1-companies-company-id-jobs-id
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Job-Read'
required:
- data
'401':
$ref: '#/components/responses/UnauthenticatedError'
'404':
$ref: '#/components/responses/Error'
'406':
$ref: '#/components/responses/Error'
description: Retrieve `Job` by ID for a Company
tags:
- Jobs
patch:
summary: Update a Job for a Company
operationId: patch-v1-companies-company-id-jobs-id
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Job-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'
'409':
$ref: '#/components/responses/StateError'
'415':
$ref: '#/components/responses/Error'
'422':
$ref: '#/components/responses/ModelError'
description: 'Update a `Job` by ID for a Compan
This endpoint requires the `edit_job` permission.
If setting the `driver_id`, the `assign_job` permission is also required.'
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Job-Update'
description: ''
tags:
- Jobs
x-stoplight:
id: zn52e3d2od1wp
/v1/companies/{company-id}/jobs/{job-id}/accept:
parameters:
- schema:
type: string
name: job-id
in: path
required: true
description: Job ID
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Accept a Job as a Company
operationId: put-v1-companies-company-id-jobs-job-id-accept
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Job-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'
'409':
$ref: '#/components/responses/StateError'
'415':
$ref: '#/components/responses/Error'
description: 'Accept a `Job` by ID as a Company
This endpoint requires the `edit_job` permission or if the current user is the assigned driver'
requestBody:
content:
application/json:
schema:
type: object
properties: {}
x-stoplight:
id: mfeitwl64v85c
tags:
- Jobs
/v1/companies/{company-id}/jobs/{job-id}/approve:
parameters:
- schema:
type: string
name: job-id
in: path
required: true
description: Job ID
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Approve a Job as a Company
tags:
- Jobs
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Job-Invoicing-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-jobs-job-id-approve
description: 'Approve a `Job` by ID as a Company.
This endpoint requires the `approve_job` permission.
Principals with the `Company Admin` role can specify a specific `approval_type`.'
x-stoplight:
id: juv9a8b6fllaw
requestBody:
content:
application/json:
schema:
allOf:
- type: object
properties:
approved_work_time_minutes:
type: integer
x-stoplight:
id: pveh7hxuwirvd
minimum: 0
- $ref: '#/components/schemas/Approval-Approve'
/v1/companies/{company-id}/jobs/{job-id}/arrive:
parameters:
- schema:
type: string
name: job-id
in: path
required: true
description: Job ID
- schema:
type: string
name: company-id
in: path
required: true
description: Company ID
- $ref: '#/components/parameters/Accept-Language'
put:
summary: Arrive to site for a Job as a Company
operationId: put-v1-companies-company-id-jobs-job-id-arrive
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Job-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'
'409':
$ref: '#/components/response
# --- truncated at 32 KB (272 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/treadio/refs/heads/main/openapi/treadio-jobs-api-openapi.yml