---
title: "Update Unit"
method: PATCH
path: "/v2/uom/{unitCode}"
tags: ["Routes", "Units of Measure"]
---

# Update Unit

`PATCH /v2/uom/{unitCode}`

The HTTP PATCH request is used to update a specific unit identified by its unit code. The request should be made to the endpoint `{{protocol}}://{{server}}:{{port}}/v2/uom/:unitCode`, where `:unitCode` is the unique identifier of the unit being updated.

### Request Body

The body is interpreted slightly differently, depending on whether the `unitCode` in the url is for a custom unit or a provided unit. If it is custom, then either property can be used to update the unit. If it is a provided unit, the `name` property will be ignored and only the `abbreviation` property will be used to override the defaut one. You can also use `null` to remove the override from the provided unit. If either property is `null` for a custom unit, that property will not be updated.

The request should include a JSON payload with the following parameters:

- `name` (string): The full name of the unit.
    
- `abbreviation` (string): A compact name of the unit.
    

### Response

The full object of the updated unit.

## Request body

- object
  - `name` string
  - `abbreviation` string

## Response `200`

Update Custom Unit

- object
  - `unitCode` string
  - `name` string
  - `abbreviation` string
  - `defaultAbbreviation` string
  - `category` string
  - `isCustom` boolean

## Other responses

- `400` — The request was malformed — either invalid JSON syntax or a validation failure (missing required field, wrong type, etc.).
- `401` — No `Authorization` header was provided on the request.
- `403` — The supplied credentials are invalid, the customer account is inactive, or the credentials do not have permission to perform this action.
- `404` — The referenced resource does not exist or is not visible to the authenticated customer.
- `409` — The request conflicts with the current state of the resource (e.g. a uniqueness constraint or a referenced parent that is in the wrong state).
- `429` — The per-minute or per-hour rate limit for this credential and method has been exhausted. Inspect the `X-RateLimit-*` headers to determine when to retry.
- `500` — An unhandled server-side error. The body message is generic (`System unavailable...`) when the underlying cause is a database fault; otherwise it reflects the raised error.

---

[API](https://skmtc.net/limblecmms/apis/limble-api-v2.md) · [All operations](https://skmtc.net/limblecmms/apis/limble-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/limblecmms/limble-api-v2/versions/20801e23f7f2/schema)
