---
title: "Update attribute"
method: PATCH
path: "/attributes/{companyId}/{customId}"
tags: ["Attributes"]
---

# Update attribute

`PATCH /attributes/{companyId}/{customId}`

Updates an attribute identified by `customId`. Only the fields sent in the request are changed; fields left out keep their current value. If `values` is sent, it **replaces** the attribute's full value list — any previously stored value not included is removed (omit `values` entirely to leave the current values untouched). Updating a `customId` that does not match any attribute returns `200` without applying any change — no `404` is raised.

## Path parameters

- `customId` string, required
- `companyId` string, required

## Request body

- PatchAttributesRequestSchema
  - `name` string, nullable — Display name of the attribute.
  - `active` boolean — Whether the attribute is active. Omit to leave the current value unchanged.
  - `values` AttributesRequestValuesSchema[], nullable — Full list of values the attribute should have after this update. Sending `values` **replaces** the current list: any previously stored value whose `customId` is not included here is removed. Omit `values` entirely to leave the current values untouched. An attribute holds at most 5000 values; if the combined total would exceed the limit, the excess new values are silently discarded and existing ones already in the list are kept.
    - `customId` string, required — Your own unique ID for the value, unique within the attribute.
    - `name` string, required — Display name of the value.
    - `parentCustomId` string, nullable — Custom ID of the value of the parent attribute (see the attribute's `parentCustomId`) that this value is nested under. Ignored if the attribute has no `parentCustomId` or no value with this `customId` exists yet on the parent attribute.
  - `parentCustomId` string, nullable — Custom ID of the parent attribute, to nest this attribute under another one (e.g. a "City" attribute nested under "Country"). Must reference an existing attribute.

## Response `200`

Successful Response

- UpsertAttributesResponseSchema
  - `id` string, required — Embat resource ID
  - `customId` string, required — Client-provided custom ID

## Other responses

- `401` — Unauthorized. The bearer token is missing, invalid or expired.
- `404` — Company not found, or `parentCustomId` does not match an existing attribute.
- `422` — Validation Error
- `500` — Unexpected error. Contact support if it persists.

---

[API](https://skmtc.net/embat/apis/embat-api.md) · [All operations](https://skmtc.net/embat/apis/embat-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/embat/embat-api/versions/36ca48bf4489/schema)
