This API endpoint will allow you to edit existing trucks within Octopi.

Supported Formats

json

Errors

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

Examples

curl --location --request PATCH 'https://app.octopi.co/api/v1/trucks/:truck_license_number.json'     --header 'Authorization: Bearer token_value'     --header 'Content-Type: application/json'     --data-raw '{
  "truck": {
    "license_plate": "TEST123",
    "number": "6789",
    "weight": 12300,
    "active": false
  }
}'
{
  "truck": {
    "id": 27095,
    "active": false,
    "license_plate": "TEST123",
    "number": "6789",
    "weight": 5579,
    "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:12:08Z"
  }
}

Params

Param name Description
truck_license_number
required

Truck license plate. This is the resource you will update.

Validations:

  • Must be a String

truck
required

Truck data

Validations:

  • Must be a Hash

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.