Get label assignments

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

Retrieve all label assignments for a set of entities. Pass up to 10 entity IDs in a single request to get each entity's active — and optionally inactive — label assignments.

Example request

curl -X GET "https://{host}/v2/labels/assignments?entityType=CUSTOMER&entityIds=<ENTITY_ID>&includeInactive=false" \
  -H "Authorization: Basic {base64_credentials}"

Prerequisites

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

Resource information

Pagination supportNo
Batch supportYes — up to 10 entity IDs per request

Query parameters

FieldTypeRequiredDescription
entityTypeenumRequiredEntity type to query. Supported values: CUSTOMER, PRODUCT, STORE. Case-sensitive.
entityIdsstringRequiredComma-separated list of entity IDs to look up. Maximum 10 IDs per request.
includeInactivebooleanOptionalSet to true to include expired and inactive assignments in the response. Defaults to false.

Example response

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

Response parameters

FieldTypeDescription
dataarrayOne entry per requested entity ID.
.entityIdstringIdentifier of the entity.
.labelsarrayList of label assignments for the entity. Empty when the entity has no active assignments.
..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.
errorsarrayList of request-level errors.

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_ENTITY_IDS_REQUIRED23041ErrorentityIds must contain at least one value. HTTP 400.
ASSIGNMENT_ENTITY_IDS_EXCEEDED23042ErrorMaximum 10 entity IDs can be queried in a single request. HTTP 400.
Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!