> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Package: automations # Namespace: storageItem # Webhook link: https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/storage-item-counter-updated.md ## Introduction # Webhook Permissions Scopes IDs: Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS --- ## REST API ### Schema ``` Webhook: Storage Item Counter Updated Description: Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: actionEvent | type: object | description: Custom action event details. - name: body | type: StorageItemCounterUpdated | description: The event body. - name: updatedStorageItem | type: StorageItem | description: Storage item with the updated counter. - ONE-OF: - name: stringValue | type: StringValue | description: When the item type is `STRING`, the string value. - name: value | type: string | description: String value. - 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. - 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. - name: id | type: string | description: Storage item GUID. - 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. - 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). - name: description | type: string | description: Storage item description. - name: type | type: Type | description: Data type of the storage item's value. Once created, you can't change the value's type. - 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. - name: updatedDate | type: string | description: When the storage item was last updated. - 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 | description: List of tag GUIDs. - 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). ``` ### Examples ```curl { "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef", "entityFqdn": "wix.automations.storage.v1.storage_item", "slug": "storage_item_counter_updated", "entityId": "b1234567-89ab-cdef-0123-456789abcdef", "actionEvent": { "bodyAsJson": "{\"updatedStorageItem\":{\"id\":\"b1234567-89ab-cdef-0123-456789abcdef\",\"key\":\"email_sent_count\",\"displayName\":\"Email Automation Counter\",\"description\":\"Tracks the number of emails sent by automation\",\"type\":\"COUNTER\",\"counterValue\":{\"value\":\"127\"},\"createdDate\":\"2024-01-10T08:15:30.000Z\",\"updatedDate\":\"2024-01-15T14:25:42.789Z\"}}" }, "eventTime": "2024-01-15T14:25:42.789Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onStorageItemCounterUpdated Description: Payload: StorageItemCounterUpdatedEnvelope - name: data | type: StorageItemCounterUpdated | description: none - name: updatedStorageItem | type: StorageItem | description: Storage item with the updated counter. - ONE-OF: - name: stringValue | type: StringValue | description: When the item type is `STRING`, the string value. - name: value | type: string | description: String value. - 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. - 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. - name: _id | type: string | description: Storage item GUID. - 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. - 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). - name: description | type: string | description: Storage item description. - name: type | type: Type | description: Data type of the storage item's value. Once created, you can't change the value's type. - 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. - name: _updatedDate | type: Date | description: When the storage item was last updated. - 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 | description: List of tag GUIDs. - 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). - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { storageItem } from '@wix/automations'; storageItem.onStorageItemCounterUpdated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { storageItem } from '@wix/automations'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { storageItem, }, }); wixClient.storageItem.onStorageItemCounterUpdated((event) => { // handle your event here }); ``` ---