Set the publication state of one or more entities. This playground calls the live API and will modify data.
Set publication_state on every entity in a scope — an explicit list of ids, or everything matching a filter tree.
The state is written to the entities and mirrored onto their linked legacy inventories (only those already completed), so old product reads stay consistent. Only MongoDB is written in the request; the search index catches up from the Change Stream a moment later, so an immediate re-query may still show the previous state.
POST https://api.commerceclarity.com/api/2026-05/entities/publication-stateSend either ids or filters. If both are present, ids wins and filters is ignored.
| Parameter | Type | Required | Description |
|---|---|---|---|
publication_state | string | Required | One of pending_review, ready, online. |
ids | array | Required | Non-empty array of entity _id strings. Required unless filters is sent. |
filters | object | Required | Filter tree — the same one List / Query entities takes. Updates everything it matches. Required unless ids is sent. |
filters.operator | string | Required | and or or. Mandatory whenever filters is present. |
filters.conditions | array | Optional | An empty or omitted condition list is the deliberate whole catalogue scope. |
brand_id | string | Optional | Override the active brand. |
filters scope may resolve at most 5 000 entities. The count is checked before anything is written; above the cap the request is refused with 422. An ids scope is not capped.| State | Description |
|---|---|
pending_review | The product is awaiting review before being approved for publication |
ready | The product has been reviewed and is ready to be published |
online | The product is currently published and visible online |
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/publication-state" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"publication_state": "online",
"ids": ["507f1f77bcf86cd799439011", "507f1f77bcf86cd799439012"]
}'
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/publication-state" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"publication_state": "online",
"filters": {
"operator": "and",
"conditions": [
{ "field": "publication_state", "op": "is", "value": "ready" },
{ "field": "country", "op": "is", "value": "IT" }
]
}
}'
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/publication-state" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "publication_state": "online", "filters": { "operator": "and", "conditions": [] } }'
{
"status": "success",
"message": "Publication state updated",
"updated": 342
}updated counts the entities whose state was written. It is lower than the scope size when some ids matched no entity of the brand.
{
"status": "error",
"message": "The selected publication state is invalid."
}{
"status": "error",
"message": "The selection matches 12480 entities, more than the 5000 allowed for a single bulk action. Narrow the filters and try again.",
"total": 12480,
"limit": 5000
}{
"status": "error",
"message": "Unable to resolve the selected products: <reason>"
}