---
title: "Get defects found in reports"
url: "https://developers.vzconnect.com/apis/fleet-inspections-api/versions/e4689b0c-c26d-40d6-b023-5303083c4a3f/operations/defects-get"
---

> Full API specification: https://developers.vzconnect.com/apis/fleet-inspections-api/versions/e4689b0c-c26d-40d6-b023-5303083c4a3f.md

# Get defects found in reports

`GET` `/inspections/defects`

Operation ID: `defects-get`

Returns all the defects found in an inspection report. Related reports are excluded from response

## Query parameters

- `inspectable_id` (string, optional) - Unique ID for an inspectable, i.e. asset/vehicle (asset ID/vehicle ID). Required if *inspectable_type* is specified.
- `inspectable_type` (string, optional) - Type of an inspectable asset. Required if *inspectable_id* is specified.
- `report_id` (string, optional) - Report identifier
- `status` (array, optional) - An array of defect statuses
- `severity` (array, optional) - An array of defect severities
- `page_token` (string, optional) - Identifies a bookmark for the next page of results.

## Responses

- `200` - Ok
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `429` - Too Many Requests
- `default` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Fleet Inspections API
  version: "1.0"
servers:
  - url: https://api.us.vzconnect.com
paths:
  /inspections/defects:
    get:
      tags:
        - Fleet Inspections API
      summary: Get defects found in reports
      description: Returns all the defects found in an inspection report. Related
        reports are excluded from response
      operationId: defects-get
      parameters:
        - name: inspectable_id
          in: query
          description: Unique ID for an inspectable, i.e. asset/vehicle (asset ID/vehicle
            ID). Required if *inspectable_type* is specified.
          required: false
          schema:
            $ref: "#/components/schemas/InspectableId"
        - name: inspectable_type
          in: query
          description: Type of an inspectable asset. Required if *inspectable_id* is
            specified.
          required: false
          schema:
            $ref: "#/components/schemas/InspectableType"
        - name: report_id
          in: query
          description: Report identifier
          required: false
          schema:
            $ref: "#/components/schemas/Identifier"
        - name: status
          in: query
          description: An array of defect statuses
          required: false
          schema:
            maxItems: 10
            minItems: 0
            uniqueItems: true
            type: array
            items:
              $ref: "#/components/schemas/DefectStatus"
        - name: severity
          in: query
          description: An array of defect severities
          required: false
          schema:
            maxItems: 10
            minItems: 0
            uniqueItems: true
            type: array
            items:
              $ref: "#/components/schemas/DefectSeverity"
        - $ref: "#/components/parameters/QueryPageToken"
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  links:
                    maxItems: 100
                    minItems: 0
                    uniqueItems: true
                    type: array
                    description: Related resources, pagination information
                    items:
                      $ref: "#/components/schemas/Link"
                  items:
                    maxItems: 100
                    minItems: 0
                    uniqueItems: true
                    type: array
                    description: A list of defects
                    items:
                      $ref: "#/components/schemas/Defect"
                additionalProperties: false
              examples:
                No defects found:
                  value:
                    links:
                      - method: GET
                        rel: self
                        href: /defects?page_token=hrJ6WwqTaeisB76XQo0t
                    items: []
                Defects for an inspectable:
                  value:
                    links:
                      - method: GET
                        rel: self
                        href: /defects?page_token=hrJ6WwqTaeisB76XQo0t
                      - method: GET
                        rel: prev
                        href: /defects?page_token=Tcjgj46EIlwaJneoAv8X
                      - method: GET
                        rel: next
                        href: /defects?page_token=WeYdy14vr0lVEYrBJurX
                    items:
                      - severity: CRITICAL
                        reportResults:
                          - reportResultId: CDPz6QZr3TefqwyU
                            templateItemId: eJgYcuWRCu7rTPh7
                            reportId: PnXqyyXeP4zLmTez
                            templateId: vTyUMQGJZw3na73U
                          - reportResultId: mX3RrcEYNpnPJr4S
                            templateItemId: pMTx6W17k85Umk2r
                            reportId: gfWdJRCyN6vj5Vk1
                            templateId: LUctByt3cDZsHKDA
                        status: PENDING
                        inspectable:
                          inspectableId: RsBHkJkZ86F1jUNT
                          inspectableType: VEHICLE
                        attachments:
                          - linkedAt: 2024-04-16T12:07:02.229Z
                            attachmentId: WNP7fQwB9B2tu4LB
                        defectId: cwXWQv36e1FJk17F
                        etag: XbbHLPtEcrtuZNfsNpXv1F8nzGc78B
                        comment: crack on the back of a mirror
                        links:
                          - method: GET
                            rel: self
                            href: /defects/cwXWQv36e1FJk17F
                        statusHistory:
                          - status: PENDING
                            signatureAttachmentId: WNP7fQwB9B2tu4LB
                      - severity: CRITICAL
                        attachments:
                          - linkedAt: 2024-04-16T12:07:02.229Z
                            attachmentId: vdzkcH3V4X35asyd
                          - linkedAt: 2024-04-16T12:07:02.229Z
                            attachmentId: 5CmN6Q7mMmpxrraA
                          - linkedAt: 2024-04-16T12:07:02.229Z
                            attachmentId: 6KPnXQhwE6QGwbb5
                        status: CERTIFIED
                        inspectable:
                          inspectableId: kmG4GETs1UJWYAy2
                          inspectableType: VEHICLE
                        links:
                          - method: GET
                            rel: self
                            href: /defects/rv2B4jVLxUj5KHpv
                        defectId: rv2B4jVLxUj5KHpv
                        etag: NzbTqsWxKLJ16McPDTuZqY2EKX3xBq
                        statusHistory:
                          - status: PENDING
                            signatureAttachmentId: vdzkcH3V4X35asyd
                          - status: FIXED
                            signatureAttachmentId: 5CmN6Q7mMmpxrraA
                          - status: CERTIFIED
                            signatureAttachmentId: 6KPnXQhwE6QGwbb5
                      - severity: MINOR
                        reportResults:
                          - reportResultId: EFPz6QZr3TefqwUv
                            templateItemId: lJgYcuWRCu7rTPh9
                            reportId: QmXqyyXeP4zLmULz
                            templateId: KTyUMQGJZw3na73B
                          - reportResultId: nX3RrcEYNpnPJr4R
                            templateItemId: qMTx6W17k85Umk2s
                            reportId: lfWdJRCyN6vj5Vk2
                            templateId: MUctByt3cDZsHKDB
                        status: PENDING
                        inspectable:
                          inspectableId: TsBHkJkZ86F1jKRN
                          inspectableType: VEHICLE
                        attachments:
                          - linkedAt: 2024-04-16T12:07:02.229Z
                            attachmentId: XNP7fQwB9B2tu4LC
                        defectId: DwXWQv36e1FJk18G
                        etag: UVbHLPtEcrtuZNfsNpXv1F8nzGc79C
                        comment: left wiper is not working
                        links:
                          - method: GET
                            rel: self
                            href: /defects/DwXWQv36e1FJk18G
                        statusHistory:
                          - status: PENDING
                            signatureAttachmentId: XNP7fQwB9B2tu4LC
        "401":
          $ref: "#/components/responses/Unauthorized"
          description: Unauthorized. The authorization token is missing or not valid.
        "403":
          $ref: "#/components/responses/Forbidden"
          description: Forbidden. The caller is not allowed to access this resource.
        "404":
          $ref: "#/components/responses/NotFound"
          description: Not found.
        "429":
          $ref: "#/components/responses/TooManyRequests"
          description: Too many requests. The rate limit has been exceeded.
        default:
          $ref: "#/components/responses/InternalServerError"
          description: An unexpected error occurred.
      deprecated: false
      x-kong-route-defaults:
        strip_path: false
        paths:
          - ~/inspections/defects/?$
