Update labels

Update labels (PUT)

Updates one or more labels in bulk. An organization can update up to 10 labels per request. Supplying expiryConfig replaces the label's existing expiry configuration entirely.

Example request

curl -X PUT "https://{host}/api_gateway/v2/labels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "labels": [
      {
        "id": 101,
        "name": "Winter Sale",
        "status": "ACTIVE",
        "expiryConfig": {
          "type": "RELATIVE",
          "duration": 30,
          "durationType": "DAYS"
        }
      }
    ]
  }'

Prerequisites

  • Requires authentication with a valid bearer token.
  • The token must have write access to the Labels resource.

Body parameters

Note: The Updatable column indicates whether a field can be changed after creation. Fields marked No are identifiers used to locate the label.

FieldTypeRequiredDescriptionUpdatable
labelsarrayRequiredList of label update objects. Maximum 10 per request.
.idintegerRequiredSystem-assigned identifier of the label to update.No
.namestringOptionalNew display name. Max 255 characters. Must be unique within the entity type.Yes
.externalIdstringOptionalNew caller-defined identifier. Max 255 characters. Must be unique within the entity type if provided.Yes
.descriptionstringOptionalNew description. Max 1024 characters.Yes
.statusenumOptionalNew label status. One of: ACTIVE, ARCHIVED.Yes
.expiryConfigobjectOptionalNew expiry configuration. Replaces the existing configuration entirely when supplied.Yes
..typeenumRequiredExpiry type. One of: NONE, FIXED_DATE, RELATIVE.Yes
..datestringConditionalRequired when type is FIXED_DATE. ISO-8601 UTC date-time (YYYY-MM-DDThh:mm:ssZ). Must be a future date.Yes
..durationintegerConditionalRequired when type is RELATIVE. Positive integer representing the number of duration units.Yes
..durationTypeenumConditionalRequired when type is RELATIVE. One of: DAYS, MONTHS, YEARS.Yes

Example response

{
  "data": [
    {
      "id": 101,
      "externalId": "SUMMER_SALE",
      "name": "Winter Sale",
      "description": "Products eligible for winter promotions",
      "entityType": "PRODUCT",
      "expiryConfig": {
        "type": "RELATIVE",
        "duration": 30,
        "durationType": "DAYS"
      },
      "status": "ACTIVE",
      "createdOn": "2026-01-15T10:00:00Z",
      "createdBy": 5001,
      "lastUpdatedOn": "2026-05-29T08:30:00Z",
      "lastUpdatedBy": 5001
    }
  ]
}

Response parameters

FieldTypeDescription
dataarrayUpdated label objects.
.idintegerSystem-assigned unique identifier.
.externalIdstringCaller-defined identifier, or null if not set.
.namestringCurrent display name.
.descriptionstringCurrent description, or null if not set.
.entityTypestringEntity type: CUSTOMER, PRODUCT, or STORE.
.expiryConfigobjectCurrent expiry configuration.
..typestringExpiry type: NONE, FIXED_DATE, or RELATIVE.
..datestringExpiry date in UTC. Present only when type is FIXED_DATE.
..durationintegerNumber of duration units. Present only when type is RELATIVE.
..durationTypestringDuration unit: DAYS, MONTHS, or YEARS. Present only when type is RELATIVE.
.statusstringCurrent status: ACTIVE or ARCHIVED.
.createdOnstringISO-8601 timestamp when the label was created.
.createdByintegerUser ID of the creator.
.lastUpdatedOnstringISO-8601 timestamp of the most recent update.
.lastUpdatedByintegerUser ID of the most recent editor.

Error & warning codes

CodeError numberTypeDescription
LABEL_NAME_REQUIRED23001ErrorLabel name is missing. HTTP 400.
LABEL_INVALID_ENTITY_TYPE23006ErrorentityType is not one of CUSTOMER, PRODUCT, STORE. HTTP 400.
LABEL_NAME_TOO_LONG23007Errorname exceeds 255 characters. HTTP 400.
LABEL_EXTERNAL_ID_TOO_LONG23008ErrorexternalId exceeds 255 characters. HTTP 400.
LABEL_DESCRIPTION_TOO_LONG23009Errordescription exceeds 1024 characters. HTTP 400.
LABEL_DUPLICATE_NAME23019ErrorA label with this name already exists for the entity type in this org. HTTP 409.
LABEL_DUPLICATE_EXTERNAL_ID23020ErrorA label with this external ID already exists for the entity type in this org. HTTP 409.
LABEL_BATCH_SIZE_EXCEEDED23021ErrorMore than 10 labels in a single request. HTTP 400.