---
title: "Get the active defect priority mapping for the caller's organization"
method: GET
path: "/defect-priority-mapping"
tags: ["Assets"]
---

# Get the active defect priority mapping for the caller's organization

`GET /defect-priority-mapping`

Returns the active row from `app.defect_priority_mappings` (a
per-org JSONB schema mapping `(Equipment, Type, Defect)` to
`(asset_type, priority)`). 404 when none exists; the org must be
seeded via the admin API before customer-facing edits are allowed.

Permission: `defects:read`.

## Response `200`

Success

- object
  - `data` DefectPriorityMapping, required — Per-org JSONB rule set mapping a CVAT `(Equipment, Type, Defect)` tuple to an `asset_type` and a `priority` integer (1..4). One active row per organization at a time; saving a new version deactivates the prior active row.
    - `id` string, uuid, required
    - `organizationId` string, uuid, required
    - `mapping` object, required — `{ "<Equipment>": { "<Type>": { "asset_type": "<slug>", "defects": { "<Defect>": <int 1-4> } } } }`. Use `"n/a"` as the `<Type>` key for CVAT labels with no real subtype.
    - `version` integer, required
    - `isActive` boolean, required

## Other responses

- `401` — Authentication required
- `403` — Insufficient permissions
- `404` — Resource not found
- `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)
