put
https://{Host}/v2/labels/assignments
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. Use this endpoint to extend or shorten how long a label remains active on a customer, product, or store — without removing and re-assigning it.
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 --location --request PUT 'https://eu.api.capillarytech.com/v2/labels/assignments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {base64_credentials}' \
--data '{
"entityType": "PRODUCT",
"updates": [
{
"entityId": "505102",
"labelId": 128,
"expiryDate": "2100-06-30T23:59:59+05:30"
}
]
}'Prerequisites
- Basic authentication (
Authorization: Basic {base64_credentials}) or OAuth (X-CAP-API-OAUTH-TOKEN). - Access to Label access group resource
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 — applies the label to a customer. PRODUCT — applies the label to a product. STORE — applies the label to a 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: ISO-8601 format: YYYY-MM-DDThh:mm:ssZ (for example, 2026-12-31T23:59:59+05:30). Must be a future date. | Yes |
Example response
{
"data": [
{
"assignmentId": 25,
"entityId": "505102",
"labelId": 128,
"labelName": "DocDemo-VIP-Customer0",
"labelExternalId": "docdemo-vip-0",
"expiryDate": "2100-06-30T18:29:59Z"
}
],
"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. |
.code | number | Numeric error code. |
.field | string | Name of the field that caused the error. |
.labelExternalId | string | External ID of the entity that caused the error. Present when entity-scoped. |
.message | string | Description of the error. |
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. |
207Partial success.
400Validation failed or org timezone not configured.
