> 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 # UpdateAction # Package: actions # Namespace: ActionCatalogService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/update-action.md ## Introduction Updates the specified action for the specified app. After the action is updated, it only contains the values specified in the request. Earlier values are replaced. --- ## REST API ### Schema ``` Method: updateAction Description: Updates the specified action for the specified app. After the action is updated, it only contains the values specified in the request. Earlier values are replaced. URL: https://www.wixapis.com/automations/actioncatalog/v1/action/{action.id} Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: action.appId, action.actionKey, action.id Method parameters: param name: action | type: Action | description: An action is a building block that Wix users can add to their automations. Each action represents a unit of functionality that an app installed on the site exposes for use in automations, such as sending an SMS, creating a coupon, or assigning loyalty points. A site's action catalog only contains actions provided by apps that are installed on the site. - name: id | type: string | description: Action GUID. | required: true | 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). | required: true | 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). | required: true | validation: minLength 5, maxLength 50 - 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: altText | type: string | description: Image alt text. - 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 Return type: UpdateActionResponse - name: updatedAction | type: Action | description: Updated action. - 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 Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: UNAUTHORIZED_APP | Description: The caller is not authorized to manage actions for the requested app. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_NOT_FOUND | Description: No action exists for the requested app and action key. ``` ### Examples ### Update an existing action ```curl curl -X PATCH 'https://www.wixapis.com/v1/action/a3d2f8e1-7c4b-4a9e-b6d5-1e8f3c2a9b7d' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "action": { "id": "a3d2f8e1-7c4b-4a9e-b6d5-1e8f3c2a9b7d", "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236", "actionKey": "send-gift-card", "displayName": "Send a gift card", "description": "Send a personalized gift card to a contact.", "inputSchema": { "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "required": ["contactId", "amount"], "properties": { "contactId": { "type": "string", "format": "uuid", "title": "Contact ID", "identityType": "contact" }, "amount": { "type": "number", "title": "Gift card amount" }, "message": { "type": "string", "title": "Personal message" }, "expirationDate": { "type": "string", "format": "date-time", "title": "Expiration date" } } }, "interfaceConfiguration": { "type": "GENERIC" } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.actions.ActionCatalogService.updateAction(_id, options) Description: Updates the specified action for the specified app. After the action is updated, it only contains the values specified in the request. Earlier values are replaced. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: action.appId, action.actionKey, _id Method parameters: param name: _id | type: string | description: Action GUID. | required: true | validation: format GUID param name: options | type: UpdateActionOptions none - name: action | type: Action | description: Action to update. - 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 - 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: 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: 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 Return type: PROMISE - 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 Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: UNAUTHORIZED_APP | Description: The caller is not authorized to manage actions for the requested app. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_NOT_FOUND | Description: No action exists for the requested app and action key. ``` ### Examples ### Update an existing action Updates an action's description and adds a new field to the input schema. ```javascript import { actionCatalog } from "@wix/automations"; const actionId = "a3d2f8e1-7c4b-4a9e-b6d5-1e8f3c2a9b7d"; const inputSchema = { $schema: "http://json-schema.org/draft-07/schema", type: "object", required: ["contactId", "amount"], properties: { contactId: { type: "string", format: "uuid", title: "Contact ID", identityType: "contact", }, amount: { type: "number", title: "Gift card amount", }, message: { type: "string", title: "Personal message", }, expirationDate: { type: "string", format: "date-time", title: "Expiration date", }, }, }; async function updateAction() { const response = await actionCatalog.updateAction(actionId, { action: { _id: actionId, appId: "e4c3e640-0b63-4bd9-8574-53f8c14e0236", actionKey: "send-gift-card", displayName: "Send a gift card", description: "Send a personalized gift card to a contact.", inputSchema, interfaceConfiguration: { type: "GENERIC" }, }, }); return response; } /* Promise resolves to: * { * "updatedAction": { * "_id": "a3d2f8e1-7c4b-4a9e-b6d5-1e8f3c2a9b7d", * "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236", * "actionKey": "send-gift-card", * "displayName": "Send a gift card", * "description": "Send a personalized gift card to a contact.", * "inputSchema": { ... }, * "implementedMethods": { "validateConfiguration": false, "getQuotaInfo": false }, * "interfaceConfiguration": { "type": "GENERIC" }, * "_createdDate": "2024-11-15T10:30:00.000Z", * "_updatedDate": "2024-11-20T14:45:00.000Z" * } * } */ ``` ### updateAction (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 updateAction(_id,options) { const response = await myWixClient.actionCatalog.updateAction(_id,options); }; ``` ---