Update label assignments

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

Update the expiry date of one or more label assignments in a single request. You can identify the label to update by its ID, name, or external ID. You can process up to 100 update items per request.

Example request

curl -X PUT "https://{host}/v2/labels/assignments" \
  -H "Authorization: Basic {base64_credentials}" \
  -H "Content-Type: application/json" \
  -d '{
    "entityType": "CUSTOMER",
    "updates": [
      {
        "entityId": "<ENTITY_ID>",
        "labelId": 109,
        "expiryDate": "2028-01-01"
      }
    ]
  }'

Prerequisites

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

Body parameters

Note: The Updatable column indicates which fields can be changed. The expiryDate is the only updatable field — all other fields identify which assignment to update.

FieldTypeRequiredDescriptionUpdatable
entityTypeenumRequiredEntity type for all updates in this request. Supported values: CUSTOMER, PRODUCT, STORE. Case-sensitive.No
updatesarrayRequiredList of update items. Maximum 100 items per request.No
.entityIdstringRequiredIdentifier of the entity whose assignment to update.No
.labelIdnumberConditionalUnique identifier of the label. Provide exactly one of labelId, labelName, or labelExternalId.No
.labelNamestringConditionalName of the label. Provide exactly one of labelId, labelName, or labelExternalId.No
.labelExternalIdstringConditionalExternal identifier of the label. Provide exactly one of labelId, labelName, or labelExternalId.No
.expiryDatestringRequiredNew expiry date for the assignment. Format: yyyy-MM-dd (for example, 2027-06-30). Must be a future date.Yes

Example response

{
  "data": [
    {
      "assignmentId": 1,
      "entityId": "<ENTITY_ID>",
      "labelId": 109,
      "labelName": "VIP",
      "labelExternalId": "vip-tier",
      "expiryDate": "2028-01-01T00:00:00Z"
    }
  ],
  "warnings": [],
  "errors": []
}

Response parameters

FieldTypeDescription
dataarrayList of successfully updated assignment objects.
.assignmentIdnumberUnique identifier of the assignment.
.entityIdstringIdentifier of the entity.
.labelIdnumberUnique identifier of the label.
.labelNamestringName of the label.
.labelExternalIdstringExternal identifier of the label.
.expiryDatestringUpdated expiry date and time of the assignment, in ISO-8601 format.
warningsarrayList of warnings. Empty when no warnings occur.
errorsarrayList of errors for update items that failed.

Note: The expiryDate field requires the org to have a timezone configured. If the org timezone is not set, the API returns HTTP 400 with no response body.

Error & warning codes

CodeError numberTypeDescription
ASSIGNMENT_REQUEST_BODY_EMPTY23031ErrorRequest body must contain at least one update item. HTTP 400.
ASSIGNMENT_BATCH_SIZE_EXCEEDED23032ErrorMaximum 100 update items can be processed in a single request. HTTP 400.
ASSIGNMENT_ENTITY_TYPE_REQUIRED23033ErrorentityType is required. HTTP 400.
ASSIGNMENT_INVALID_ENTITY_TYPE23034ErrorInvalid entity type. Supported values: CUSTOMER, PRODUCT, STORE. HTTP 400.
ASSIGNMENT_EXPIRY_DATE_PAST23039ErrorExpiry date must be a future date. HTTP 400.
ASSIGNMENT_INVALID_EXPIRY_DATE_FORMAT23040ErrorInvalid expiry date format. Expected: yyyy-MM-dd (for example, 2026-08-31). HTTP 400.
ASSIGNMENT_ENTITY_NOT_FOUND23045ErrorEntity with the given ID does not exist. HTTP 400.
ASSIGNMENT_EXPIRY_DATE_REQUIRED23048ErrorexpiryDate is required for each update item. HTTP 400.
ASSIGNMENT_NOT_ASSIGNED_TO_ENTITY23050ErrorThe label is not assigned to this entity. HTTP 400.
ASSIGNMENT_UPDATE_LABEL_IDENTIFIER_REQUIRED23054ErrorOne of labelId, labelName, or labelExternalId is required for each update item. HTTP 400.
ASSIGNMENT_LOCK_FAILED23055ErrorCould not acquire lock for the entity. Retry after a short delay. HTTP 409.
ORG_TIMEZONE_NOT_CONFIGURED23056ErrorThe organization does not have a timezone configured. HTTP 400.
ASSIGNMENT_UPDATE_LABEL_IDENTIFIER_AMBIGUOUS23057ErrorOnly one of labelId, labelName, or labelExternalId is allowed per update item. HTTP 400.
Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!