tread.io LoadCycles API

The LoadCycles API from tread.io — 1 operation(s) for loadcycles.

OpenAPI Specification

treadio-loadcycles-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Horizon API V1 AccountExternalTruckIdentifier LoadCycles 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: LoadCycles
paths:
  /v1/jobs/{job-id}/loads/cycles:
    parameters:
    - schema:
        type: string
      name: job-id
      in: path
      required: true
      description: Job ID
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Retrieve all LoadCycles for a Job
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: object
                    x-stoplight:
                      id: bw4koenxmkftf
                    required:
                    - load_cycles
                    - load_cycle_time_minutes_avg
                    properties:
                      load_cycles:
                        type: array
                        x-stoplight:
                          id: 7irrsjqt3890c
                        items:
                          $ref: '#/components/schemas/LoadCycle-Read'
                      load_cycle_time_minutes_avg:
                        type: integer
                        x-stoplight:
                          id: 1ysbs4rh0fv42
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-jobs-job-id-loads-cycles
      x-stoplight:
        id: 9om38mymyv5al
      description: "Retrieve all `LoadCycles` for a `Job`. \n\nA `LoadCycle` is an edge between two consecutive `Loads` that have reached the `arrived_pickup` state on a given `Job`.\n\nThe response includes all calculated `LoadCycles` as well as the average time (in minutes)."
      tags:
      - LoadCycles
components:
  responses:
    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:
    LoadCycle-Read:
      title: LoadCycle-Read
      x-stoplight:
        id: f7ms55f4p3g6y
      type: object
      required:
      - from_load_id
      - to_load_id
      - time_minutes
      properties:
        from_load_id:
          type: string
          x-stoplight:
            id: q5hc43zfc3phu
          format: uuid
          description: ID of the `Load` which starts our `LoadCycle`
        to_load_id:
          type: string
          x-stoplight:
            id: y4t3x6s8xfedc
          format: uuid
          description: ID of the `Load` which ends our `LoadCycle`
        time_minutes:
          type: integer
          x-stoplight:
            id: lkmeu10eenb45
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
      - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
      - $ref: '#/components/schemas/Error'
      - type: object
        x-stoplight:
          id: tg10dt7s0l6bw
        properties:
          error_type:
            type: string
            x-stoplight:
              id: wvq8c0qsym4hz
        required:
        - error_type
  parameters:
    Accept-Language:
      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. '
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
x-stoplight:
  id: 75rfxjepk4523