Search label assignments

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

Search label assignments by a specific label, with optional filtering by entity ID and pagination. Use this endpoint to find which entities have a particular label assigned.

Example request

curl -X GET "https://{host}/v2/labels/assignments/search?entityType=CUSTOMER&labelId=109&limit=10&offset=0" \
  -H "Authorization: Basic {base64_credentials}"

Prerequisites

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

Resource information

Pagination supportYes
Batch supportNo

Query parameters

FieldTypeRequiredDescription
entityTypeenumRequiredEntity type to search within. Supported values: CUSTOMER, PRODUCT, STORE. Case-sensitive.
labelIdnumberConditionalUnique identifier of the label to search by. Provide exactly one of labelId, labelName, or labelExternalId.
labelNamestringConditionalName of the label to search by. Provide exactly one of labelId, labelName, or labelExternalId.
labelExternalIdstringConditionalExternal identifier of the label to search by. Provide exactly one of labelId, labelName, or labelExternalId.
entityIdstringOptionalFilters results to a specific entity ID.
limitnumberOptionalMaximum number of results to return per page. Between 1 and 50. Defaults to 10.
offsetnumberOptionalNumber of records to skip for pagination. Must be 0 or greater. Defaults to 0.

Example response

{
  "data": [
    {
      "entityId": "<ENTITY_ID>",
      "labelId": 109,
      "labelName": "Doc Test Label Relative",
      "labelExternalId": "doc-test-relative-001",
      "expiryDate": "2027-06-04T18:29:59Z"
    }
  ],
  "pagination": {
    "totalCount": 1,
    "limit": 5,
    "offset": 0
  }
}

Response parameters

FieldTypeDescription
dataarrayList of label assignment records matching the search criteria.
.entityIdstringIdentifier of the entity.
.labelIdnumberUnique identifier of the label.
.labelNamestringName of the label.
.labelExternalIdstringExternal identifier of the label.
.expiryDatestringExpiry date and time of the assignment in ISO-8601 format. null if the assignment does not expire.
paginationobjectPagination metadata.
.totalCountnumberTotal number of matching records.
.limitnumberMaximum number of records returned in this response.
.offsetnumberNumber of records skipped.

Error and warning codes

Note: Validation errors for this endpoint are returned as {"message": "<error description>"} rather than the standard errors array.

CodeError numberTypeDescription
ASSIGNMENT_ENTITY_TYPE_REQUIRED23033ErrorentityType is required. HTTP 400.
ASSIGNMENT_INVALID_ENTITY_TYPE23034ErrorInvalid entity type. Supported values: CUSTOMER, PRODUCT, STORE. HTTP 400.
ASSIGNMENT_LABEL_SEARCH_IDENTIFIER_REQUIRED23036ErrorExactly one of labelId, labelName, or labelExternalId is required. HTTP 400.
ASSIGNMENT_INVALID_LIMIT23046Errorlimit must be between 1 and 50. HTTP 400.
ASSIGNMENT_INVALID_OFFSET23047Erroroffset must be 0 or greater. HTTP 400.
Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!