Update label assignments

Update label assignments (PUT)

Updates the expiry date of existing label assignments in bulk. An organization can update up to 10 assignments per request. Returns HTTP 200 if all succeed, HTTP 207 if some fail, or HTTP 400 if all fail.

Example request

curl -X PUT "https://{host}/api_gateway/v2/labels/assignments" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "entityType": "PRODUCT",
    "updates": [
      {
        "entityId": "SKU-001",
        "labelId": 101,
        "expiryDate": "2026-12-31"
      }
    ]
  }'

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 the assignment is created. Fields marked No identify the assignment to update.

FieldTypeRequiredDescriptionUpdatable
entityTypeenumRequiredEntity type of the assigned entity. One of: CUSTOMER, PRODUCT, STORE.No
updatesarrayRequiredList of assignment update objects. Maximum 10 per request.
.entityIdstringRequiredIdentifier of the entity whose assignment is being updated.No
.labelIdintegerConditionalSystem-assigned identifier of the label. Exactly one of labelId, labelName, or labelExternalId must be provided.No
.labelNamestringConditionalDisplay name of the label. Exactly one of labelId, labelName, or labelExternalId must be provided.No
.labelExternalIdstringConditionalCaller-defined identifier of the label. Exactly one of labelId, labelName, or labelExternalId must be provided.No
.expiryDatestringRequiredNew expiry date for the assignment. Format: YYYY-MM-DD. Must be a future date.Yes

Example response

{
  "data": [
    {
      "assignmentId": 5001,
      "entityId": "SKU-001",
      "labelId": 101,
      "labelName": "Summer Sale",
      "labelExternalId": "SUMMER_SALE",
      "expiryDate": "2026-12-31"
    }
  ],
  "warnings": [],
  "errors": []
}

Response parameters

FieldTypeDescription
dataarrayAssignments updated successfully.
.assignmentIdintegerSystem-assigned unique identifier for the assignment.
.entityIdstringEntity identifier.
.labelIdintegerSystem-assigned identifier of the label.
.labelNamestringDisplay name of the assigned label.
.labelExternalIdstringCaller-defined identifier of the assigned label, or null if not set.
.expiryDatestringUpdated expiry date in YYYY-MM-DD format.
warningsarrayNon-fatal issues. Each item includes a code and message.
errorsarrayAssignments that failed to update. Each item includes a code, message, and the rejected input.

Error & warning codes

CodeError numberTypeDescription
LABEL_INVALID_ENTITY_TYPE23006ErrorentityType is not one of CUSTOMER, PRODUCT, STORE. HTTP 400.
ASSIGNMENT_BATCH_SIZE_EXCEEDED23032ErrorMore than 10 updates in a single request. HTTP 400.