Bulk Delete Catalog Items

/data/v2/projects/{project_id}/catalogs/{catalog_id}/items/bulk-delete

Introduction

The Bulk Delete Catalog Items API endpoint deletes catalog items in bulk, so you can now delete multiple items in your catalog all at once to keep your data up-to-date quickly.

How it works

If the item exists, it will be deleted. If not, the entire request won't fail, and other items with the correct item_id will be deleted. This means you can sync your catalogs faster.

The response contains a list with the same number and order of items as the request body. For each item, either a success or a failure is indicated. If you send 10 items, a body containing 10 elements will be returned, with the order matching the request. If you had an error in the 5th item, you would know this since the 5th item in the response will contain an error description:

[
    {{
        "success": true,
        "queued": true
    }},
    {{
        "success": true,
        "queued": true
    }},
    {{
        "success": false,
        "queued": false,
        "errors": {{
            "_global": [
                "Malformed item id. Item id should be a string"
            ]
        }}
    }}
]

Definition

Authorization

In this API call, you must use the following authorization access and permissions:

Available access typePermissions needed
Private accessCatalogs > Delete catalog item

Read more about:

Path parameters

ParameterTypeDescriptionRequired
catalog_idstringThe ID of the desired existing catalog.Required
project_idstringThe ID of your project.Required

Item delete attributes

ParameterTypeDescriptionRequired
item_idstringThe ID of the desired item within an existing catalog.

Note that due to the way the endpoint is decomposed, edits using API will only work with itemIds NOT containing /.
Required

Header

ParameterTypeDescriptionRequired
authorizationstringUsed for authentication. Read more in the Authentication section.Required
content-typestringapplication/JSONRequired

Example response

HTTP/1.1 200 OK
        Content-Type: application/json

        [
          {{
              "success": true,
              "queued": true
          }},
          {{
              "success": true,
              "queued": true
          }},
          {{
              "success": false,
              "queued": false,
              "errors": {{
                  "_global": [
                      "Malformed item id. Item id should be a string"
                  ]
              }}
          }}
      ]

📘

Asynchronous endpoint

Note that this endpoint is asynchronous, which means that success response means only that the request is queued to be processed later, not that the item was successfully updated.

Limitations

  • The JSON request body must not exceed 10 MB of the payload size.
  • Each request must not be larger than 10,000 item IDs.
  • You can only send 5 requests per 10 seconds per catalog. This limitation covers both Bulk endpoints , meaning that if you send, for instance, 2 update and 3 partial update requests within 10 seconds, you will hit the 5-requests limit.

Error conditions

Global

Status 400 with an error message is returned in these cases:

  • Invalid JSON
  • Payload not a list
  • Payload size exceeded
  • Too many items

Status 403 is returned when a Certain API key lacks permission to perform an action (catalogs.delete_catalog_item)

Per item

The status code is 200, but the update of individual items might have failed for the following reasons:

  • Malformed item ID (Cannot be parsed into a string)
  • Validation error (e.g empty item ID)

📘

NOTE: If the item with the provided item_id is not in the catalog, the response will still be 200 (success:true) for this item.

Language
Click Try It! to start a request and see the response here!