> 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 # GetActionDynamicInputSchema # Package: actions # Namespace: ActionCatalogService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/get-action-dynamic-input-schema.md ## Permission Scopes: Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS ## Introduction Retrieves an action's dynamic [input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/the-action-input-schema.md) and [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema), based on the [action's input mapping](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#understanding-input-mapping). --- ## REST API ### Schema ``` Method: getActionDynamicInputSchema Description: Retrieves an action's dynamic [input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/the-action-input-schema.md) and [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema), based on the [action's input mapping](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#understanding-input-mapping). URL: https://www.wixapis.com/v1/actions/dynamic-input-schema Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: appId, actionKey, inputMapping Method parameters: param name: actionKey | type: actionKey | 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). | required: true | validation: minLength 5, maxLength 50 param name: appId | type: appId | 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). | required: true | validation: format GUID param name: inputMapping | type: inputMapping | description: Action input mapping as defined in the [action's input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/the-action-input-schema.md). The input mapping must include all parameters specified in the action's input schema's `required` array, and can include any other parameters from the schema. | required: true Return type: GetActionDynamicInputSchemaResponse - name: inputSchema | type: object | description: A [JSON schema](https://json-schema.org/) containing the action's added dynamic fields and its static fields. - name: uiSchema | type: object | description: A [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema) that describes the UI of the static and dynamic fields. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_INPUT_SCHEMA_NOT_DEFINED | Description: The action provider did not define an input schema for the requested action. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_NOT_FOUND | Description: The requested action does not have a matching service plugin implementer. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: GET_DYNAMIC_INPUT_SCHEMA_NOT_IMPLEMENTED | Description: The action provider does not implement dynamic input schema retrieval. ``` ### Examples ### Get action dynamic input schema ```curl curl -X POST 'https://www.wixapis.com/v1/actions/dynamic-input-schema' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236", "actionKey": "send-gift-card", "inputMapping": { "contactId": "{{var(\"contact.id\")}}", "amount": 50 } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.actions.ActionCatalogService.getActionDynamicInputSchema(appId, options) Description: Retrieves an action's dynamic [input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/the-action-input-schema.md) and [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema), based on the [action's input mapping](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#understanding-input-mapping). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: appId, options.actionKey, options.inputMapping, options Method parameters: param 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). | required: true | validation: format GUID param name: options | type: GetActionDynamicInputSchemaOptions none | required: true - 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). | required: true | validation: minLength 5, maxLength 50 - name: inputMapping | type: object | description: Action input mapping as defined in the [action's input schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/the-action-input-schema.md). The input mapping must include all parameters specified in the action's input schema's `required` array, and can include any other parameters from the schema. | required: true Return type: PROMISE - name: inputSchema | type: object | description: A [JSON schema](https://json-schema.org/) containing the action's added dynamic fields and its static fields. - name: uiSchema | type: object | description: A [UI schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-ui-schema) that describes the UI of the static and dynamic fields. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_INPUT_SCHEMA_NOT_DEFINED | Description: The action provider did not define an input schema for the requested action. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_NOT_FOUND | Description: The requested action does not have a matching service plugin implementer. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: GET_DYNAMIC_INPUT_SCHEMA_NOT_IMPLEMENTED | Description: The action provider does not implement dynamic input schema retrieval. ``` ### Examples ### Get action dynamic input schema Retrieves the dynamic input schema and UI schema for an action based on its input mapping. ```javascript import { actionCatalog } from "@wix/automations"; async function getActionDynamicInputSchema() { const response = await actionCatalog.getActionDynamicInputSchema({ appId: "e4c3e640-0b63-4bd9-8574-53f8c14e0236", actionKey: "send-gift-card", inputMapping: { contactId: "{{var(\"contact.id\")}}", amount: 50, }, }); return response; } /* Promise resolves to: * { * "inputSchema": { * "$schema": "http://json-schema.org/draft-07/schema", * "type": "object", * "required": ["contactId", "amount"], * "properties": { * "contactId": { "type": "string", "format": "uuid", "title": "Contact ID" }, * "amount": { "type": "number", "title": "Gift card amount" }, * "message": { "type": "string", "title": "Personal message" } * } * }, * "uiSchema": { * "ui:order": ["contactId", "amount", "message"] * } * } */ ``` ### getActionDynamicInputSchema (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 getActionDynamicInputSchema(appId,options) { const response = await myWixClient.actionCatalog.getActionDynamicInputSchema(appId,options); }; ``` ---