Turvo Accounts API

Customers, shippers, and business partners.

OpenAPI Specification

turvo-accounts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Turvo Public Accounts API
  description: 'The Turvo Public API is a JSON REST interface to the Turvo collaborative transportation management system (TMS). It exposes the core logistics objects - shipments, orders, locations, accounts (customers), and carriers - plus real-time tracking via location updates and event-driven webhooks.

    ACCESS MODEL: The API is self-service but tenant-gated. Credentials (Client ID, Client Secret, API Key) are provisioned from the API profile inside a customer''s Turvo tenant, and the live interactive reference sits behind a Turvo login at app.turvo.com/lobby/documentation. A sandbox tenant is available for testing.

    MODELING NOTE: Because Turvo''s interactive reference is tenant-gated, the endpoint paths, parameters, and schemas in this document are HONESTLY MODELED from Turvo''s publicly described resource set and its documented OAuth 2.0 + x-api-key authentication pattern. They are a faithful structural model of the v1 API, not a verbatim copy of the live specification; confirm exact fields against your tenant''s own reference.'
  version: '1.0'
  contact:
    name: Turvo
    url: https://turvo.com
servers:
- url: https://publicapi.turvo.com/v1
  description: Turvo Public API (production)
- url: https://my-sandbox.turvo.com/v1
  description: Sandbox tenant (per-tenant host; replace with your sandbox subdomain)
security:
- bearerAuth: []
  apiKeyAuth: []
tags:
- name: Accounts
  description: Customers, shippers, and business partners.
paths:
  /accounts/list:
    get:
      operationId: listAccounts
      tags:
      - Accounts
      summary: List accounts
      description: Lists accounts (customers) in the tenant.
      parameters:
      - $ref: '#/components/parameters/Start'
      - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: A page of accounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountList'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /accounts:
    post:
      operationId: createAccount
      tags:
      - Accounts
      summary: Create an account
      description: Creates a new account (customer or business partner).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account'
      responses:
        '200':
          description: The created account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
  /accounts/{id}:
    parameters:
    - $ref: '#/components/parameters/Id'
    get:
      operationId: getAccount
      tags:
      - Accounts
      summary: Retrieve an account
      description: Retrieves a single account by its Turvo ID.
      responses:
        '200':
          description: The requested account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: updateAccount
      tags:
      - Accounts
      summary: Update an account
      description: Updates an existing account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account'
      responses:
        '200':
          description: The updated account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    PageSize:
      name: pageSize
      in: query
      required: false
      description: Maximum number of records to return per page.
      schema:
        type: integer
        default: 50
    Id:
      name: id
      in: path
      required: true
      description: The Turvo resource ID.
      schema:
        type: string
    Start:
      name: start
      in: query
      required: false
      description: Zero-based offset of the first record to return.
      schema:
        type: integer
        default: 0
  schemas:
    AccountList:
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/Account'
        pagination:
          $ref: '#/components/schemas/Pagination'
    Pagination:
      type: object
      properties:
        start:
          type: integer
        pageSize:
          type: integer
        totalRecordsInPage:
          type: integer
        moreAvailable:
          type: boolean
    Address:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string
        city:
          type: string
        state:
          type: string
        zip:
          type: string
        country:
          type: string
    Contact:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
        phone:
          type: string
    Error:
      type: object
      properties:
        Status:
          type: string
          example: error
        code:
          type: integer
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Account:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          description: Account type, such as customer, shipper, or partner.
        address:
          $ref: '#/components/schemas/Address'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
        billing:
          type: object
          additionalProperties: true
  responses:
    Unauthorized:
      description: Missing or invalid Bearer token or API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: The request payload failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'OAuth 2.0 Bearer access token obtained from POST /oauth/token. Passed as Authorization: Bearer YOUR_ACCESS_TOKEN.'
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Per-tenant API key from the Turvo tenant API profile, sent on every request.