API Playground

Set the publication state of one or more entities. This playground calls the live API and will modify data.

Authentication Required

You need to Login to test the API playground

Bulk publication state

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.

Endpoint URL
POST https://api.commerceclarity.com/api/2026-05/entities/publication-state

Body parameters

Send either ids or filters. If both are present, ids wins and filters is ignored.

ParameterTypeRequiredDescription
publication_statestringRequiredOne of pending_review, ready, online.
idsarrayRequiredNon-empty array of entity _id strings. Required unless filters is sent.
filtersobjectRequiredFilter tree — the same one List / Query entities takes. Updates everything it matches. Required unless ids is sent.
filters.operatorstringRequiredand or or. Mandatory whenever filters is present.
filters.conditionsarrayOptionalAn empty or omitted condition list is the deliberate whole catalogue scope.
brand_idstringOptionalOverride the active brand.
A 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.

Publication states

StateDescription
pending_reviewThe product is awaiting review before being approved for publication
readyThe product has been reviewed and is ready to be published
onlineThe product is currently published and visible online

Request Examples

By ids
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"]
  }'
By filters — publish everything ready in Italy
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"    }
      ]
    }
  }'
By filters — the whole catalogue
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": [] } }'

Response Example

Success Response
{
  "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.

Error Response - Validation — validation
{
  "status": "error",
  "message": "The selected publication state is invalid."
}
Error Response - Validation — scope over the cap (422)
{
  "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
}
Error Response - Validation — scope could not be resolved (503)
{
  "status": "error",
  "message": "Unable to resolve the selected products: <reason>"
}
The legacy PUT /inventories/set-publication-state is unchanged. It resolves ids against inventory codes, which a filter scope cannot express.