Creates one or more labels in bulk. Labels classify entities such as customers, products, or stores. An organization can create up to 10 labels per request.
Bash
curl -X POST "https://{host}/api_gateway/v2/labels" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"labels": [
{
"name": "Summer Sale",
"externalId": "SUMMER_SALE",
"description": "Products eligible for summer promotions",
"entityType": "PRODUCT",
"expiryConfig": {
"type": "FIXED_DATE",
"date": "2026-08-31T23:59:59Z"
}
}
]
}'
Requires authentication with a valid bearer token.
The token must have write access to the Labels resource.
Field Type Required Description labelsarray Required List of label objects to create. Maximum 10 per request. .namestring Required Display name for the label. Max 255 characters. Must be unique within the entity type for the org. .externalIdstring Optional Caller-defined identifier. Max 255 characters. Must be unique within the entity type if provided. .descriptionstring Optional Human-readable description. Max 1024 characters. .entityTypeenum Required Entity type this label applies to. One of: CUSTOMER, PRODUCT, STORE. .expiryConfigobject Optional Expiry settings for the label. If omitted, the label does not expire. ..typeenum Required Expiry type. One of: NONE, FIXED_DATE, RELATIVE. ..datestring Conditional Required when type is FIXED_DATE. ISO-8601 UTC date-time (YYYY-MM-DDThh:mm:ssZ). Must be a future date. ..durationinteger Conditional Required when type is RELATIVE. Positive integer representing the number of duration units. ..durationTypeenum Conditional Required when type is RELATIVE. One of: DAYS, MONTHS, YEARS.
JSON
{
"data": [
{
"id": 101,
"externalId": "SUMMER_SALE"
}
],
"warnings": [],
"errors": []
}
Field Type Description dataarray Labels created successfully in this request. .idinteger System-generated unique identifier assigned to the label. .externalIdstring Caller-defined identifier supplied in the request, or null if not provided. warningsarray Non-fatal issues. Each item includes a code and message. errorsarray Labels that failed to create. Each item includes a code, message, and the rejected input.
Code Error number Type Description LABEL_NAME_REQUIRED23001 Error Label name is missing. HTTP 400. LABEL_INVALID_ENTITY_TYPE23006 Error entityType is not one of CUSTOMER, PRODUCT, STORE. HTTP 400.LABEL_NAME_TOO_LONG23007 Error name exceeds 255 characters. HTTP 400.LABEL_EXTERNAL_ID_TOO_LONG23008 Error externalId exceeds 255 characters. HTTP 400.LABEL_DESCRIPTION_TOO_LONG23009 Error description exceeds 1024 characters. HTTP 400.LABEL_DUPLICATE_NAME23019 Error A label with this name already exists for the entity type in this org. HTTP 409. LABEL_DUPLICATE_EXTERNAL_ID23020 Error A label with this external ID already exists for the entity type in this org. HTTP 409. LABEL_BATCH_SIZE_EXCEEDED23021 Error More than 10 labels in a single request. HTTP 400.