> 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 # QueryTriggers # Package: triggers # Namespace: TriggerCatalogService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-catalog/query-triggers.md ## Permission Scopes: Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS ## Introduction Retrieves a list of triggers, given the provided paging, filtering, and sorting. To query all triggers by a particular app, specify its `appId` in the query's `filter` object. Query Triggers runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order. - `paging.limit` is `50`. - `paging.offset` is `0`. To learn about working with query methods, see: - [API Query Language](https://dev.wix.com/docs/api-reference/articles/getting-started/api-query-language.md) - [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md) - [Field projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md) --- ## REST API ### Schema ``` Method: queryTriggers Description: Retrieves a list of triggers, given the provided paging, filtering, and sorting. To query all triggers by a particular app, specify its `appId` in the query's `filter` object. Query Triggers runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order. - `paging.limit` is `50`. - `paging.offset` is `0`. To learn about working with query methods, see: - [API Query Language](https://dev.wix.com/docs/api-reference/articles/getting-started/api-query-language.md) - [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md) - [Field projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md) URL: https://www.wixapis.com/v1/triggers/query Method: POST # 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: QueryV2 | required: true - name: paging | type: Paging | description: Paging options to limit and offset the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC - name: fields | type: array | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. - name: fieldsets | type: array | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. Return type: QueryTriggersResponse - name: results | type: array | description: Retrieved triggers. - name: id | type: string | description: Trigger GUID. - name: appId | type: string | description: GUID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md). - name: triggerKey | type: string | description: Trigger key. Learn about [setting up a trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger). - name: payloadDataSchema | type: object | description: Trigger [payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema.md). - name: displayName | type: string | description: Trigger display name. Users see this name when they [choose a trigger for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger). - name: filters | type: array | description: [Filter fields](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md#filter-fields) applied to the trigger payload schema. - ONE-OF: - name: staticFieldKey | type: string | description: The static field key. - name: dynamicFieldKey | type: DynamicFieldKey | description: Dynamic field key data. - name: label | type: string | description: Field key label. - name: description | type: string | description: Field key description. - name: entitySelector | type: EntitySelector | description: Selects the entity to be used as a dynamic field key. - name: id | type: string | description: Entity selector GUID. - name: queryFieldToFilterIdMapping | type: object | description: Mapping of the entity selector query fields to filter GUIDs. For example, let's say the Workflows `Card moved` trigger has 2 filters: - Select a workflow, with filter GUID `466d2067-05bd-44f9-99c7-d029b93e4feb`. - Select a step, with filter GUID `b45f8475-bd44-4971-8820-7031ee12a708`. The step entity selector requires the workflow GUID as input in order to return the list of relevant steps. We can map the `workflowId` field to the workflow filter in `queryFieldToFilterIdMapping`. When the Wix user selects a workflow in the workflow filter in the automation builder, Wix passes the selected workflow's GUID in the `workflowId` field to the step entity selector. The step filter then shows the relevant steps of the selected workflow for the user to select. - name: multiSelect | type: boolean | description: Whether a Wix user can select multiple items. Default: `false` - name: queryFieldToValueMapping | type: object | description: Mapping of the entity selector query fields to predefined values. This is useful when using the same entity selector in different triggers. For example: Let's say the `RSVPed to event` trigger has one filter, `Select a specific event`. This filter has an GUID `e91733fc-81b7-45ca-b50c-f0c292a23af5`. The events entity selector has a query field of `eventType`, that should be passed in order to return the list of relevant events. Otherwise, all events will be returned regardless of type. Map the `eventType` field to `RSVP`. When the Wix user selects an event in the event filter in the automation builder, the client shows only `RSVP` events in the selection options because the `eventType` field was set to `RSVP`. - name: id | type: string | description: Filter GUID. - name: fieldKeyType | type: FieldKeyType | description: Field key type. - enum: - UNKNOWN_FIELD_KEY_TYPE: The field key type is unknown. - STATIC_FIELD_KEY: The field key is a static value. - DYNAMIC_FIELD_KEY: The field key changes depending on the filter selection. - name: valueInput | type: ValueInput | description: Input field metadata. - ONE-OF: - name: entitySelector | type: EntitySelector | description: Entity selector details. - name: userInput | type: UserInput | description: User input details. - ONE-OF: - name: numberInputOptions | type: NumberInputOptions | description: Options for user input of type `number`. - name: defaultValue | type: integer | description: Default number value. - name: minValue | type: integer | description: Minimum number value. - name: maxValue | type: integer | description: Maximum number value. - name: booleanInputOptions | type: BooleanInputOptions | description: Options for user input of type `boolean`. - name: defaultValue | type: boolean | description: Default boolean value. - name: type | type: Type | description: User input type. - enum: - UNKNOWN_USER_INPUT: Unknown input type. - NUMBER: Number input type. - BOOLEAN: Boolean input type. - name: staticItems | type: StaticItems | description: Static value details. - name: multiSelect | type: boolean | description: Whether the Wix user can select multiple items Default: `false`. - name: staticValues | type: array | description: Static list of values for the Wix user to select. The value is saved on the automation-level trigger filter, and shown to Wix users at setup time if `displayName` is missing. `displayName` is optionally shown to users to help select a value. - name: id | type: string | description: item identifier - name: value | type: string | description: static value - name: displayName | type: string | description: optional displayName for the value - name: type | type: Type | description: Input value type. - enum: - UNKNOWN_VALUE_INPUT: Unknown filter field input. - ENTITY_SELECTOR: Filter field input is a selection of one from multiple entities, such as a form. - USER_INPUT: Filter field value is input from a Wix user. - STATIC_ITEMS: Filter field value is a static value defined in the payload schema. - name: label | type: string | description: Input field label. - name: description | type: string | description: Input field description. May be used for a tooltip. - name: required | type: boolean | description: Whether the Wix user is required to enter a value in the field. Default: `false` - name: reevaluateDynamicSchema | type: boolean | description: Whether Wix should reevaluate the dynamic schema when the field value changes. Default: `false` - name: followUpFilters | type: array | description: Filters to display after first selection is made. - name: implementedMethods | type: ImplementedMethods | description: Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md#implement-the-service-plugin-methods) implemented for this trigger. - name: validateConfiguration | type: boolean | description: Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/validate-configuration.md) is implemented. Default: `false`. - name: getDynamicSchema | type: boolean | description: Whether [Get Dynamic Schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/get-dynamic-schema.md) is implemented. Default: `false`. - name: refreshPayload | type: boolean | description: Whether [Refresh Payload](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/refresh-payload.md) is implemented. Default: `false`. - name: createdDate | type: string | description: Date and time the trigger was created. - name: updatedDate | type: string | description: Date and time the trigger was last updated. - name: baseUri | type: string | description: Trigger base URI. Wix calls your trigger at this base address. Learn more about the [Wix Automations Trigger Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md). - name: paging | type: PagingMetadataV2 | description: Paging metadata. - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### Query triggers ```curl curl -X POST 'https://www.wixapis.com/v1/triggers/query' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "query": { "filter": { "appId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "sort": [ { "fieldName": "createdDate", "order": "DESC" } ], "paging": { "limit": 10, "offset": 0 } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.triggers.TriggerCatalogService.queryTriggers(query) Description: Retrieves a list of triggers, given the provided paging, filtering, and sorting. To query all triggers by a particular app, specify its `appId` in the query's `filter` object. Query Triggers runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order. - `paging.limit` is `50`. - `paging.offset` is `0`. To learn about working with query methods, see: - [API Query Language](https://dev.wix.com/docs/api-reference/articles/getting-started/api-query-language.md) - [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md) - [Field projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.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: TriggerQuery | required: true - name: paging | type: Paging | description: Paging options to limit and offset the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: results | type: array | description: Retrieved triggers. - name: _id | type: string | description: Trigger GUID. - name: appId | type: string | description: GUID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md). - name: triggerKey | type: string | description: Trigger key. Learn about [setting up a trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger). - name: payloadDataSchema | type: object | description: Trigger [payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema.md). - name: displayName | type: string | description: Trigger display name. Users see this name when they [choose a trigger for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger). - name: filters | type: array | description: [Filter fields](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md#filter-fields) applied to the trigger payload schema. - ONE-OF: - name: staticFieldKey | type: string | description: The static field key. - name: dynamicFieldKey | type: DynamicFieldKey | description: Dynamic field key data. - name: label | type: string | description: Field key label. - name: description | type: string | description: Field key description. - name: entitySelector | type: EntitySelector | description: Selects the entity to be used as a dynamic field key. - name: _id | type: string | description: Entity selector GUID. - name: queryFieldToFilterIdMapping | type: object | description: Mapping of the entity selector query fields to filter GUIDs. For example, let's say the Workflows `Card moved` trigger has 2 filters: - Select a workflow, with filter GUID `466d2067-05bd-44f9-99c7-d029b93e4feb`. - Select a step, with filter GUID `b45f8475-bd44-4971-8820-7031ee12a708`. The step entity selector requires the workflow GUID as input in order to return the list of relevant steps. We can map the `workflowId` field to the workflow filter in `queryFieldToFilterIdMapping`. When the Wix user selects a workflow in the workflow filter in the automation builder, Wix passes the selected workflow's GUID in the `workflowId` field to the step entity selector. The step filter then shows the relevant steps of the selected workflow for the user to select. - name: multiSelect | type: boolean | description: Whether a Wix user can select multiple items. Default: `false` - name: queryFieldToValueMapping | type: object | description: Mapping of the entity selector query fields to predefined values. This is useful when using the same entity selector in different triggers. For example: Let's say the `RSVPed to event` trigger has one filter, `Select a specific event`. This filter has an GUID `e91733fc-81b7-45ca-b50c-f0c292a23af5`. The events entity selector has a query field of `eventType`, that should be passed in order to return the list of relevant events. Otherwise, all events will be returned regardless of type. Map the `eventType` field to `RSVP`. When the Wix user selects an event in the event filter in the automation builder, the client shows only `RSVP` events in the selection options because the `eventType` field was set to `RSVP`. - name: _id | type: string | description: Filter GUID. - name: fieldKeyType | type: FieldKeyType | description: Field key type. - enum: - UNKNOWN_FIELD_KEY_TYPE: The field key type is unknown. - STATIC_FIELD_KEY: The field key is a static value. - DYNAMIC_FIELD_KEY: The field key changes depending on the filter selection. - name: valueInput | type: ValueInput | description: Input field metadata. - ONE-OF: - name: entitySelector | type: EntitySelector | description: Entity selector details. - name: userInput | type: UserInput | description: User input details. - ONE-OF: - name: numberInputOptions | type: NumberInputOptions | description: Options for user input of type `number`. - name: defaultValue | type: integer | description: Default number value. - name: minValue | type: integer | description: Minimum number value. - name: maxValue | type: integer | description: Maximum number value. - name: booleanInputOptions | type: BooleanInputOptions | description: Options for user input of type `boolean`. - name: defaultValue | type: boolean | description: Default boolean value. - name: type | type: Type | description: User input type. - enum: - UNKNOWN_USER_INPUT: Unknown input type. - NUMBER: Number input type. - BOOLEAN: Boolean input type. - name: staticItems | type: StaticItems | description: Static value details. - name: multiSelect | type: boolean | description: Whether the Wix user can select multiple items Default: `false`. - name: staticValues | type: array | description: Static list of values for the Wix user to select. The value is saved on the automation-level trigger filter, and shown to Wix users at setup time if `displayName` is missing. `displayName` is optionally shown to users to help select a value. - name: _id | type: string | description: item identifier - name: value | type: string | description: static value - name: displayName | type: string | description: optional displayName for the value - name: type | type: Type | description: Input value type. - enum: - UNKNOWN_VALUE_INPUT: Unknown filter field input. - ENTITY_SELECTOR: Filter field input is a selection of one from multiple entities, such as a form. - USER_INPUT: Filter field value is input from a Wix user. - STATIC_ITEMS: Filter field value is a static value defined in the payload schema. - name: label | type: string | description: Input field label. - name: description | type: string | description: Input field description. May be used for a tooltip. - name: required | type: boolean | description: Whether the Wix user is required to enter a value in the field. Default: `false` - name: reevaluateDynamicSchema | type: boolean | description: Whether Wix should reevaluate the dynamic schema when the field value changes. Default: `false` - name: followUpFilters | type: array | description: Filters to display after first selection is made. - name: implementedMethods | type: ImplementedMethods | description: Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md#implement-the-service-plugin-methods) implemented for this trigger. - name: validateConfiguration | type: boolean | description: Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/validate-configuration.md) is implemented. Default: `false`. - name: getDynamicSchema | type: boolean | description: Whether [Get Dynamic Schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/get-dynamic-schema.md) is implemented. Default: `false`. - name: refreshPayload | type: boolean | description: Whether [Refresh Payload](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/refresh-payload.md) is implemented. Default: `false`. - name: _createdDate | type: Date | description: Date and time the trigger was created. - name: _updatedDate | type: Date | description: Date and time the trigger was last updated. - name: baseUri | type: string | description: Trigger base URI. Wix calls your trigger at this base address. Learn more about the [Wix Automations Trigger Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md). - name: paging | type: PagingMetadataV2 | description: Paging metadata. - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### Query triggers Queries triggers by app ID, sorted by created date descending. ```javascript import { triggerCatalog } from "@wix/automations"; async function queryTriggers() { // At least one filter is required. const response = await triggerCatalog .queryTriggers() .eq("appId", "a1b2c3d4-e5f6-7890-abcd-ef1234567890") .descending("_createdDate") .limit(10) .skip(0) .find(); return response; } /* Promise resolves to: * { * "items": [ * { * "appId": "225dd912-7dea-4738-8688-4b8c6955ffc2", * "triggerKey": "wix_form_app-form_submitted", * "payloadDataSchema": { * "properties": { * "formName": { "type": "string", "title": "Form name" }, * "contactId": { "format": "uuid", "title": "Contact ID", "type": "string" }, * "submissionTime": { "format": "date-time", "title": "Submission date and time", "type": "string" } * }, * "type": "object", * "$schema": "http://json-schema.org/draft-07/schema" * }, * "displayName": "Form submitted", * "maturity": "GA", * "filters": [], * "metadata": { "hidden": false }, * "implementedMethods": { "validateConfiguration": true, "getDynamicSchema": true, "refreshPayload": false }, * "source": { "type": "DEV_CENTER" }, * "namespace": "automations", * "componentId": "42dee157-3bcd-4f39-bac4-f82204d46298", * "_id": "17f7e8ef-c43d-4f94-8fb4-1fb6a0cd3292", * "_createdDate": "2025-09-03T07:23:34.275Z", * "_updatedDate": "2025-11-17T08:33:32.754Z" * } * ], * "cursors": {} * } */ ``` ### queryTriggers (self-hosted) Self-hosted 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 { triggerCatalog } from '@wix/automations'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { triggerCatalog }, // Include the auth strategy and host as relevant }); async function queryTriggers(query) { const response = await myWixClient.triggerCatalog.queryTriggers(query); }; ``` ---