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. 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 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 — applies the label to a customer. PRODUCT — applies the label to a product. STORE — applies the label to a 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: 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

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.
.codenumberNumeric error code.
.fieldstringName of the field that caused the error.
.labelExternalIdstringExternal ID of the entity that caused the error. Present when entity-scoped.
.messagestringDescription of the error.

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.

Body Params
string
enum
required
Allowed:
updates
array of objects
required
length ≤ 100
updates*
Headers
string
string
Responses

207

Partial success.

400

Validation failed or org timezone not configured.

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