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

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

# Update defect found in reports.

`PATCH` `/inspections/defects/{defect-id}`

Operation ID: `defects-id-patch`

Update a defect associated with reports. Additions (tail only) are supported for */attachments* Replacements are supported for */status*: - Only transitions PENDING ↔ FIXED is permitted - Attachment of type SIGNATURE must be included with each request modifying *status* - Updating a defect that has already been CERTIFIED is not permitted - otherwise 422 Unprocessable Content is returned.

## Path parameters

- `defect-id` (string, required) - Defect Identifier

## Header parameters

- `Idempotency-Key` (string, required) - Carries an idempotency key in order to make non-idempotent HTTP methods such as POST or PATCH fault-tolerant. Must include quotes.
- `If-Match` (string, required) - This header is use in combination with an "ETag" as a precondition for concurrency control.

## Request body

Content types: `application/json`

## Responses

- `204` - No Content
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `415` - Unsupported Media Type
- `422` - Unprocessable Content
- `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/{defect-id}:
    parameters:
      - name: defect-id
        in: path
        description: Defect Identifier
        required: true
        schema:
          $ref: "#/components/schemas/Identifier"
    patch:
      tags:
        - Fleet Inspections API
      summary: Update defect found in reports.
      description: >-
        Update a defect associated with reports.


        Additions (tail only) are supported for */attachments*


        Replacements are supported for */status*:
          - Only transitions PENDING ↔ FIXED is permitted
          - Attachment of type SIGNATURE must be included with each request modifying *status*
          - Updating a defect that has already been CERTIFIED is not permitted
          - otherwise 422 Unprocessable Content is returned.
      operationId: defects-id-patch
      parameters:
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/IfMatch"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/JsonPatchDocument"
            examples:
              Update defect from reports, signature attachment included:
                value:
                  - op: replace
                    value: FIXED
                    path: /status
                  - op: add
                    value:
                      attachmentId: kBvkwZXJUCpuatHoMvJw
                    path: /attachments/-
              Add an attachment to the defect:
                value:
                  - op: add
                    value:
                      attachmentId: dcReUfgsi9AsjVUHHltx
                    path: /attachments/-
      responses:
        "204":
          $ref: "#/components/responses/NoContent"
          description: No content. The request was applied.
        "400":
          $ref: "#/components/responses/BadRequest"
          description: Bad request. The request is not valid.
        "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.
        "415":
          $ref: "#/components/responses/UnsupportedMediaType"
          description: Unsupported media type. The content type of the request is not
            supported.
        "422":
          $ref: "#/components/responses/UnprocessableContent"
          description: Unprocessable entity. The request is well formed but cannot be
            applied.
        "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-vzc-internal-description: >-
        Update a defect associated with reports.


        Additions (tail only) are supported for */attachments*


        Replacements are supported for */status*:
          - Only transitions PENDING ↔ FIXED and FIXED → CERTIFIED are permitted
          - Attachment of type SIGNATURE must be included with each request modifying *status*
          - Updating a defect that has already been CERTIFIED is not permitted
          - otherwise 422 Unprocessable Content is returned.
      x-kong-route-defaults:
        strip_path: false
        paths:
          - ~/inspections/defects/[^/]+/?$
components:
  schemas:
    Identifier:
      maxLength: 120
      minLength: 1
      pattern: ^[A-Za-z0-9-]{1,120}$
      type: string
      description: Unique identifier for a given resource.
    JsonPatchDocument:
      title: A JSON Patch document as defined by RFC 6902
      maxItems: 10
      minItems: 0
      uniqueItems: true
      type: array
      description: Represents a list of operations to apply to a resource for partial
        updates
      items:
        title: A JSON Patch operation as defined by RFC 6902
        required:
          - op
          - path
        type: object
        properties:
          op:
            title: The operation to be performed
            maxLength: 120
            minLength: 1
            pattern: ^(add|remove|replace|move|copy|test)$
            type: string
            description: Indicates the operaton to be performed,as per RFC 6902
          from:
            title: A string containing a JSON Pointer value
            maxLength: 2000
            minLength: 0
            pattern: ^(\/[^\n]+)*$
            type: string
            description: A string containing a [RFC
              6901](https://www.rfc-editor.org/rfc/rfc6901.html) JSON Pointer
              value that references the source location where the operation is
              applied
          value:
            oneOf:
              - maxLength: 2000
                minLength: 1
                pattern: ^[^\n]+$
                type: string
                description: The value to be used within the operations
              - type: object
                additionalProperties: true
                description: The value to be used within the operations
          path:
            title: A JSON-Pointer
            maxLength: 2000
            minLength: 1
            pattern: ^\/[^\n]+$
            type: string
            description: A string containing a [RFC
              6901](https://www.rfc-editor.org/rfc/rfc6901.html) JSON Pointer
              value that references the target location where the operation is
              performed
        additionalProperties: false
        description: Defines an individual operation within a JsonPatchDocument
    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:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: Carries an idempotency key in order to make non-idempotent HTTP
        methods such as POST or PATCH fault-tolerant. Must include quotes.
      required: true
      schema:
        maxLength: 120
        minLength: 1
        pattern: ^"[a-z0-9-]+"$
        type: string
    IfMatch:
      name: If-Match
      in: header
      description: This header is use in combination with an "ETag" as a precondition
        for concurrency control.
      required: true
      schema:
        maxLength: 120
        minLength: 1
        pattern: ^"[a-z0-9-]+"$
        type: string
  responses:
    NoContent:
      description: No Content
    BadRequest:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    UnsupportedMediaType:
      description: Unsupported Media Type
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    UnprocessableContent:
      description: Unprocessable Content
      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"
```
