> 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 # QueryActions # Package: actions # Namespace: ActionCatalogService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/query-actions.md ## Permission Scopes: Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS ## Introduction Retrieves a list of actions, based on the provided paging, filtering, and sorting. Returns every stored version of each matching action. To retrieve only the latest version of each action, call [Query Latest Actions](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/query-latest-actions.md). Query Actions 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: queryActions Description: Retrieves a list of actions, based on the provided paging, filtering, and sorting. Returns every stored version of each matching action. To retrieve only the latest version of each action, call [Query Latest Actions](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/query-latest-actions.md). Query Actions 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/actions/query Method: POST Method parameters: param name: query | type: QueryV2 - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - name: limit | type: integer | description: Maximum number of items to return in the results. | validation: minimum 0, maximum 500, 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 64000 - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` | validation: maxItems 4 - 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 - 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. | validation: maxItems 20, maxLength 200 - 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. | validation: maxItems 20, maxLength 200 Query fields: - field: id | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: appId | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: actionKey | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: displayName | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: source.type | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: metadata.hidden | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: implementedMethods.validateConfiguration | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: implementedMethods.getQuotaInfo | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined Return type: QueryActionsResponse - name: actions | type: array | description: Retrieved actions. - name: id | type: string | description: Action GUID. | validation: format GUID - name: appId | type: string | description: GUID of the [app that created the action](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | validation: format GUID - name: actionKey | type: string | description: Action key. Learn about [adding an action to your app](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | validation: minLength 5, maxLength 50 - name: inputSchema | type: object | description: Action [input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-input-schema). - name: outputSchema | type: object | description: Action [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema). - name: displayName | type: string | description: Action display name. Users see this name when they [choose an action for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-4-choose-an-action). For example, "Send SMS" or "Create Coupon". | validation: minLength 1, maxLength 80 - name: description | type: string | description: Action description displayed in the site dashboard to Wix users. - name: implementedMethods | type: ImplementedMethods | description: Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md#implement-the-service-plugin-methods) implemented for this action. - name: validateConfiguration | type: boolean | description: Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/validate-configuration.md) is implemented. Default: `false`. - name: getQuotaInfo | type: boolean | description: Whether [Get Quota Info](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/get-quota-info.md) is implemented. Default: `false`. - name: interfaceConfiguration | type: InterfaceConfiguration | description: Selected user interface for the action. The UI is displayed to the Wix user in the site dashboard when they configure the action. - ONE-OF: - name: genericOptions | type: GenericOptions | description: Details for the generic UI. - name: uiSchema | type: object | description: UI schema. - name: type | type: Type | description: Type of action configuration UI. - enum: - UNKNOWN_TYPE: Unknown action configuration UI. - GENERIC: The generic action configuration UI. This requires you to provide a [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema). - name: icon | type: Image | description: Action icon displayed in the [site dashboard](https://support.wix.com/en/article/about-your-wix-dashboard) to Wix users. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image filename. - name: createdDate | type: string | description: Date and time the action was created. | validation: format date-time - name: updatedDate | type: string | description: Date and time the action was last updated. | validation: format date-time - name: baseUri | type: string | description: Action base URI. Wix calls your action at this base address. Learn more about the [Action Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md). | validation: maxLength 256 - name: pagingMetadata | type: PagingMetadataV2 | description: Paging metadata of the response. - name: count | type: integer | description: Number of items returned in the response. | validation: format int32 - name: offset | type: integer | description: Offset that was requested. | validation: format int32 - 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. | validation: format int32 - 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. | validation: maxLength 64000 - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. | validation: maxLength 64000 ``` ### Examples ### Query actions ```curl curl -X POST 'https://www.wixapis.com/v1/actions/query' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "query": { "filter": { "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236" }, "paging": { "limit": 10 } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.actions.ActionCatalogService.queryActions(query) Description: Retrieves a list of actions, based on the provided paging, filtering, and sorting. Returns every stored version of each matching action. To retrieve only the latest version of each action, call [Query Latest Actions](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/query-latest-actions.md). Query Actions 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: ActionQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - name: limit | type: integer | description: Maximum number of items to return in the results. | validation: minimum 0, maximum 500, 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 64000 - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` | validation: maxItems 4 - 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, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: appId | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: actionKey | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: displayName | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: implementedMethods.validateConfiguration | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined - field: implementedMethods.getQuotaInfo | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined Return type: PROMISE - name: actions | type: array | description: Retrieved actions. - name: _id | type: string | description: Action GUID. | validation: format GUID - name: appId | type: string | description: GUID of the [app that created the action](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | validation: format GUID - name: actionKey | type: string | description: Action key. Learn about [adding an action to your app](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | validation: minLength 5, maxLength 50 - name: inputSchema | type: object | description: Action [input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-input-schema). - name: outputSchema | type: object | description: Action [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema). - name: displayName | type: string | description: Action display name. Users see this name when they [choose an action for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-4-choose-an-action). For example, "Send SMS" or "Create Coupon". | validation: minLength 1, maxLength 80 - name: description | type: string | description: Action description displayed in the site dashboard to Wix users. - name: implementedMethods | type: ImplementedMethods | description: Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md#implement-the-service-plugin-methods) implemented for this action. - name: validateConfiguration | type: boolean | description: Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/validate-configuration.md) is implemented. Default: `false`. - name: getQuotaInfo | type: boolean | description: Whether [Get Quota Info](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/get-quota-info.md) is implemented. Default: `false`. - name: interfaceConfiguration | type: InterfaceConfiguration | description: Selected user interface for the action. The UI is displayed to the Wix user in the site dashboard when they configure the action. - ONE-OF: - name: genericOptions | type: GenericOptions | description: Details for the generic UI. - name: uiSchema | type: object | description: UI schema. - name: type | type: Type | description: Type of action configuration UI. - enum: - UNKNOWN_TYPE: Unknown action configuration UI. - GENERIC: The generic action configuration UI. This requires you to provide a [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema). - name: icon | type: string | description: Action icon displayed in the [site dashboard](https://support.wix.com/en/article/about-your-wix-dashboard) to Wix users. - name: _createdDate | type: Date | description: Date and time the action was created. - name: _updatedDate | type: Date | description: Date and time the action was last updated. - name: baseUri | type: string | description: Action base URI. Wix calls your action at this base address. Learn more about the [Action Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md). | validation: maxLength 256 - name: pagingMetadata | type: PagingMetadataV2 | description: Paging metadata of the response. - name: count | type: integer | description: Number of items returned in the response. | validation: format int32 - name: offset | type: integer | description: Offset that was requested. | validation: format int32 - 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. | validation: format int32 - 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. | validation: maxLength 64000 - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. | validation: maxLength 64000 ``` ### Examples ### Query actions Queries all stored versions of actions, filtered by app ID. ```javascript import { actionCatalog } from "@wix/automations"; async function queryActions() { const response = await actionCatalog.queryActions({ query: { filter: { appId: "e4c3e640-0b63-4bd9-8574-53f8c14e0236", }, paging: { limit: 10 }, }, }); return response; } /* Promise resolves to: * { * "actions": [ * { * "_id": "a3d2f8e1-7c4b-4a9e-b6d5-1e8f3c2a9b7d", * "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236", * "actionKey": "send-gift-card", * "inputSchema": { ... }, * "displayName": "Send a gift card", * "description": "Send a gift card to a contact via email.", * "implementedMethods": { "validateConfiguration": false, "getQuotaInfo": false }, * "interfaceConfiguration": { "type": "GENERIC" }, * "_createdDate": "2024-11-15T10:30:00.000Z", * "_updatedDate": "2024-11-15T10:30:00.000Z" * } * ], * "pagingMetadata": { * "count": 1, * "cursors": { "next": "eyJsYXN0..." }, * "hasNext": false * } * } */ ``` ### queryActions (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 { actionCatalog } from '@wix/automations'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { actionCatalog }, // Include the auth strategy and host as relevant }); async function queryActions(query) { const response = await myWixClient.actionCatalog.queryActions(query); }; ``` ---