> 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 # QueryFunctionTypes # Package: functions # Namespace: FunctionTypes # Method link: https://dev.wix.com/docs/api-reference/business-management/functions/function-types/query-function-types.md ## Permission Scopes: Manage Functions: SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS ## Introduction Retrieves a list of function types, given the provided paging, filtering, and sorting. Query Functions Types runs with these defaults, which you can override: - `paging.limit` is `50` - `paging.offset` is `0` > **Note:** Query Function Types doesn't support filters and sorting. To learn how to query functions, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/get-started/api-query-language.md). --- ## REST API ### Schema ``` Method: queryFunctionTypes Description: Retrieves a list of function types, given the provided paging, filtering, and sorting. Query Functions Types runs with these defaults, which you can override: - `paging.limit` is `50` - `paging.offset` is `0` > **Note:** Query Function Types doesn't support filters and sorting. To learn how to query functions, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/get-started/api-query-language.md). URL: https://www.wixapis.com/functions/v1/function-types/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. - 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. - 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 | 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). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QueryFunctionTypesResponse - name: functionTypes | type: array | description: Retrieved function types. - name: id | type: string | description: Function type GUID. - name: function | type: Function | description: Settings for functions created from this function type. - name: definitions | type: array | description: Function method definitions that specify when and how the function executes. - name: method | type: string | description: Method name. - name: input | type: Input | description: Function input schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function input. - name: ui | type: object | description: Defines how the function input is displayed in a site dashboard's function builder. - name: displayDescription | type: string | description: Input description displayed in a site dashboard's function builder. - name: builderServicePlugin | type: BuilderServicePlugin | description: Service plugin configuration for dynamic input schema fetching. - name: baseUri | type: string | description: The function type's associated service plugin's URL. - name: dynamicSchemaFetchingEnabled | type: boolean | description: Whether the associated service plugin supports appending the input schema dynamically. - name: output | type: Output | description: Function output schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function output. - name: ui | type: object | description: Defines how the function output is displayed in a site dashboard's function builder. - name: defined | type: State | description: Message for when the logic returns a result. - name: description | type: string | description: Description displayed in a site dashboard's function builder. - name: empty | type: State | description: Message for when the logic returns no result. - name: staticContent | type: StaticContent | description: Static content for the output - name: title | type: string | description: Static content title - name: description | type: string | description: Static content description - name: triggerId | type: string | description: GUID of the [trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md) that activates this function definition. - name: configuration | type: Configuration | description: Function configuration including service plugin settings and behavior options. - name: multipleInstancesAllowed | type: boolean | description: Whether the function can be implemented multiple times on a single site. - name: customInitialPreset | type: CustomInitialPreset | description: Initial preset to apply when building a function from scratch. - name: functionTemplateExtensionId | type: string | description: GUID of the template to apply. - name: enabled | type: boolean | description: Whether to apply the template to functions created from scratch. - name: scope | type: Scope | description: Scope of the function when multiple_instances_allowed is false - enum: - SITE: One function instance is allowed per site - ENTITY: One function instance is allowed per entity - name: entityScopeErrorMessage | type: string | description: Error message to display when entity scope validation fails. - name: servicePlugin | type: ServicePlugin | description: Service plugin configuration for function integration with business solutions. - name: fqdn | type: string | description: Service plugin fqdn. - name: schema | type: object | description: Service plugin configuration schema. - name: ui | type: object | description: How the service plugin is displayed in a site dashboard's function builder. - name: description | type: Description | description: Function descriptions, such as text to display in a site dashboard's function builder. - name: aboutDescription | type: string | description: Explains what the function does. - name: howItWorksDescription | type: string | description: Explains how the function works. - name: outcomeDescription | type: string | description: Expected outcome when the function runs. - name: representativeImage | type: Image | description: Function type's image displayed in the function catalog and builder. - 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: builderlessTemplateSelectionModalTitle | type: string | description: Title of the builderless function template selection modal. - name: builderlessTemplateSelectionModalSubtitle | type: string | description: Subtitle of the builderless function template selection modal. - name: appDefId | type: string | description: GUID of the Wix app that defines this function type. - name: appName | type: string | description: Display name of the Wix app that defines this function type. - name: functionExtensionName | type: string | description: Display name of the function type. - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for the paginated results. - name: count | type: integer | description: Number of items returned in current page. - 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. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - 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 Function Types ```curl curl -X POST \ https://www.wixapis.com/functions/v1/types/query \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' -d '{ "query": { "sort": [] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.functions.FunctionTypes.queryFunctionTypes(query) Description: Retrieves a list of function types, given the provided paging, filtering, and sorting. Query Functions Types runs with these defaults, which you can override: - `paging.limit` is `50` - `paging.offset` is `0` > **Note:** Query Function Types doesn't support filters and sorting. To learn how to query functions, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/get-started/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: FunctionTypeQuery | 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. - 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. - 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 | 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). - 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: functionTypes | type: array | description: Retrieved function types. - name: _id | type: string | description: Function type GUID. - name: function | type: Function | description: Settings for functions created from this function type. - name: definitions | type: array | description: Function method definitions that specify when and how the function executes. - name: method | type: string | description: Method name. - name: input | type: Input | description: Function input schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function input. - name: ui | type: object | description: Defines how the function input is displayed in a site dashboard's function builder. - name: displayDescription | type: string | description: Input description displayed in a site dashboard's function builder. - name: builderServicePlugin | type: BuilderServicePlugin | description: Service plugin configuration for dynamic input schema fetching. - name: baseUri | type: string | description: The function type's associated service plugin's URL. - name: dynamicSchemaFetchingEnabled | type: boolean | description: Whether the associated service plugin supports appending the input schema dynamically. - name: output | type: Output | description: Function output schema and UI definition. - name: schema | type: object | description: JSON schema that defines the function output. - name: ui | type: object | description: Defines how the function output is displayed in a site dashboard's function builder. - name: defined | type: State | description: Message for when the logic returns a result. - name: description | type: string | description: Description displayed in a site dashboard's function builder. - name: empty | type: State | description: Message for when the logic returns no result. - name: staticContent | type: StaticContent | description: Static content for the output - name: title | type: string | description: Static content title - name: description | type: string | description: Static content description - name: triggerId | type: string | description: GUID of the [trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md) that activates this function definition. - name: configuration | type: Configuration | description: Function configuration including service plugin settings and behavior options. - name: multipleInstancesAllowed | type: boolean | description: Whether the function can be implemented multiple times on a single site. - name: customInitialPreset | type: CustomInitialPreset | description: Initial preset to apply when building a function from scratch. - name: functionTemplateExtensionId | type: string | description: GUID of the template to apply. - name: enabled | type: boolean | description: Whether to apply the template to functions created from scratch. - name: scope | type: Scope | description: Scope of the function when multiple_instances_allowed is false - enum: - SITE: One function instance is allowed per site - ENTITY: One function instance is allowed per entity - name: entityScopeErrorMessage | type: string | description: Error message to display when entity scope validation fails. - name: servicePlugin | type: ServicePlugin | description: Service plugin configuration for function integration with business solutions. - name: fqdn | type: string | description: Service plugin fqdn. - name: schema | type: object | description: Service plugin configuration schema. - name: ui | type: object | description: How the service plugin is displayed in a site dashboard's function builder. - name: description | type: Description | description: Function descriptions, such as text to display in a site dashboard's function builder. - name: aboutDescription | type: string | description: Explains what the function does. - name: howItWorksDescription | type: string | description: Explains how the function works. - name: outcomeDescription | type: string | description: Expected outcome when the function runs. - name: representativeImage | type: string | description: Function type's image displayed in the function catalog and builder. - name: builderlessTemplateSelectionModalTitle | type: string | description: Title of the builderless function template selection modal. - name: builderlessTemplateSelectionModalSubtitle | type: string | description: Subtitle of the builderless function template selection modal. - name: appDefId | type: string | description: GUID of the Wix app that defines this function type. - name: appName | type: string | description: Display name of the Wix app that defines this function type. - name: functionExtensionName | type: string | description: Display name of the function type. - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for the paginated results. - name: count | type: integer | description: Number of items returned in current page. - 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. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - 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 function types ```javascript import { functionTypes } from "@wix/functions"; async function queryFunctionTypes() { const response = await functionTypes.queryFunctionTypes().find(); } /* Promise resolves to: * { * "functionTypes": [{ "id": "...", "function": {...}, "appDefId": "...", ... }], * "pagingMetadata": { "hasNext": false } * } */ ``` ### queryFunctionTypes (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 { functionTypes } from '@wix/functions'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { functionTypes }, // Include the auth strategy and host as relevant }); async function queryFunctionTypes(query) { const response = await myWixClient.functionTypes.queryFunctionTypes(query); }; ``` ---