> 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

# 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/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.  | 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
 Return type: QueryFunctionTypesResponse
  - name: functionTypes | type: array<FunctionType> | description: Retrieved function types.  
     - name: id | type: string | description: Function type GUID.  | read-only: true | validation: format GUID
     - name: function | type: Function | description: Settings for functions created from this function type.  
        - name: definitions | type: array<Definition> | description: Function method definitions that specify when and how the function executes.  | validation: maxItems 100
           - name: method | type: string | description: Method name.  | validation: maxLength 255
           - 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.  | validation: maxLength 200
              - 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.  | validation: maxLength 1000
                 - 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.  | validation: maxLength 200
              - 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  | validation: maxLength 100
                 - name: description | type: string | description: Static content description  | validation: maxLength 200
           - 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.  | read-only: true | validation: format GUID
        - 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.  | validation: format GUID
              - 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.  | validation: maxLength 200
           - name: servicePlugin | type: ServicePlugin | description: Service plugin configuration for function integration with business solutions.  
              - name: fqdn | type: string | description: Service plugin fqdn.  | validation: maxLength 200
              - 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.  | validation: maxLength 600
           - name: howItWorksDescription | type: string | description: Explains how the function works.  | validation: maxLength 1000
           - name: outcomeDescription | type: string | description: Expected outcome when the function runs.  | validation: maxLength 600
           - 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.  | validation: maxLength 10000
              - name: height | type: integer | description: Original image height.  | read-only: true 
              - name: width | type: integer | description: Original image width.  | read-only: true 
              - name: altText | type: string | description: Image alt text.  | validation: maxLength 10000
              - name: filename | type: string | description: Image filename.  | read-only: true | validation: maxLength 10000
           - name: builderlessTemplateSelectionModalTitle | type: string | description: Title of the builderless function template selection modal.  | validation: maxLength 100
           - name: builderlessTemplateSelectionModalSubtitle | type: string | description: Subtitle of the builderless function template selection modal.  | validation: maxLength 200
     - name: appDefId | type: string | description: GUID of the Wix app that defines this function type.  | validation: format GUID
     - name: appName | type: string | description: Display name of the Wix app that defines this function type.  | read-only: true | validation: maxLength 255
     - name: functionExtensionName | type: string | description: Display name of the function type.  | validation: minLength 0, maxLength 255
  - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for the paginated results.  
     - 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 Function Types
```curl
curl -X POST \
  https://www.wixapis.com/functions/v1/types/query \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>'
  -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.  | 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
 Return type: PROMISE<QueryFunctionTypesResponse>
  - name: functionTypes | type: array<FunctionType> | description: Retrieved function types.  
     - name: _id | type: string | description: Function type GUID.  | read-only: true | validation: format GUID
     - name: function | type: Function | description: Settings for functions created from this function type.  
        - name: definitions | type: array<Definition> | description: Function method definitions that specify when and how the function executes.  | validation: maxItems 100
           - name: method | type: string | description: Method name.  | validation: maxLength 255
           - 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.  | validation: maxLength 200
              - 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.  | validation: maxLength 1000
                 - 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.  | validation: maxLength 200
              - 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  | validation: maxLength 100
                 - name: description | type: string | description: Static content description  | validation: maxLength 200
           - 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.  | read-only: true | validation: format GUID
        - 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.  | validation: format GUID
              - 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.  | validation: maxLength 200
           - name: servicePlugin | type: ServicePlugin | description: Service plugin configuration for function integration with business solutions.  
              - name: fqdn | type: string | description: Service plugin fqdn.  | validation: maxLength 200
              - 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.  | validation: maxLength 600
           - name: howItWorksDescription | type: string | description: Explains how the function works.  | validation: maxLength 1000
           - name: outcomeDescription | type: string | description: Expected outcome when the function runs.  | validation: maxLength 600
           - 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.  | validation: maxLength 100
           - name: builderlessTemplateSelectionModalSubtitle | type: string | description: Subtitle of the builderless function template selection modal.  | validation: maxLength 200
     - name: appDefId | type: string | description: GUID of the Wix app that defines this function type.  | validation: format GUID
     - name: appName | type: string | description: Display name of the Wix app that defines this function type.  | read-only: true | validation: maxLength 255
     - name: functionExtensionName | type: string | description: Display name of the function type.  | validation: minLength 0, maxLength 255
  - name: pagingMetadata | type: CursorPagingMetadata | description: Metadata for the paginated results.  
     - 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 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-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 { 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);
};
```

---