latestOpenAPI 3.0.32026-08-137683171.1 KB

be08f4f706f5

Assets

Update a defect

Partial update of one or more mutable fields:

  • workDoneAt -- Unix ms to mark the defect as addressed, null to clear the mark (undo).
  • defectPriority -- 1..4. Sending this field always sets prioritySource='manual' so a subsequent bulk schema edit cannot overwrite the reviewer's decision. May be sent standalone; sending prioritySource: 'manual' alongside is allowed but redundant.
  • prioritySource: 'mapping' (alone, without defectPriority) -- revert path. Re-derives defectPriority from the org's active defect_priority_mappings entry for this row's (asset_type, defect_name) tuple. 409 with code='no_mapping_baseline' if no live row in the same tuple currently carries a mapping-derived priority (the schema must be updated or the CVAT export re-run before a revert can succeed).
  • reviewed -- bool. true stamps reviewedAt=now() and reviewedByActorId=<caller> (the customer-portal "Reviewed by" mark); false clears both. The reviewer identity is taken from the auth context, never the body. All writes trigger the stream_priority_defects database trigger, which cascades through voltair-streams-priority to recompute the owning asset and (if changed) site priority.
patch/defects/{defectId}

Headers

Idempotency-Keystring uuid

Idempotency key for POST requests. If a transaction with the same key already exists for the org, the server returns the original response without re-executing. Keys are valid for 48 hours.

Request body

workDoneAtnumber nullable

Unix ms timestamp. Null clears the field.

defectPriorityinteger

Manual priority override. Sets prioritySource='manual'.

prioritySource'manual' | 'mapping'

Sent alone with value 'mapping' to revert a manual override (re-derives priority from the active mapping). Sent with defectPriority and value 'manual' is allowed but redundant -- defectPriority alone implies manual.

reviewedboolean

Customer-portal "Reviewed by" mark. true stamps reviewedAt + reviewedByActorId from the auth context; false clears both.

Response

Success

transactionIdstring uuid required