> 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

# GetFunctionTemplate

# Package: functions

# Namespace: FunctionTemplates

# Method link: https://dev.wix.com/docs/api-reference/business-management/functions/function-templates/get-function-template.md

## Permission Scopes:
Manage Functions: SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS

## Introduction

Retrieves a function template by ID.

---

## REST API

### Schema

```
 Method: getFunctionTemplate
 Description: Retrieves a function template by GUID.
 URL: https://www.wixapis.com/api/functions/v1/templates/{appDefId}/{functionTemplateId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  functionTemplateId, appDefId
 Method parameters: 
   param name: appDefId | type:   none | required: true 
   param name: functionTemplateId | type:   none | required: true 
 Return type: GetFunctionTemplateResponse
  - name: functionTemplate | type: FunctionTemplate | description: The requested function template.  
     - name: functionId | type: string | description: GUID of the function built to create this template. This is the function that was built by the business solution to create the template.  | read-only: true | validation: format GUID
     - name: originFunctionId | type: string | description: GUID of the original function that was copied to create this template.  | read-only: true | validation: format GUID
     - name: originMetaSiteId | type: string | description: GUID of the Wix site where the original function was created.  | read-only: true | validation: format GUID
     - name: displayName | type: string | description: Display name. This is the name used in the function builder in the [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ffunctions/manage).  | validation: maxLength 255
     - name: displayDescription | type: string | description: Description of what the function template's logic does.  | validation: maxLength 3000
     - name: appDefId | type: string | description: App GUID of the business solution that created this template. This is the same as the app GUID of the business solution that created the template's function type.  | read-only: true | validation: format GUID
     - name: id | type: string | description: Function template GUID.  | read-only: true | validation: format GUID
     - name: version | type: string | description: Function template version. This changes when the business solution updates the template.  | read-only: true | validation: format int64
     - name: functionExtensionId | type: string | description: GUID of the function type that this template was created from.  | read-only: true | validation: format GUID
     - name: formTemplateExtensionId | type: string | description: GUID of the form template to use for [builderless creation](https://dev.wix.com/docs/api-reference/business-management/functions/builderless-productions/create-function-builderless-production.md). Specify this GUID when calling [List Forms](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/list-forms.md) to retrieve the form values to use for builderless creation.  | validation: format GUID

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: FUNCTION_TEMPLATE_NOT_FOUND | Description: Couldn't find the function template associated with the specified app.


```

### Examples

### Get Function Template
```curl
curl -X GET \
  https://www.wixapis.com/api/functions/v1/templates/{app_def_id}/{function_template_id} \
  -H 'Authorization: <AUTH>' \
  -H "Content-Type: application/json" \
  -d '{
    "appDefId": "d49080e4-7b60-4dd4-b18a-f7ba7856bf27",
    "functionTemplateId": "63e22cb3-8b0b-4015-967a-5b865838e013"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.functions.functionTemplates.getFunctionTemplate(identifiers)
 Description: Retrieves a function template by GUID.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  identifiers.appDefId, identifiers.functionTemplateId, identifiers
 Method parameters: 
   param name: identifiers | type: GetFunctionTemplateIdentifiers  none | required: true 
        - name: appDefId | type: string | description: GUID of the app that owns the function template. | required: true | validation: format GUID
        - name: functionTemplateId | type: string | description: GUID of the function template to retrieve. | required: true | validation: format GUID
 Return type: PROMISE<FunctionTemplate>
  - name: functionId | type: string | description: GUID of the function built to create this template. This is the function that was built by the business solution to create the template.  | read-only: true | validation: format GUID
  - name: originFunctionId | type: string | description: GUID of the original function that was copied to create this template.  | read-only: true | validation: format GUID
  - name: originMetaSiteId | type: string | description: GUID of the Wix site where the original function was created.  | read-only: true | validation: format GUID
  - name: displayName | type: string | description: Display name. This is the name used in the function builder in the [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ffunctions/manage).  | validation: maxLength 255
  - name: displayDescription | type: string | description: Description of what the function template's logic does.  | validation: maxLength 3000
  - name: appDefId | type: string | description: App GUID of the business solution that created this template. This is the same as the app GUID of the business solution that created the template's function type.  | read-only: true | validation: format GUID
  - name: _id | type: string | description: Function template GUID.  | read-only: true | validation: format GUID
  - name: version | type: string | description: Function template version. This changes when the business solution updates the template.  | read-only: true | validation: format int64
  - name: functionExtensionId | type: string | description: GUID of the function type that this template was created from.  | read-only: true | validation: format GUID
  - name: formTemplateExtensionId | type: string | description: GUID of the form template to use for [builderless creation](https://dev.wix.com/docs/api-reference/business-management/functions/builderless-productions/create-function-builderless-production.md). Specify this GUID when calling [List Forms](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/list-forms.md) to retrieve the form values to use for builderless creation.  | validation: format GUID

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: FUNCTION_TEMPLATE_NOT_FOUND | Description: Couldn't find the function template associated with the specified app.


```

### Examples

### getFunctionTemplate
```javascript
import { functionTemplates } from '@wix/functions';

async function getFunctionTemplate(identifiers) {
  const response = await functionTemplates.getFunctionTemplate(identifiers);
};
```

### getFunctionTemplate (with elevated permissions)
```javascript
import { functionTemplates } from '@wix/functions';
import { auth } from '@wix/essentials';

async function myGetFunctionTemplateMethod(identifiers) {
  const elevatedGetFunctionTemplate = auth.elevate(functionTemplates.getFunctionTemplate);
  const response = await elevatedGetFunctionTemplate(identifiers);
}
```

### getFunctionTemplate (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 { functionTemplates } from '@wix/functions';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { functionTemplates },
  // Include the auth strategy and host as relevant
});


async function getFunctionTemplate(identifiers) {
  const response = await myWixClient.functionTemplates.getFunctionTemplate(identifiers);
};
```

---