This API endpoint will allow you to create new trucks within Octopi.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not Found.
500 Internal Server Error.

Examples

curl --location --request POST 'https://app.octopi.co/api/v1/trucks.json'     --header 'Authorization: Bearer token_value'     --header 'Content-Type: application/json'     --data-raw '{
    "truck": {
      "license_plate": "ABC123",
      "number": "12345",
      "weight": 10000,
      "color": "#00528D",
      "make": "A",
      "model": "M",
      "year": 1987,
      "active": true
    }
}'
{
  "truck": {
    "id": 27095,
    "active": true,
    "license_plate": "ABC123",
    "number": "12345",
    "weight": 4535,
    "color": "#00528D",
    "is_mule": false,
    "allowed_until": null,
    "year": 1987,
    "make": "A",
    "model": "M",
    "created_at": "2022-06-22T09:10:16Z",
    "updated_at": "2022-06-22T09:10:16Z"
  }
}

Params

Param name Description
truck
required

Truck data

Validations:

  • Must be a Hash

truck[license_plate]
required

Truck license plate

Validations:

  • Must be a String

truck[number]
optional

Truck number

Validations:

  • Must be a String

truck[truck_driver_license_number]
optional

Truck driver’s license number

Validations:

  • Must be a String

truck[trucking_company]
optional

Trucking company’s name

Validations:

  • Must be a String

truck[weight]
optional

Truck weight in your organization’s weight unit preference

Validations:

  • Must be a Integer

truck[active]
optional

Is the truck active?

Validations:

  • Must be one of: true, false.

truck[color]
optional

Truck color hex code

Validations:

  • Must be a String

truck[make]
optional

Truck make

Validations:

  • Must be a String

truck[model]
optional

Truck model

Validations:

  • Must be a String

truck[year]
optional

Truck year

Validations:

  • Must be a Integer

truck[allowed_until]
optional

Until when is this truck allowed at the terminal? Sample valid entries: ‘2022-06-02’, ‘2/6/2022’, ‘June 2, 2022’

Validations:

  • Must be a String

truck[is_mule]
optional

Is the truck a mule?

Validations:

  • Must be one of: true, false.