Update labels

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Update one or more labels for an organization in a single request. You can update a label's name, external ID, description, expiry configuration, or status. You can update up to 10 labels per request.

Example request

curl -X PUT "https://{host}/v2/labels" \
  -H "Authorization: Basic {base64_credentials}" \
  -H "Content-Type: application/json" \
  -d '{
    "labels": [
      {
        "labelId": 101,
        "name": "Summer Sale Updated",
        "status": "ARCHIVED"
      }
    ]
  }'

Prerequisites

  • Basic authentication (Authorization: Basic {base64_credentials}) or OAuth (X-CAP-API-OAUTH-TOKEN).

Body parameters

Note: The Updatable column indicates whether a field can be changed after creation. Fields marked No are identifiers and must match an existing label.

FieldTypeRequiredDescriptionUpdatable
labelsarrayRequiredList of labels to update. Maximum 10 labels per request.No
.labelIdnumberRequiredUnique identifier of the label to update.No
.namestringOptionalNew name for the label. Must be unique within the same entity type and organization. Max 255 characters.Yes
.externalIdstringOptionalNew external identifier for the label. Must be unique within the same entity type and organization. Max 255 characters.Yes
.descriptionstringOptionalNew description for the label. Max 1,024 characters.Yes
.expiryConfigobjectOptionalNew expiry configuration for the label.Yes
..typeenumOptionalExpiry type. Supported values: NONE, FIXED_DATE, RELATIVE. Case-sensitive.Yes
..expiryDatestringConditionalRequired when type is FIXED_DATE. Expiry date in ISO-8601 format: YYYY-MM-DDThh:mm:ssZ (for example, 2026-12-31T23:59:59+05:30). Must be a future date.Yes
..unitenumConditionalRequired when type is RELATIVE. Duration unit. Supported values: DAYS, MONTHS, YEARS.Yes
..valuenumberConditionalRequired when type is RELATIVE. Duration value. Must be a non-negative integer.Yes
..roundingUnitstringOptionalRounding unit for the expiry duration. Applicable when type is RELATIVE.Yes
.statusenumOptionalNew status for the label. Supported values: ACTIVE, ARCHIVED. To reactivate an archived label, set status to ACTIVE.Yes

Example response

{
  "data": [
    {
      "id": 101,
      "externalId": "summer-sale-2026",
      "name": "Summer Sale Updated",
      "entityType": "PRODUCT",
      "expiryConfig": {
        "type": "FIXED_DATE",
        "expiryDate": "2027-12-31T23:59:59+05:30"
      },
      "status": "ARCHIVED",
      "createdOn": "2026-06-04T10:42:24Z",
      "createdBy": 75216507,
      "lastUpdatedOn": "2026-06-04T10:46:43Z",
      "lastUpdatedBy": 75216507
    }
  ],
  "warnings": [],
  "errors": []
}

Response parameters

FieldTypeDescription
dataarrayList of successfully updated label objects.
.idnumberUnique identifier of the label.
.externalIdstringExternal identifier of the label.
.namestringName of the label.
.descriptionstringDescription of the label.
.entityTypestringEntity type the label applies to. One of CUSTOMER, PRODUCT, or STORE.
.expiryConfigobjectExpiry configuration for the label.
..typestringExpiry type. One of NONE, FIXED_DATE, or RELATIVE.
..expiryDatestringExpiry date in ISO-8601 format. Present when type is FIXED_DATE.
..unitstringDuration unit. Present when type is RELATIVE. One of DAYS, MONTHS, or YEARS.
..valuenumberDuration value. Present when type is RELATIVE.
.statusstringCurrent status of the label. One of ACTIVE or ARCHIVED.
.createdOnstringUTC timestamp when the label was created. Format: YYYY-MM-DDThh:mm:ssZ.
.createdBynumberID of the user who created the label.
.lastUpdatedOnstringUTC timestamp when the label was last updated. Format: YYYY-MM-DDThh:mm:ssZ.
.lastUpdatedBynumberID of the user who last updated the label.
warningsarrayList of warnings. Empty when no warnings occur.
errorsarrayList of errors for labels that failed to update.
.codenumberNumeric error code.
.fieldstringName of the field that caused the error.
.labelIdnumberID of the label item that failed.
.messagestringDescription of the error.

Note: If some labels are updated and others fail, the API returns HTTP 207. If all labels fail, the API returns HTTP 400. If all labels are updated successfully, the API returns HTTP 200.

Error & warning codes

CodeError numberTypeDescription
LABEL_EXPIRY_DATE_PAST23004ErrorExpiry date must be a future date. HTTP 400.
LABEL_UNSUPPORTED_TIME_UNIT23005ErrorUnsupported time unit. Supported values: DAYS, MONTHS, YEARS. HTTP 400.
LABEL_NAME_TOO_LONG23007ErrorLabel name must not exceed 255 characters. HTTP 400.
LABEL_EXTERNAL_ID_TOO_LONG23008ErrorExternal ID must not exceed 255 characters. HTTP 400.
LABEL_DESCRIPTION_TOO_LONG23009ErrorDescription must not exceed 1,024 characters. HTTP 400.
LABEL_RELATIVE_EXPIRY_UNIT_REQUIRED23010Errorunit is required when expiryConfig.type is RELATIVE. HTTP 400.
LABEL_RELATIVE_EXPIRY_VALUE_REQUIRED23011Errorvalue must be a non-negative integer when expiryConfig.type is RELATIVE. HTTP 400.
LABEL_FIXED_EXPIRY_DATE_REQUIRED23012ErrorexpiryDate is required when expiryConfig.type is FIXED_DATE. HTTP 400.
LABEL_INVALID_EXPIRY_CONFIG_TYPE23013ErrorInvalid expiry config type. Supported values: NONE, FIXED_DATE, RELATIVE. HTTP 400.
LABEL_INVALID_EXPIRY_DATE_FORMAT23014ErrorInvalid expiry date format. Expected ISO-8601 format: YYYY-MM-DDThh:mm:ssZ. HTTP 400.
LABEL_BATCH_SIZE_EXCEEDED23021ErrorMaximum 10 labels can be updated in a single request. HTTP 400.
LABEL_REQUEST_BODY_EMPTY23022ErrorRequest body must contain at least one label. HTTP 400.
LABEL_NOT_FOUND23025ErrorLabel with the specified ID does not exist. HTTP 400.
LABEL_ARCHIVED23026ErrorLabel is archived. Only a status change to ACTIVE is allowed. HTTP 400.
LABEL_UPDATE_NAME_DUPLICATE23027ErrorAn active label with this name already exists for this entity type. HTTP 409.
LABEL_UPDATE_EXTERNAL_ID_DUPLICATE23028ErrorAn active label with this external ID already exists for this entity type. HTTP 409.
LABEL_UPDATE_LOCK_FAILED23029ErrorCould not acquire lock for label update. Retry after a short delay. HTTP 409.
Body Params
labels
array of objects
length ≤ 10
labels
Headers
string
string
Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json