For AI agents: markdown of this page — /docs-content-en/entities/catalog-measures/update.md documentation index — /llms.txt
Update a unit of measure
PATCH /v1/catalog-measures/:id
Partially updates an existing unit of measure in the product catalog reference list. Send only the fields you change. The body is flat, with no fields wrapper.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionUnit of measure ID. List: GET /v1/catalog-measures |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldcode |
Typenumber | Requiredno | DescriptionUnit code from the Russian National Classifier of Units of Measurement (OKEI), an integer. Unique within the Bitrix24 account. null is not accepted |
FieldmeasureTitle |
Typestring | Requiredno | DescriptionUnit of measure name |
Fieldsymbol |
Typestring | null | Requiredno | DescriptionShort symbol. null clears the field |
FieldsymbolIntl |
Typestring | null | Requiredno | DescriptionInternational symbol. null clears the field |
FieldsymbolLetterIntl |
Typestring | null | Requiredno | DescriptionInternational letter symbol. null clears the field |
FieldisDefault |
Typestring | Requiredno | DescriptionDefault unit: Y or N. null is not accepted |
Fieldid |
Typenumber | Requiredno | DescriptionRO. The ID is set in the path only. In the body it is rejected with 400 READONLY_FIELD |
Clearing with null works only in a single request. For the batch write limitation, see Catalog units of measure.
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/catalog-measures/17" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"measureTitle": "Documentation test 2"
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/catalog-measures/17" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"measureTitle": "Documentation test 2"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-measures/17', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
measureTitle: 'Documentation test 2',
}),
})
const { success, data } = await res.json()
console.log('Measure title:', data.measureTitle)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-measures/17', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
measureTitle: 'Documentation test 2',
}),
})
const { success, data } = await res.json()
Response fields
The response returns the full record after the update, including the fields that did not change.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typenumber | DescriptionUnit of measure ID |
Fielddata.code |
Typenumber | DescriptionOKEI unit code |
Fielddata.measureTitle |
Typestring | null | DescriptionUnit of measure name |
Fielddata.symbol |
Typestring | null | DescriptionShort symbol |
Fielddata.symbolIntl |
Typestring | null | DescriptionInternational symbol |
Fielddata.symbolLetterIntl |
Typestring | null | DescriptionInternational letter symbol |
Fielddata.isDefault |
Typestring | DescriptionY — default unit, N — not default |
Fieldmeta.warnings |
Typearray | DescriptionPresent only if the body contains a field that is not among the unit of measure fields. Each element has code: "UNRECOGNIZED_WRITE_FIELD", field with the field name, and message. On a route that wraps the field map itself, an object under fields is rejected with 400 NESTED_FIELDS_ENVELOPE when the schema does not declare fields; pass fields flat at the JSON root. |
Response example
{
"success": true,
"data": {
"code": 9917,
"id": 17,
"isDefault": "N",
"measureTitle": "Documentation test 2",
"symbol": "dt",
"symbolIntl": "td",
"symbolLetterIntl": "TDC"
}
}
Error response example
404 — no unit of measure with this id:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "measure does not exist."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo unit of measure with this id exists on the portal |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe path id is not a non-negative integer. The message is id must be a non-negative integer |
| HTTP400 | CodeINVALID_PARAMS |
Descriptioncode is not an integer, for example 1.5 |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionnull is passed in code or isDefault |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionisDefault is neither Y nor N |
| HTTP400 | CodeEMPTY_UPDATE_BODY |
DescriptionThe request body is empty. Pass at least one field |
| HTTP400 | CodeNESTED_FIELDS_ENVELOPE |
DescriptionThe body contains an object under fields instead of root-level fields; the unit is not updated |
| HTTP400 | CodeREADONLY_FIELD |
Descriptionid is passed in the body |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe new code is already taken by another unit on the portal. The message is Duplicate entry for key [code], and the response also contains error.b24Code |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the catalog scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
For the full list of common API errors, see Errors.
Known specifics
An unknown scalar field does not stop the request. If the body contains only an unknown scalar field, the response comes back with status 200, the record does not change, and a warning in meta.warnings reports the skipped field. An object under fields is rejected with 400 NESTED_FIELDS_ENVELOPE before the update: pass fields at the JSON root. Check field names against GET /v1/catalog-measures/fields, and verify success by the values in data, not only by success.