components:
  schemas:
    InspectableId:
      maxLength: 120
      minLength: 1
      pattern: ^[A-Za-z0-9-]{1,120}$
      type: string
      description: Unique ID for an inspectable, i.e. asset/vehicle (asset ID/vehicle ID).
    InspectableType:
      type: string
      description: >
        Type of an inspectable asset.
          - VEHICLE when Vehicle is inspected
          - POWERED_ASSET when assets that have a power source is inspected
          - NON_POWERED_ASSET when assets that do not have a power source is inspected
      enum:
        - VEHICLE
        - POWERED_ASSET
        - NON_POWERED_ASSET
    Identifier:
      maxLength: 120
      minLength: 1
      pattern: ^[A-Za-z0-9-]{1,120}$
      type: string
      description: Unique identifier for a given resource.
    DefectStatus:
      type: string
      description: Type of the defect.
      enum:
        - PENDING
        - FIXED
        - CERTIFIED
    DefectSeverity:
      type: string
      description: Severity of the defect.
      enum:
        - MINOR
        - CRITICAL
    Link:
      title: Link
      required:
        - href
        - rel
      type: object
      properties:
        rel:
          maxLength: 10
          minLength: 4
          pattern: ^(appendix|next|prev|self)$
          type: string
          description: |
            Meaning of the values [described at IANA](https://www.iana.org/assignments/link-relations/link-relations.xhtml)
              - *appendix* - refers to documents serving as an appendix to the current resource
              - *next* - context is a part of a series, and that the next in the series is the link target
              - *prev* - context is a part of a series, and that the previous in the series is the link target
              - *self* - URI of a resource or current page of the collection
        method:
          type: string
          description: HTTP method to interact with linked resource
          enum:
            - GET
            - PUT
        title:
          maxLength: 120
          minLength: 1
          pattern: ^[^\n]+$
          type: string
          description: Relation type with the target resource as human-readable text
        href:
          maxLength: 2000
          minLength: 1
          pattern: ^[^\n]+$
          type: string
          description: URL of linked resource
          format: uri-reference
      additionalProperties: false
      description: Reference to another resource
    Defect:
      title: Defect
      required:
        - inspectable
        - status
      type: object
      properties:
        severity:
          $ref: "#/components/schemas/DefectSeverity"
        attachments:
          maxItems: 100
          minItems: 1
          uniqueItems: true
          type: array
          description: Attachments in the defect
          items:
            type: object
            properties:
              linkedAt:
                maxLength: 24
                minLength: 24
                type: string
                description: Link creation time as UTC in RFC 3339-ISO8601 internet profile
                format: date-time
                readOnly: true
              attachmentId:
                $ref: "#/components/schemas/Identifier"
            additionalProperties: false
            description: Attachment related to the defect
        status:
          $ref: "#/components/schemas/DefectStatus"
        inspectable:
          $ref: "#/components/schemas/Inspectable"
        reportResults:
          maxItems: 200
          minItems: 0
          uniqueItems: true
          type: array
          description: Report items related to the defect
          readOnly: true
          items:
            type: object
            properties:
              reportResultId:
                $ref: "#/components/schemas/Identifier"
              templateItemId:
                $ref: "#/components/schemas/Identifier"
              reportId:
                $ref: "#/components/schemas/Identifier"
              templateId:
                $ref: "#/components/schemas/Identifier"
            additionalProperties: false
            description: Report items related to the defect
        defectId:
          maxLength: 120
          minLength: 1
          pattern: ^[A-Za-z0-9-]{1,120}$
          type: string
          description: Unique identifier of a defect.
          readOnly: true
        etag:
          $ref: "#/components/schemas/ETag"
        comment:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: Notes about the defect
        links:
          maxItems: 100
          minItems: 0
          uniqueItems: true
          type: array
          description: Related resources
          readOnly: true
          items:
            $ref: "#/components/schemas/Link"
        statusHistory:
          maxItems: 100
          minItems: 1
          uniqueItems: true
          type: array
          description: Historical statuses of the defect
          readOnly: true
          items:
            type: object
            properties:
              status:
                $ref: "#/components/schemas/DefectStatus"
              signatureAttachmentId:
                $ref: "#/components/schemas/Identifier"
            additionalProperties: false
            description: Defect status change information
      additionalProperties: false
      description: Defect details of a vehicle or other asset
    Inspectable:
      type: object
      properties:
        inspectableType:
          $ref: "#/components/schemas/InspectableType"
        inspectableRegistrationNumber:
          maxLength: 120
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: Registration number of the asset
          readOnly: true
        inspectableName:
          maxLength: 120
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: Name of the asset
          readOnly: true
        inspectableId:
          $ref: "#/components/schemas/InspectableId"
        inspectableIdentificationNumber:
          maxLength: 120
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: Identification number of the asset
          readOnly: true
      additionalProperties: false
      description: Asset under inspection
    ETag:
      maxLength: 120
      minLength: 1
      pattern: ^[A-Za-z0-9-]+$
      type: string
      description: ETag as described in [RFC
        9110](https://www.rfc-editor.org/rfc/rfc9110#name-etag)
      readOnly: true
    ProblemJson:
      title: ProblemJson
      type: object
      properties:
        type:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A URI reference that identifies the problem type.
          format: uri
        detail:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A human-readable explanation specific to this occurrence of the
            problem.
        status:
          maximum: 599
          minimum: 300
          type: integer
          description: The HTTP status code generated by the origin server for this
            occurrence of the problem.
          format: int32
        errors:
          maxItems: 120
          minItems: 1
          uniqueItems: true
          type: array
          description: An extension that contains a list of individual error occurrences
            found, with details and a pointer to the location of each. Use this
            extension to convey more than one errors of the same type.
          items:
            type: object
            properties:
              debugId:
                maxLength: 120
                minLength: 0
                pattern: ^[^\n]*$
                type: string
                description: A unique error identifier string generated on the service-side and
                  logged for correlation purposes.
              pointer:
                maxLength: 120
                minLength: 0
                pattern: ^(\/[^\n]+)*$
                type: string
                description: A pointer to locate the problem within the request's content using
                  a [JSON Pointer](https://www.rfc-editor.org/info/rfc6901).
                  This extension is only applicable in case of 4xx range of
                  errors.
              detail:
                maxLength: 2000
                minLength: 0
                pattern: ^[^\n]*$
                type: string
                description: A human-readable explanation specific to this occurrence of the
                  problem.
            additionalProperties: false
        instance:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A URI reference that identifies the specific occurrence of the
            problem. It may or may not yield further information if
            dereferenced.
          format: uri
        debugId:
          maxLength: 120
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A unique error identifier string generated on the service-side and
            logged for correlation purposes.
        pointer:
          maxLength: 120
          minLength: 0
          pattern: ^(\/[^\n]+)*$
          type: string
          description: A pointer to locate the problem within the request's content using
            a [JSON Pointer](https://www.rfc-editor.org/info/rfc6901). This
            extension is only applicable in case of 4xx range of errors.
        title:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A short, human-readable summary of the problem type.
      additionalProperties: false
      description: JSON Schema for HTTP Problems as defined by RFC 9457
  parameters:
    QueryPageToken:
      name: page_token
      in: query
      description: Identifies a bookmark for the next page of results.
      required: false
      schema:
        maxLength: 200
        minLength: 1
        pattern: ^[.+\/=A-Za-z0-9]+$
        type: string
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    NotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    TooManyRequests:
      description: Too Many Requests
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    InternalServerError:
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
```
