> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryStorageItems

# Package: automations

# Namespace: StorageService

# Method link: https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/query-storage-items.md

## Permission Scopes:
Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS

## Introduction

Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide.

Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).

---

## REST API

### Schema

```
 Method: queryStorageItems
 Description: Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide.  Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).
 URL: https://www.wixapis.com/storage-service/v1/storage-items/query
 Method: POST
 Method parameters:
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: key | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: description | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: displayName | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: type | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryStorageItemsResponse
  - name: storageItems | type: array<StorageItem> | description: List of storage items that match the query criteria.  
     - ONE-OF: 
        - name: stringValue | type: StringValue | description: When the item type is `STRING`, the string value.  
           - name: value | type: string | description: String value.  | validation: maxLength 4096
           - name: format | type: Format | description: String format.  
                 - enum:
                 -     PLAIN_TEXT: Plain text.
                 -     URI: [Universal Resource Identifier (URI)](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier).
                 -     EMAIL: Email.
                 -     DATETIME: Datetime string in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
        - name: booleanValue | type: BooleanValue | description: When the item type is `BOOLEAN`, the boolean value.  
           - name: value | type: boolean | description: Boolean value.  
        - name: numberValue | type: NumberValue | description: When the item type is `NUMBER`, the numeric value.  
           - name: value | type: string | description: Numeric decimal value, represented as a string.  | validation: decimalValue {"lte":"9999999999999999.99","gte":"-9999999999999999.99","maxScale":16}
        - name: counterValue | type: CounterValue | description: When the item type is `COUNTER`, the counter value.  > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction.md#atomic-updates).  
           - name: value | type: string | description: Counter decimal value, represented as a string.  | validation: decimalValue {"lte":"9999999999999999.99","gte":"-9999999999999999.99","maxScale":16}
     - name: id | type: string | description: Storage item GUID.  | read-only: true | validation: format GUID, immutable
     - name: key | type: string | description: Unique storage item key. The key can only contain letters, numbers, and underscores.  Once you create the item, you can't update its key.  | validation: minLength 1, maxLength 63, immutable
     - name: displayName | type: string | description: Storage item display name. The display name appears when you [add or edit steps to your automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-3-add-steps-to-you-automation).  | validation: minLength 1, maxLength 63
     - name: description | type: string | description: Storage item description.  | validation: maxLength 200
     - name: type | type: Type | description: Data type of the storage item's value. Once created, you can't change the value's type.  | validation: immutable
         - enum:
         -     STRING: String.
         -     BOOLEAN: Boolean.
         -     NUMBER: Number.
         -     COUNTER: Counter.  > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction.md#atomic-updates).
     - name: createdDate | type: string | description: When the storage item was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: When the storage item was last updated.  | read-only: true | validation: format date-time
     - name: tags | type: Tags | description: [Tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction.md) assigned to the storage item.  You can use public and private tags for categorization and filtering.  
        - name: privateTags | type: TagList | description: List of private tags.  Private tags require additional permissions to access. They are usually hidden from site members and visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: List of public tags.  Public tags are visible to anyone with access to the main storage item, including site members and visitors.  
     - name: extendedFields | type: ExtendedFields | description: Extended fields.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query Storage Items
```curl
curl -X POST 'https://www.wixapis.com/storage-service/v1/storage-items/query' \
-H 'authorization: <AUTH>' \
-H 'content-type: application/json' \
--data-binary '{
    "query": {
        "filter": {
            "type": "COUNTER"
        },
        "sort": {
            "fieldName": "updatedDate",
            "order": "DESC"
        },
        "paging": {
            "limit": 10
        }
    }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automations.storageItem.queryStorageItems(query)
 Description: Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide.  Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: StorageItemQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: key | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: description | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: displayName | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: type | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryStorageItemsResponse>
  - name: storageItems | type: array<StorageItem> | description: List of storage items that match the query criteria.  
     - ONE-OF: 
        - name: stringValue | type: StringValue | description: When the item type is `STRING`, the string value.  
           - name: value | type: string | description: String value.  | validation: maxLength 4096
           - name: format | type: Format | description: String format.  
                 - enum:
                 -     PLAIN_TEXT: Plain text.
                 -     URI: [Universal Resource Identifier (URI)](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier).
                 -     EMAIL: Email.
                 -     DATETIME: Datetime string in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
        - name: booleanValue | type: BooleanValue | description: When the item type is `BOOLEAN`, the boolean value.  
           - name: value | type: boolean | description: Boolean value.  
        - name: numberValue | type: NumberValue | description: When the item type is `NUMBER`, the numeric value.  
           - name: value | type: string | description: Numeric decimal value, represented as a string.  | validation: decimalValue {"lte":"9999999999999999.99","gte":"-9999999999999999.99","maxScale":16}
        - name: counterValue | type: CounterValue | description: When the item type is `COUNTER`, the counter value.  > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction.md#atomic-updates).  
           - name: value | type: string | description: Counter decimal value, represented as a string.  | validation: decimalValue {"lte":"9999999999999999.99","gte":"-9999999999999999.99","maxScale":16}
     - name: _id | type: string | description: Storage item GUID.  | read-only: true | validation: format GUID, immutable
     - name: key | type: string | description: Unique storage item key. The key can only contain letters, numbers, and underscores.  Once you create the item, you can't update its key.  | validation: minLength 1, maxLength 63, immutable
     - name: displayName | type: string | description: Storage item display name. The display name appears when you [add or edit steps to your automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-3-add-steps-to-you-automation).  | validation: minLength 1, maxLength 63
     - name: description | type: string | description: Storage item description.  | validation: maxLength 200
     - name: type | type: Type | description: Data type of the storage item's value. Once created, you can't change the value's type.  | validation: immutable
         - enum:
         -     STRING: String.
         -     BOOLEAN: Boolean.
         -     NUMBER: Number.
         -     COUNTER: Counter.  > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction.md#atomic-updates).
     - name: _createdDate | type: Date | description: When the storage item was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: When the storage item was last updated.  | read-only: true 
     - name: tags | type: Tags | description: [Tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction.md) assigned to the storage item.  You can use public and private tags for categorization and filtering.  
        - name: privateTags | type: TagList | description: List of private tags.  Private tags require additional permissions to access. They are usually hidden from site members and visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: List of public tags.  Public tags are visible to anyone with access to the main storage item, including site members and visitors.  
     - name: extendedFields | type: ExtendedFields | description: Extended fields.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query Storage Items
Retrieves storage items filtered by type, sorted by updated date.

```javascript
import { storageItem } from "@wix/automations";

async function queryStorageItems() {
  const response = await storageItem
    .queryStorageItems()
    .eq("type", "COUNTER")
    .descending("_updatedDate")
    .limit(10)
    .find();
  return response;
}

/* Promise resolves to:
 * {
 *   "items": [
 *     {
 *       "key": "test_sdk_example",
 *       "displayName": "SDK Example Test",
 *       "stringValue": {
 *         "value": "hello",
 *         "format": "PLAIN_TEXT"
 *       },
 *       "type": "STRING",
 *       "_id": "d08c1956-7561-4cd6-adbd-9c8a4487c5e5",
 *       "_createdDate": "2026-03-08T11:52:32.294Z",
 *       "_updatedDate": "2026-03-08T11:52:32.294Z"
 *     }
 *   ],
 *   "cursors": {}
 * }
 */

```

### queryStorageItems (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { storageItem } from '@wix/automations';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { storageItem },
  // Include the auth strategy and host as relevant
});


async function queryStorageItems(query) {
  const response = await myWixClient.storageItem.queryStorageItems(query);
};
```

---