tread.io Services API

The Services API from tread.io — 4 operation(s) for services.

OpenAPI Specification

treadio-services-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Horizon API V1 AccountExternalTruckIdentifier Services 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: Services
paths:
  /v1/companies/{company-id}/services:
    parameters:
    - schema:
        type: string
      name: company-id
      in: path
      required: true
      description: Company ID
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Retrieve Services that belong to a Company
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Service-Read'
                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-services
      x-stoplight:
        id: l195h5cz2lkf2
      description: Retrieve `Services` for a `Company`
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      tags:
      - Services
  /v1/companies/{company-id}/services/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 Services for a Company
      tags:
      - Services
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Service-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-services-typeahead
      description: Typeahead search against the `name` property on `Services` 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: r0tj9b7du7t90
      x-internal: true
  /v1/services:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Retrieve Services that belong to the current Company
      tags:
      - Services
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Service-Read'
                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-services
      description: Retrieve `Services` visible to a `Company`
      x-stoplight:
        id: q28j4bggcccd9
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
  /v1/services/typeahead:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Typeahead search on Services
      tags:
      - Services
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Service-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-services-typeahead
      description: 'Typeahead search against the `name` property for `Services` 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: aa7i510yp8rbs
components:
  schemas:
    Service-Read:
      title: Service-Read
      x-stoplight:
        id: 93apij767hahq
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - type: object
        properties:
          name:
            type: string
            x-stoplight:
              id: 6m7pynwrc9gaz
          system:
            type: boolean
            x-stoplight:
              id: 0ctn5ygv4gt7n
          company:
            $ref: '#/components/schemas/Company-Read-Nested'
          service_type:
            $ref: '#/components/schemas/ServiceType-Read-Nested'
        required:
        - name
        - system
        - company
        - service_type
      - $ref: '#/components/schemas/Timestamps'
      - $ref: '#/components/schemas/Printable'
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    TreadId:
      title: TreadId
      x-stoplight:
        id: 43k4t5tl359m4
      type: object
      required:
      - tread_id
      properties:
        tread_id:
          type: string
          x-stoplight:
            id: zi3ld7djflw6f
          pattern: ^[0-9A-F]{6}$
          minLength: 6
          maxLength: 6
          example: ABC123
          description: Tread ID
      additionalProperties: false
    Printable:
      title: Printable
      x-stoplight:
        id: ha84mxua63ysd
      type: object
      properties:
        ordinality:
          type: integer
          x-stoplight:
            id: y2rm2equnu4fz
          minimum: 0
        visible:
          type: boolean
          x-stoplight:
            id: uekpedm5x21mk
      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
    Timestamps:
      title: Timestamps
      x-stoplight:
        id: t82ecgfu0oj00
      type: object
      required:
      - created_at
      - updated_at
      properties:
        created_at:
          type: string
          x-stoplight:
            id: gjj950jpq0ga9
          format: date-time
          description: ISO8601 timestamp with local timezone
        updated_at:
          type: string
          x-stoplight:
            id: bwcuyfwc7aj0e
          format: date-time
          description: ISO8601 timestamp with local timezone
      additionalProperties: false
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
      - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    Company-Read-Nested:
      title: Company-Read-Nested
      x-stoplight:
        id: cb2kn77qmf1l7
      description: Compact Company model for nested reads.
      allOf:
      - $ref: '#/components/schemas/Identifier'
        x-stoplight:
          id: jwsufva4znm91
      - $ref: '#/components/schemas/TreadId'
      - type: object
        properties:
          legal_name:
            type: string
            x-stoplight:
              id: yc10t8hieecwk
            description: The Company's name. Must be globally unique.
          company_type:
            $ref: '#/components/schemas/CompanyType'
        required:
        - legal_name
        - company_type
    Service-Read-Typeahead:
      title: Service-Read-Typeahead
      x-stoplight:
        id: hzokhwqcwvue5
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - type: object
        properties:
          name:
            type: string
            description: Service name
        required:
        - name
    CompanyType:
      title: CompanyType
      x-stoplight:
        id: dkzo7gjbtb1b3
      enum:
      - broker
      - contractor
      - hauler
      - owner_operator
      - producer
      - super
      example: hauler
      description: Company Type
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    ServiceType-Read-Nested:
      title: ServiceType-Read-Nested
      x-stoplight:
        id: 84wz44x2i04yv
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - type: object
        properties:
          name:
            type: string
            x-stoplight:
              id: 4s0oiqiohsnz5
          key:
            type: string
            x-stoplight:
              id: r8apolqsdguj0
  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. '
    search-query:
      name: search[query]
      in: query
      required: false
      schema:
        type: string
      description: Search string for queries
    page-limit:
      name: page[limit]
      in: query
      schema:
        type: integer
        format: int32
        default: 25
        maximum: 100
      description: The maximum number of paginated results to return
    page-before:
      name: page[before]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to stop paginating at
    page-after:
      name: page[after]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to start paginating after
  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'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
x-stoplight:
  id: 75rfxjepk4523