Skip to main content
PATCH
/
fleet
/
defects
/
{id}
Update a defect
curl --request PATCH \
  --url https://api.samsara.com/fleet/defects/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "isResolved": true,
  "mechanicNotes": "Extremely large oddly shaped hole in passenger side window.",
  "resolvedAtTime": "2020-01-27T07:06:25Z"
}
'
{
  "data": {
    "id": "18",
    "isResolved": true,
    "comment": "Air Compressor not working",
    "createdAtTime": "2020-01-27T07:06:25Z",
    "defectType": "Air Compressor",
    "mechanicNotes": "Extremely large oddly shaped hole in passenger side window.",
    "mechanicNotesUpdatedAtTime": "2020-01-27T07:06:25Z",
    "resolvedAtTime": "2020-01-27T07:06:25Z",
    "resolvedBy": {
      "id": "11",
      "name": "Christopher 'The Handyman' Zhen",
      "type": "driver"
    },
    "trailer": {
      "id": "123456789",
      "name": "Midwest Trailer #5"
    },
    "vehicle": {
      "ExternalIds": {
        "maintenanceId": "250020",
        "payrollId": "ABFS18600"
      },
      "id": "123456789",
      "name": "Midwest Truck #4"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID of the defect.

Body

application/json

The DVIR defect fields to update.

Information about resolving a defect. If resolving a defect, must specify isResolved as true and resolvedBy.

isResolved
boolean

Resolves the defect. Must be true.

mechanicNotes
string

The mechanics notes on the defect.

Example:

"Extremely large oddly shaped hole in passenger side window."

resolvedAtTime
string

Time when defect was resolved. Defaults to now if not provided. UTC timestamp in RFC 3339 format. Example: 2020-01-27T07:06:25Z.

Example:

"2020-01-27T07:06:25Z"

resolvedBy
object

Information about the user who is resolving a defect.

Response

Return the modified defect entity

A single defect.

data
object