Upload an annual inspection

POST/app/v1/documents/smart-upload/

Upload a federal (FHWA) annual inspection report, also called smart upload. DPB reads the report with AI, files it on the right vehicle or trailer, and sets the expiry date from the inspection date printed on it. This endpoint only handles annual inspections. For other documents, use Create a document.

Send only the file and DPB finds the unit and the inspection date in the report, and sets the expiry to one year after that date. Send unit_no to choose the unit yourself; the report is still read for the inspection date. Send expiry_frame to use a different expiry window.

The document's own date is always the upload day. If the report can't be read, the file is still saved and the response says so, so you can finish it in the dashboard.

Authorization

X-API-KEYstring · headerrequired

Your company's API key.

Request body

multipart/form-data · required

filefilerequired

The inspection report: PDF, PNG, JPG, JPEG, TIFF or TIF.

descriptionstring

Document description. Defaults to Annual Inspection.

unit_nostring

Unit number to file the report on. When sent, the unit isn't read from the report. Must match the unit number in DPB exactly, including upper and lower case. If no active unit has that number, the request is rejected and nothing is saved.

unit_typeenum

Use with unit_no when a vehicle and a trailer share the same unit number.

One of: Vehicle Trailer

expiry_frameenum

Expiry window counted from the inspection date printed on the report. Defaults to 1 yr.

One of: 3 mo 6 mo 1 yr 2 yr 3 yr 4 yr 5 yr

Response

201The record
successboolean
document_idinteger

The new document's id.

equipment_unit_nostring

Unit number of the vehicle or trailer the report was filed on.

equipment_typeenum

One of: Vehicle Trailer

vin_numberstring

VIN of the unit.

unit_nostring
extracted_datestring (date)

Inspection date read from the report.

expiry_datestring (date)

Inspection date plus the expiry window.

messagestring

A short summary of what happened.

detailsstring

How the unit was matched and the expiry was set.

errorstring

Only when the report was saved but couldn't be read, for example Analysis timeout.

Other responses

201Saved, but the report couldn't be read. Open the document in the dashboard to set the unit and dates.
{
  "success": true,
  "document_id": 12345,
  "message": "Annual Inspection document saved but data extraction failed",
  "error": "Analysis timeout"
}
400The file type isn't supported.
{
  "file": [
    "Unsupported file format. Supported formats: .png, .jpg, .jpeg, .pdf, .tiff, .tif"
  ]
}
400No active unit has that unit_no. Nothing was saved.
{
  "error": "No active Trailer found with unit no 'T1001'."
}
400A field has a value that isn't allowed.
{
  "expiry_frame": [
    "\"180 days\" is not a valid choice."
  ]
}
500Something went wrong on our side. Try again, or contact support if it keeps happening.
{
  "error": "Failed to process Annual Inspection document"
}