---
title: "Bulk-update defect priority for a single (assetType, defectName) tuple"
method: POST
path: "/defects:bulk-priority"
tags: ["Assets"]
---

# Bulk-update defect priority for a single (assetType, defectName) tuple

`POST /defects:bulk-priority`

Remaps every existing defect row in the caller's organization
whose `(assetType, defectName)` matches the request to a new
priority. Optionally also rewrites the org's active
`defect_priority_mapping` so future CVAT exports use the new
value as the schema-derived default.

Reviewer manual overrides are NEVER touched -- the bulk UPDATE
filters by `priority_source='mapping'`.

At least one of `applyToExisting` or `alsoUpdateMapping` must be
true (otherwise the request is a no-op and is rejected).

Permission: `defects:write`.

## Headers

- `Idempotency-Key` string, uuid

## Request body

- object
  - `assetType` string, required — Slug of the asset_type column (e.g. 'wood_pole').
  - `defectName` string, required — Composed defect_name string (e.g. 'Pole (Wood): Crack/Split - major').
  - `priority` integer, required
  - `applyToExisting` boolean — When true, update every matching mapping-derived defect row in the org.
  - `alsoUpdateMapping` boolean — When true, also bump defect_priority_mappings to a new active version with this tuple's priority changed.

## Response `200`

Success

- object
  - `data` object, required
    - `defectsUpdated` integer, required
    - `assetsRecomputed` integer, required
    - `sitesRecomputed` integer, required
    - `mappingVersion` integer — Present only when alsoUpdateMapping=true.
    - `mappingId` string, uuid — Present only when alsoUpdateMapping=true.
  - `transactionId` string, uuid, required

## Other responses

- `400` — Bad request or validation error
- `401` — Authentication required
- `403` — Insufficient permissions
- `404` — Resource not found
- `409` — alsoUpdateMapping=true but the active mapping has no entry for (assetType, defectName).
- `429` — Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.net/voltairlabs/apis/voltair-api.md) · [All operations](https://skmtc.net/voltairlabs/apis/voltair-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voltairlabs/voltair-api/revisions/be08f4f706f5/schema)
