get
https://example.com
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
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
expiryDateis the only updatable field — all other fields identify which assignment to update.
| Field | Type | Required | Description | Updatable |
|---|---|---|---|---|
entityType | enum | Required | Entity type for all updates in this request. Supported values: CUSTOMER, PRODUCT, STORE. Case-sensitive. | No |
updates | array | Required | List of update items. Maximum 100 items per request. | No |
.entityId | string | Required | Identifier of the entity whose assignment to update. | No |
.labelId | number | Conditional | Unique identifier of the label. Provide exactly one of labelId, labelName, or labelExternalId. | No |
.labelName | string | Conditional | Name of the label. Provide exactly one of labelId, labelName, or labelExternalId. | No |
.labelExternalId | string | Conditional | External identifier of the label. Provide exactly one of labelId, labelName, or labelExternalId. | No |
.expiryDate | string | Required | New 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
| Field | Type | Description |
|---|---|---|
data | array | List of successfully updated assignment objects. |
.assignmentId | number | Unique identifier of the assignment. |
.entityId | string | Identifier of the entity. |
.labelId | number | Unique identifier of the label. |
.labelName | string | Name of the label. |
.labelExternalId | string | External identifier of the label. |
.expiryDate | string | Updated expiry date and time of the assignment, in ISO-8601 format. |
warnings | array | List of warnings. Empty when no warnings occur. |
errors | array | List of errors for update items that failed. |
Note: The
expiryDatefield 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
| Code | Error number | Type | Description |
|---|---|---|---|
ASSIGNMENT_REQUEST_BODY_EMPTY | 23031 | Error | Request body must contain at least one update item. HTTP 400. |
ASSIGNMENT_BATCH_SIZE_EXCEEDED | 23032 | Error | Maximum 100 update items can be processed in a single request. HTTP 400. |
ASSIGNMENT_ENTITY_TYPE_REQUIRED | 23033 | Error | entityType is required. HTTP 400. |
ASSIGNMENT_INVALID_ENTITY_TYPE | 23034 | Error | Invalid entity type. Supported values: CUSTOMER, PRODUCT, STORE. HTTP 400. |
ASSIGNMENT_EXPIRY_DATE_PAST | 23039 | Error | Expiry date must be a future date. HTTP 400. |
ASSIGNMENT_INVALID_EXPIRY_DATE_FORMAT | 23040 | Error | Invalid expiry date format. Expected: yyyy-MM-dd (for example, 2026-08-31). HTTP 400. |
ASSIGNMENT_ENTITY_NOT_FOUND | 23045 | Error | Entity with the given ID does not exist. HTTP 400. |
ASSIGNMENT_EXPIRY_DATE_REQUIRED | 23048 | Error | expiryDate is required for each update item. HTTP 400. |
ASSIGNMENT_NOT_ASSIGNED_TO_ENTITY | 23050 | Error | The label is not assigned to this entity. HTTP 400. |
ASSIGNMENT_UPDATE_LABEL_IDENTIFIER_REQUIRED | 23054 | Error | One of labelId, labelName, or labelExternalId is required for each update item. HTTP 400. |
ASSIGNMENT_LOCK_FAILED | 23055 | Error | Could not acquire lock for the entity. Retry after a short delay. HTTP 409. |
ORG_TIMEZONE_NOT_CONFIGURED | 23056 | Error | The organization does not have a timezone configured. HTTP 400. |
ASSIGNMENT_UPDATE_LABEL_IDENTIFIER_AMBIGUOUS | 23057 | Error | Only one of labelId, labelName, or labelExternalId is allowed per update item. HTTP 400. |
