---
title: "List Bin Entries"
method: GET
path: "/v1/trash-bin"
tags: ["Bin"]
---

# List Bin Entries

`GET /v1/trash-bin`

Retrieves a list of resources moved to the bin. The following resources can be moved to the bin:
- campaigns
- vouchers
- products
- SKUs

To use this endpoint, you must have the following permissions:
- `vouchers.read`
- `campaigns.read`
- `products.read`

## Query parameters

- `limit` integer
- `order` 'id' | '-id'
- `starting_after_id` string
- `filters` ParameterFiltersListBin
  - `junction` 'and' | 'or' — Logical Operator Between Filters. Filter by conditions set on the `junction` parameter indicating how the `conditions` should be accounted for in the query. An `AND` is an all-inclusive logical operator, meaning the `AND` operator displays a record if **ALL** the conditions separated by AND are TRUE, while an `OR` operator displays a record if **ANY** of the conditions separated by OR is TRUE.
  - `id` object — Unique identifier of the bin entry.
    - `conditions` FilterConditionsString — Data filters used to narrow down the data records to be returned in the result.
      - `$in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$not_in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$is` string — Value is exactly this value (single value).
      - `$is_not` string — Results omit this value (single value).
      - `$has_value` string — Value is NOT null. The value for this parameter is an empty string.
      - `$is_unknown` string — Value is null. The value for this parameter is an empty string.
      - `$starts_with` string — Value starts with the specified string.
      - `$ends_with` string — Value ends with the specified string.
      - `$contains` string — Value includes the specified string.
      - `$not_contain` string — Value does NOT include the specified string.
  - `resource_type` object — Resource type of the resource moved to the bin.
    - `conditions` object
      - `$in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$not_in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$is` 'campaign' | 'product' | 'sku' | 'voucher' — Value is exactly this value (single value).
      - `$is_not` 'campaign' | 'product' | 'sku' | 'voucher' — Results omit this value (single value).
      - `$has_value` string — Value is NOT null. The value for this parameter is an empty string.
      - `$is_unknown` string — Value is null. The value for this parameter is an empty string.
      - `$starts_with` string — Value starts with the specified string.
      - `$ends_with` string — Value ends with the specified string.
  - `resource_name` object — Name of the resource moved to the bin: the name of the campaign, voucher, product, or SKU.
    - `conditions` FilterConditionsString — Data filters used to narrow down the data records to be returned in the result.
      - `$in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$not_in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$is` string — Value is exactly this value (single value).
      - `$is_not` string — Results omit this value (single value).
      - `$has_value` string — Value is NOT null. The value for this parameter is an empty string.
      - `$is_unknown` string — Value is null. The value for this parameter is an empty string.
      - `$starts_with` string — Value starts with the specified string.
      - `$ends_with` string — Value ends with the specified string.
      - `$contains` string — Value includes the specified string.
      - `$not_contain` string — Value does NOT include the specified string.
  - `resource_id` object — Unique identifier of the resource moved to the bin.
    - `conditions` FilterConditionsString — Data filters used to narrow down the data records to be returned in the result.
      - `$in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$not_in` string[] — Array of resource values that should be included in the results (multiple values).
      - `$is` string — Value is exactly this value (single value).
      - `$is_not` string — Results omit this value (single value).
      - `$has_value` string — Value is NOT null. The value for this parameter is an empty string.
      - `$is_unknown` string — Value is null. The value for this parameter is an empty string.
      - `$starts_with` string — Value starts with the specified string.
      - `$ends_with` string — Value ends with the specified string.
      - `$contains` string — Value includes the specified string.
      - `$not_contain` string — Value does NOT include the specified string.

## Response `200`

Returns the list of all the bin entries matching the query parameters.

- TrashBinListResponseBody — Retrieves a list of the resources moved the bin.
  - `object` 'list', required — The type of the object represented by JSON. This object stores information about the bin entries in a dictionary.
  - `data_ref` 'data', required — Identifies the name of the attribute that contains the array of bin entry objects.
  - `data` TrashBinItem[], required — Array of bin entry objects.
    - `id` string, required — Unique identifier of the trash bin entry. It should not be confused with the ID of the resource moved to the bin.
    - `created_at` string, date-time, required — Timestamp representing the date and time when the resource was moved to the bin. The value for this parameter is shown in the ISO 8601 format.
    - `deleted_by_user_id` string, nullable, required — Unique identifier of the user who moved the resource to the bin. It returns a user ID if the resource was moved to the bin through an action in the website. It returns a `null` if the resource was deleted through the API.
    - `resource_id` string, required — Unique identifier of the resource moved to the bin, i.e. an ID of a campaign, product, SKU, or voucher.
    - `resource_type` 'campaign' | 'product' | 'sku' | 'voucher', required — Type of the resource moved to the bin.
    - `resource_name` string, required — Name of the resouce moved to the bin. It is the name of the campaign, product or SKU, or the voucher code.
    - `resource_parent_id` string, nullable, required — Unique identifier of the parent resource. For a voucher, it is a campaign ID, except for generic (standalone) vouchers. For an SKU, it is the product ID. It returns `null` for campaigns and base products.
    - `object` 'campaign' | 'product' | 'sku' | 'voucher', required — The type of the object represented by JSON. It is equal to the `resource_type`.
  - `total` integer, required — The total number of bin entries. This is the number of the entries returned in the array, not the number of all matching results or all resources currently moved to the bin.
  - `has_more` boolean, required — As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a `starting_after_id` query or a different limit to get more records returned in the results.
  - `more_starting_after` string — If `has_more` is `true`, it returns an ID that can be used to return another page of results. Use the ID in the `starting_after_id` query parameter to display another page of the results occuring after the field with that ID.

## Other responses

- `403` — Returns an error if the user is missing required permissions.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-api-async-actions/revisions/4982266e0494/schema)
